public class CapabilitySnapshot extends Capability
Modifier and Type | Class and Description |
---|---|
static class |
CapabilitySnapshot.AttributeId
enum denoting various possible attributes of the
CapabilitySnapshot . |
static class |
CapabilitySnapshot.CommandId
enum denoting the possible Commands that can be sent for
CapabilitySnapshot . |
static class |
CapabilitySnapshot.GrabImage
This class can be sent as an argument to
Capability.sendResourceCommand(buzz.getcoco.iot.Command<T>, buzz.getcoco.iot.Capability.CommandStatusListener<T>) while sending Grab Image commands. |
static interface |
CapabilitySnapshot.SnapshotListener
Listener provides callback to listen for snapshot events.
|
static class |
CapabilitySnapshot.SnapshotStatus
possible values for status of snapshot.
|
Capability.CapabilityId, Capability.CommandStatusListener<T extends Capability.CommandId>
Modifier and Type | Field and Description |
---|---|
static Capability.CapabilityId |
ID |
Modifier | Constructor and Description |
---|---|
protected |
CapabilitySnapshot(int id,
Resource parent)
Constructor of the current class.
|
Modifier and Type | Method and Description |
---|---|
void |
captureSnapshot(java.lang.String downloadPath,
int heightPx,
int widthPx,
long timeout,
CapabilitySnapshot.SnapshotListener listener)
A function to capture snapshot from the resource.
|
protected Command<? extends Capability.CommandId> |
extendedCreateCommand(int primitiveCommandId,
com.google.gson.JsonElement commandParams)
A function to create the command from the Json params.
|
boolean |
supports(Capability.CommandId commandId)
This function checks if a command is supported or not, pass
null to check if capability supports any commands at all.
|
clearAndSetStandardCommandSet, containsAttribute, containsAttribute, createCommand, createCommandResponseArgs, getAttribute, getAttribute, getAttributeMap, getCapabilityWrapper, getId, getName, getParent, getSupportedCommands, hashCode, interceptCommand, internalAddAttribute, internalMarkAsReady, internalRemoveAttribute, internalSetName, internalSetParent, isReady, iterator, sendResourceCommand, setCapabilityWrapper, toString
public static final Capability.CapabilityId ID
protected CapabilitySnapshot(int id, Resource parent)
id
- The unique id Of the capabilityparent
- The parent Resource of the capability.public boolean supports(Capability.CommandId commandId)
Capability
supports
in class Capability
commandId
- The Id denoting the command to be sent.protected Command<? extends Capability.CommandId> extendedCreateCommand(int primitiveCommandId, com.google.gson.JsonElement commandParams)
Capability
extendedCreateCommand
in class Capability
primitiveCommandId
- The int form of the commandIdcommandParams
- The Json params that can form a commandpublic void captureSnapshot(java.lang.String downloadPath, int heightPx, int widthPx, long timeout, CapabilitySnapshot.SnapshotListener listener)
downloadPath
- The path to the file which has to downloaded.
NOTE: This should be the absolute pathheightPx
- The height of the image which has to be downloadedwidthPx
- The width of the image which has to be downloadedtimeout
- The timeout for this commandlistener
- The listener which will be triggered after the callback