| Modifier | Constructor and Description |
|---|---|
protected |
Device(long deviceNodeId,
Network parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTuyaResource(java.lang.String metadata,
java.util.List<Parameter<InfoResponse.Value>> parameters,
long timeout,
Device.AddResourceListener listener)
This function is used to add the discovered resources to the resource list.
|
void |
addZigbeeResource(java.lang.String resourceEui,
java.lang.String metadata,
java.util.List<Parameter<InfoResponse.Value>> parameters,
long timeout,
Device.AddResourceListener listener)
This function is used to add the discovered resources to the resource list.
|
void |
addZwaveResource(java.lang.String metadata,
java.util.List<Parameter<InfoResponse.Value>> parameters,
long timeout,
Device.AddResourceListener listener)
This function is used to add the discovered resources to the resource list.
|
void |
configureWiFi(java.lang.String ssid,
java.lang.String password,
Device.DeviceManagementStatusListener listener)
Change the connected Wi-Fi of the device.
|
boolean |
containsResource(java.lang.String resourceEui)
This function checks membership of resource in resource map.
|
void |
discoverResources(RadioProtocol protocol,
Device.DiscoverResourceListener listener)
This function is used to discover resources of the given device which are present.
|
void |
discoverResources(RadioProtocol protocol,
long timeout,
Device.DiscoverResourceListener listener)
This function is used to discover resources of the given device which are present.
|
void |
forceRemoveResource(Resource resource,
Device.RemoveResourceListener listener)
FORCE Remove the resource from the device.
|
int[] |
getAvailableChannelPorts(int portCount)
A function to get free ports to talk to this device.
|
java.lang.String |
getDevicePsn()
A function to get the PSN of the device.
|
java.lang.String |
getFirmwareVersion()
A function to get the version of firmware the device is running.
|
long |
getId()
This function is used to get the unique identifier of the device.
|
java.lang.String |
getMake()
A function to get the Manufacturer name of the device.
|
java.lang.String |
getModel()
A function to get the model name of the device.
|
java.lang.String |
getName()
This function is used to get the Name of the device.
|
Network |
getParent()
This function is used to get the parent Network of the given device.
|
PowerSource |
getPowerSource()
A function to get the
PowerSource on which the device is running on. |
java.lang.String |
getProductName()
A function to get the product name of the device.
|
ReceiverType |
getReceiverType()
A function to get the
ReceiverType of the device. |
<T extends Resource> |
getResource(java.lang.String resourceEui)
This function is used to get the resource with the given EUI.
|
java.util.Map<java.lang.String,Resource> |
getResourceMap()
This function is used to return the HashMap that the sdk uses to map
the resourceEuis to the Resource Objects.
|
java.util.List<RadioProtocol> |
getSupportedProtocols()
A getter of list of supported radio protocols.
|
int |
hashCode() |
protected void |
internalAddResource(Resource resource) |
protected void |
internalRemoveDevice() |
protected void |
internalRemoveResource(java.lang.String resourceEui) |
protected void |
internalSetDevicePsn(java.lang.String devicePsn) |
protected void |
internalSetExtendable(boolean extendable) |
protected void |
internalSetFirmwareVersion(java.lang.String firmwareVersion) |
protected void |
internalSetMake(java.lang.String make) |
protected void |
internalSetModel(java.lang.String model) |
protected void |
internalSetName(java.lang.String deviceName) |
protected void |
internalSetParent(Network parent) |
protected void |
internalSetPowerSource(PowerSource powerSource) |
protected void |
internalSetProductName(java.lang.String productName) |
protected void |
internalSetProtocolSupported(int[] supportedProtocols) |
protected void |
internalSetReady(boolean ready) |
protected void |
internalSetReceiverType(ReceiverType receiverType) |
boolean |
isExtendable()
This function is used to indicate that the device is extendable or not.
|
boolean |
isReady()
A function suggesting if the device is made from
NativeCallbacks.deviceInfoCallback(boolean, boolean, java.lang.String, long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, int, boolean, int[], java.lang.String[], java.lang.Object)
or because of state retrieval. |
java.util.Iterator<Resource> |
iterator() |
void |
reboot(Device.DeviceManagementStatusListener listener) |
void |
removeResource(Resource resource,
java.util.List<Parameter<InfoResponse.Value>> parameters,
long timeout,
Device.RemoveResourceListener listener)
This function is used to remove the previously added resources.
|
void |
sendDeviceManagementCommand(Command<Device.CommandId> command,
Device.DeviceManagementStatusListener listener)
A function to send commands to device.
|
void |
sendInfoRequest(InfoRequest infoRequest,
Device.InfoRequestStatusListener listener)
A function to send InfoRequest to a device.
|
void |
sendInfoResponse(InfoResponse infoResponse,
Device.InfoResponseStatusListener listener)
A call to respond to the commandInfoRequest.
|
protected void |
setResourceMetadata(Resource resource,
java.lang.String metadata,
Device.DeviceManagementStatusListener listener) |
protected void |
setResourceName(Resource resource,
java.lang.String name,
Device.DeviceManagementStatusListener listener) |
boolean |
supportsProtocol(RadioProtocol radioProtocol)
This function offers an easy check if the Device in interest supports any of
RadioProtocol. |
java.lang.String |
toString() |
protected Device(long deviceNodeId,
Network parent)
public void sendDeviceManagementCommand(Command<Device.CommandId> command, Device.DeviceManagementStatusListener listener)
command - Command to be sent to Device.listener - The listener which will be triggered after the callbackpublic void reboot(Device.DeviceManagementStatusListener listener)
protected void setResourceName(Resource resource, java.lang.String name, Device.DeviceManagementStatusListener listener)
protected void setResourceMetadata(Resource resource, java.lang.String metadata, Device.DeviceManagementStatusListener listener)
public final long getId()
public java.lang.String getName()
public boolean isExtendable()
public final Network getParent()
public java.util.Map<java.lang.String,Resource> getResourceMap()
public final <T extends Resource> T getResource(java.lang.String resourceEui)
public boolean isReady()
NativeCallbacks.deviceInfoCallback(boolean, boolean, java.lang.String, long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, int, boolean, int[], java.lang.String[], java.lang.Object)
or because of state retrieval.public void discoverResources(RadioProtocol protocol, Device.DiscoverResourceListener listener)
protocol - The protocol which will be usedlistener - The listener which will be triggered after the callbackpublic void discoverResources(RadioProtocol protocol, long timeout, Device.DiscoverResourceListener listener)
protocol - The protocol which will be usedtimeout - The timeout for this commandlistener - The listener which will be triggered after the callbackpublic void addZwaveResource(java.lang.String metadata,
java.util.List<Parameter<InfoResponse.Value>> parameters,
long timeout,
Device.AddResourceListener listener)
metadata - The metadata that has to be set on this resourceparameters - The parameters to be passed while addingtimeout - The timeout for this commandlistener - The listener which will be triggered after the callbackpublic void addZigbeeResource(java.lang.String resourceEui,
java.lang.String metadata,
java.util.List<Parameter<InfoResponse.Value>> parameters,
long timeout,
Device.AddResourceListener listener)
resourceEui - The ID of the resource to be added.metadata - The metadata that has to be set on this resourceparameters - The parameters to be passed while addingtimeout - The timeout for this commandlistener - The listener which will be triggered after the callbackjava.lang.RuntimeException - Throws exception on communication failures etc..,public void addTuyaResource(java.lang.String metadata,
java.util.List<Parameter<InfoResponse.Value>> parameters,
long timeout,
Device.AddResourceListener listener)
metadata - The metadata that has to be set on this resourceparameters - The parameters to be passed while addingtimeout - The timeout for this commandlistener - The listener which will be triggered after the callbackjava.lang.RuntimeException - Throws exception on communication failures etc..,public void removeResource(Resource resource, java.util.List<Parameter<InfoResponse.Value>> parameters, long timeout, Device.RemoveResourceListener listener)
resource - The resource to be removed.parameters - The parameters to be passed while addinglistener - The listener which will be triggered after the callbackjava.lang.RuntimeException - Throws an exception on communication failures and other
cases like removing resources which haven't been added.public void forceRemoveResource(Resource resource, Device.RemoveResourceListener listener)
resource - The resource to be removed.listener - The listener which will be triggered after the callbackjava.lang.RuntimeException - Throws an exception on communication failures and other
cases like removing resources which haven't been added.public void configureWiFi(java.lang.String ssid,
java.lang.String password,
Device.DeviceManagementStatusListener listener)
ssid - SSID of the Wi-Fi to connectpassword - PASSWORD of the Wi-Fi to connectlistener - The listener which will be triggered after the callbackjava.lang.RuntimeException - Throws an exception on communication failures and other
cases like removing resources which haven't been added.public void sendInfoResponse(InfoResponse infoResponse, Device.InfoResponseStatusListener listener)
infoResponse - The response object to be sent.listener - The listener which will be triggered after the callbackpublic void sendInfoRequest(InfoRequest infoRequest, Device.InfoRequestStatusListener listener)
InfoResponse will be returned in CallbacksInterface.infoResponseCallback(buzz.getcoco.iot.InfoRequest, buzz.getcoco.iot.InfoResponse).infoRequest - The infoRequest object which will contain info to be queried on devicelistener - The listener which will be triggered with
CallbacksInterface.infoResponseCallback(buzz.getcoco.iot.InfoRequest, buzz.getcoco.iot.InfoResponse)public java.lang.String getDevicePsn()
public java.lang.String getProductName()
public java.lang.String getMake()
public java.lang.String getModel()
public java.lang.String getFirmwareVersion()
public PowerSource getPowerSource()
PowerSource on which the device is running on.public ReceiverType getReceiverType()
ReceiverType of the device.public int[] getAvailableChannelPorts(int portCount)
public boolean supportsProtocol(RadioProtocol radioProtocol)
RadioProtocol.radioProtocol - An enum with possible values of protocols for communication. Ex: Zigbeeprotected void internalSetProtocolSupported(int[] supportedProtocols)
public java.util.List<RadioProtocol> getSupportedProtocols()
RadioProtocolprotected void internalRemoveDevice()
protected void internalSetName(java.lang.String deviceName)
protected void internalSetDevicePsn(java.lang.String devicePsn)
protected void internalSetProductName(java.lang.String productName)
protected void internalSetMake(java.lang.String make)
protected void internalSetModel(java.lang.String model)
protected void internalSetFirmwareVersion(java.lang.String firmwareVersion)
protected void internalSetPowerSource(PowerSource powerSource)
protected void internalSetReceiverType(ReceiverType receiverType)
protected void internalSetExtendable(boolean extendable)
protected void internalSetParent(Network parent)
protected void internalSetReady(boolean ready)
public boolean containsResource(java.lang.String resourceEui)
resourceEui - The ID of the resourceprotected void internalAddResource(Resource resource)
protected void internalRemoveResource(java.lang.String resourceEui)
public final int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object