top

CUSTOMDEVICE

It supports to receive instances of customdevices and defines an administrator call setting that can manage instances.

customdevice class gets the customdevice's instance calling sucessCallback function for using custom device and calls the manager to receive a custom device's constant like connection/disconnection, status.

Add the following line for customdevice class into a html file your own :

  script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/deviceapis.js">/script>

You can declare customdevice class like this :

  ex) var customdevice = deviceapis.customdevice;


Constants

NameValueDescription
ERROR_CODE_NO_ERR0there was no error(success)
ERROR_CODE_ERR9999there was error
MGR_EVENT_DEV_CONNECT11device connection event
MGR_EVENT_DEV_DISCONNECT12device disconnection event
MGR_EVENT_DEV_STATUS13device status event
DEV_SMART_DEVICE33Smart phone or tablet type of device connected over WiFi
DEV_EVENT_MESSAGE_RECEIVED150message received from smart device event
DEV_EVENT_JOINED_GROUP151smart device joined group event
DEV_EVENT_LEFT_GROUP152smart device left group event

Methods

getCustomDevices

Description
request to get custom devices instances.
Parameters
■successCallback 
  - Function 
■errorCallback 
  - Function
Return■Void
Emulator SupportY
SDK ConstraintNone
Example
deviceapis.customdevice.getCustomDevices(successCallback, errorCallback);

registerManagerCallback

Description
request to set callback function to receive custom device manager event such as MGR_EVENT_DEV_CONNECT / MGR_EVENT_DEV_DISCONNECT / MGR_EVENT_DEV_STATUS.
Parameters
■callbackFn 
  - Function 
  - callback function that has prototype given as “void callbackFn(ManagerEvent)”
Return■Void
Emulator SupportY
SDK ConstraintNone
Example
deviceapis.customdevice.registerManagerCallback(cbFunc);