com.buglabs.bug.module.bugbee
Class BUGBeeModletControl

java.lang.Object
  extended by com.buglabs.bug.module.bugbee.BUGBeeModletControl
All Implemented Interfaces:
com.buglabs.bug.module.bugbee.pub.IBUGBeeControl

public class BUGBeeModletControl
extends java.lang.Object
implements com.buglabs.bug.module.bugbee.pub.IBUGBeeControl


Field Summary
 
Fields inherited from interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
AF_DATA_CNF, ALL_ROUTERS_AND_COORD_ADDRESS, BINDING_ALLOWED_INDEFINITELY_TIMEOUT, BINDING_DISALLOWED_TIMEOUT, CREATE_BINDING_REQUEST, DEV_COORD_STARTING, DEV_END_DEVICE, DEV_END_DEVICE_UNAUTH, DEV_HOLD, DEV_INIT, DEV_NWK_DISC, DEV_NWK_JOINING, DEV_NWK_ORPHAN, DEV_NWK_REJOIN, DEV_ROUTER, DEV_ZB_COORD, DONT_RESET, HW_RESET, JOINING_OFF_TIMEOUT, JOINING_ON_INDEFINITELY_TIMEOUT, LOGICAL_TYPE_COORDINATOR, LOGICAL_TYPE_END_DEVICE, LOGICAL_TYPE_ROUTER, MAX_USER_DESC_LEN, MSG_DONTWAIT, MSG_PEEK, PRE_CFG_KEY_LEN, REMOVE_BINDING_REQUEST, START_OP_CLEAR_CONFIG, START_OP_CLEAR_STATE, START_OP_CURRENT, SW_RESET, ZAPSDUPLICATEENTRY, ZAPSFAIL, ZAPSILLEGALREQUEST, ZAPSINVALIDBINDING, ZAPSNOACK, ZAPSNOBOUNDDEVICE, ZAPSNOTALLOWED, ZAPSNOTAUTHENTICATED, ZAPSNOTSUPPORTED, ZAPSTABLEFULL, ZAPSUNSUPPORTEDATTRIB, ZB_ALLOW_BIND, ZB_ALLOW_BIND_CONFIRM, ZB_APP_REGISTER_REQ, ZB_BIND_CONFIRM, ZB_BIND_DEVICE, ZB_FIND_DEVICE_CONFIRM, ZB_FIND_DEVICE_REQUEST, ZB_GET_DEVICE_INFO, ZB_PERMIT_JOINING_REQ, ZB_RCV_DATA_IND, ZB_RESET_BY_EXT, ZB_RESET_BY_POWER_UP, ZB_RESET_BY_WATCHDOG, ZB_RESET_IND, ZB_SEND_DATA_CONFIRM, ZB_SEND_DATA_REQ, ZB_START_CONFIRM, ZB_START_REQUEST, ZBUFFERFULL, ZDO_END_DEVICE_ANNCE_IND, ZDO_MGMT_LQI_RSP, ZDOINVALIDENDPOINT, ZDOINVALIDREQUESTTYPE, ZDONOBINDENTRY, ZDONOMATCH, ZDOTABLEFULL, ZDOTIMEOUT, ZDOUNSUPPORTED, ZFAILURE, ZINVALIDPARAMETER, ZMACBEACONLOSS, ZMACCHANNELACCESSFAILURE, ZMACDENIED, ZMACDISABLETRXFAILURE, ZMACFAILEDSECURITYCHEC, ZMACFRAMETOOLONG, ZMACINVALIDGTS, ZMACINVALIDHANDLE, ZMACINVALIDPARAMETER, ZMACMEMERROR, ZMACNOACK, ZMACNOBEACON, ZMACNODATA, ZMACNOSHORTADDR, ZMACOUTOFCAP, ZMACPANIDCONFLICT, ZMACREALIGNMENT, ZMACTRANSACTIONEXPIRED, ZMACTRANSACTIONOVERFLOW, ZMACTXACTIVE, ZMACUNAVAILABLEKEY, ZMACUNSUPPORTED, ZMACUNSUPPORTEDATTRIBUTE, ZMEMERROR, ZNWKALREADYPRESENT, ZNWKINVALIDPARAM, ZNWKINVALIDREQUEST, ZNWKLEAVEUNCONFIRMED, ZNWKNOACK, ZNWKNONETWORKS, ZNWKNOROUTE, ZNWKNOTPERMITTED, ZNWKSTARTUPFAILURE, ZNWKSYNCFAILURE, ZNWKTABLEFULL, ZNWKUNKNOWNDEVICE, ZNWKUNSUPPORTEDATTRIBUTE, ZSAPIINPROGRESS, ZSAPINIT, ZSAPITIMEOUT, ZSECCCMFAIL, ZSECMAXFRMCOUNT, ZSECNOKEY, ZSECOLDFRMCOUNT, ZSUCCESS, ZUNSUPPORTEDMODE
 
Method Summary
 void allowBind(byte timeout)
          Puts the ZigBee device into the Allow Binding Mode for a given period of time.
 void bindDeviceRequest(byte bindingRequest, short commandId, com.buglabs.bug.module.bugbee.pub.IEEEAddress destination)
          Create or delete a ???binding??? to another device on the network.
 void configurePA(boolean powerAmpOn, byte powerLevel)
          Turn on and off the RF power amplifier capable of up to 100mW of output power.
 void findDeviceRequest(com.buglabs.bug.module.bugbee.pub.IEEEAddress device)
          Determine the short address for a device in the network.
 short getApsAckWaitDurationConfig()
           
 byte getApsFrameRetriesConfig()
           
 short getBindingTimeConfig()
           
 byte getBroadcastDeliveryTimeConfig()
           
 byte getBroadcastRetriesConfig()
           
 byte getChannel()
          Retrieve the channel the ZigBee PAN is operating on.
 int getChannelListConfig()
           
 com.buglabs.bug.module.bugbee.pub.IEEEAddress getExtendedPANID()
          Retrieve the extended PAN ID of the ZigBee PAN.
 com.buglabs.bug.module.bugbee.pub.IEEEAddress getIEEEAddress()
          Retrieve the ZigBee device's IEEE Address.
 byte getIndirectMessageTimeoutConfig()
           
 byte getLogicalTypeConfig()
           
 short getPANID()
          Retrieve the PAN ID of the ZigBee PAN.
 short getPANIDConfig()
           
 com.buglabs.bug.module.bugbee.pub.IEEEAddress getParentIEEEAddress()
          Retrieve the IEEE Address of the ZigBee device's parent.
 short getParentShortAddress()
          Retrieve the short address of the ZigBee device's parent.
 byte getPassiveAckTimeoutConfig()
           
 byte getPollFailureRetriesConfig()
           
 short getPollRateConfig()
           
 byte[] getPreCfgKeyConfig()
           
 boolean getPreCfgKeyEnableConfig()
           
 short getQueuePollRateConfig()
           
 short getResponsePollRateConfig()
           
 byte getRouteExpiryTimeConfig()
           
 boolean getSecurityModeConfig()
           
 short getShortAddress()
          Retrieve the ZigBee device's short address.
 byte getStartUpOptionConfig()
           
 int getState()
          Retrieve the ZigBee device's current state.
 java.lang.String getUserDescConfig()
           
 void permitJoining(short deviceId, byte timeout)
          Control the joining permission and allow or disallow new devices from joining the network.
 int read(byte[] buf, int len, int flags)
          read a control message response from the ZigBee device; this may be in response to a previously-issues command such as @see #findDeviceRequest(IEEEAddress)
 void registerAFRequest(byte appEndPoint, short appProfileId, short deviceId, byte deviceVersion, short[] inputCommands, short[] outputCommands)
          An Application Registration Request (AF Interface) Registers the profile ID as well as the list of commands that the device ???output??? or ???input??? to the ZigBee device.
 void registerAppRequest(byte appEndPoint, short appProfileId, short deviceId, byte deviceVersion, short[] appInClusterList, short[] appOutClusterList)
          An Application Registration Request (SAPI) Registers the profile ID as well as the list of commands that the device ???output??? or ???input??? to the ZigBee device.
 void reset(byte resetType)
          Resets the ZigBee device (not the entire BUGbee module).
 void sendZAccelCommand(short command, byte[] data)
          Send an arbitrary Z-Accel command directly to the device.
 void setApsAckWaitDurationConfig(short apsAckWaitDuration)
          The amount of time to wait for ACK packet before retransmission.
 void setApsFrameRetriesConfig(byte apsFrameRetries)
          Number of retransmissions of a data packet at the application layer.
 void setBindingTimeConfig(short bindingTime)
          The amount of time (in ms) a device will wait for a response to a binding request.
 void setBroadcastDeliveryTimeConfig(byte broadcastDeliveryTime)
          The maximum amount of time (in units of 100ms) that it can take for a broadcast packet to propagate through the entire network.
 void setBroadcastRetriesConfig(byte broadcastRetries)
          Max number for broadcast packet retransmission.
 void setChannelListConfig(int channelList)
          Bit mask of the channels on which this network can operate.
 void setIndirectMessageTimeoutConfig(byte indirectMessageTimeout)
          The amount of time (in seconds) that a router or coordinator will buffer messages destined to their end-device child nodes.
 void setInterfaceState(boolean interfaceUp)
          Brings up the interface (if interfaceUp is true).
 void setLogicalTypeConfig(byte logicalType)
          Set the ZigBee logical type of the device.
 void setPANIDConfig(short PANID)
          This parameter identifies the ZigBee network.
 void setPassiveAckTimeoutConfig(byte passiveAckTimeout)
          Duration to wait (in 100ms) before retransmitting a broadcast packet Default is 5.
 void setPollFailureRetriesConfig(byte pollFailureRetries)
          The number of times to retry before invoking the rejoin mechanism.
 void setPollRateConfig(short pollRate)
          An End-device will wake up periodically with the non-zero duration to check for data with its parent device.
 void setPreCfgKeyConfig(byte[] preCfgKey)
          PreCfgKey is used for securing and un-securing packets in the network, if security is enabled for the network.
 void setPreCfgKeyEnableConfig(boolean preCfgKeyEnable)
          If security functionality is enabled, there are two options to distribute the security key to all devices in the network.
 void setQueuePollRateConfig(short pollRate)
          Duration to retry if the first poll fails.
 void setResponsePollRateConfig(short pollRate)
          Duration to poll for response after sending a data packet out.
 void setRouteExpiryTimeConfig(byte routeExpiryTime)
          The amount of time (in seconds) for which a route must be idle ( i.e.
 void setSecurityModeConfig(boolean securityMode)
          Enable or disable security mode.
 void setStartUpOptionConfig(byte option)
          Controls the device startup options.
 void setUserDescConfig(java.lang.String userDesc)
          An optional user-defined data (upto 16bytes ) that can be configured in the ZigBee device so that it can easily identified or described later.
 void startRequest()
          Starts the stack on the ZigBee device; blocks until confirmation is received from the device that the stack is running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

reset

public void reset(byte resetType)
           throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Resets the ZigBee device (not the entire BUGbee module).

Specified by:
reset in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Parameters:
resetType - one of DONT_RESET, HW_RESET or SW_RESET
Throws:
java.io.IOException

getState

public int getState()
             throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Retrieve the ZigBee device's current state.

Specified by:
getState in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Returns:
one of the DEV_ types above.
Throws:
java.io.IOException

getIEEEAddress

public com.buglabs.bug.module.bugbee.pub.IEEEAddress getIEEEAddress()
                                                             throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Retrieve the ZigBee device's IEEE Address.

Specified by:
getIEEEAddress in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Returns:
the ZigBee device's IEEE Address
Throws:
java.io.IOException

getShortAddress

public short getShortAddress()
                      throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Retrieve the ZigBee device's short address.

Specified by:
getShortAddress in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Returns:
device's short address
Throws:
java.io.IOException

getParentIEEEAddress

public com.buglabs.bug.module.bugbee.pub.IEEEAddress getParentIEEEAddress()
                                                                   throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Retrieve the IEEE Address of the ZigBee device's parent.

Specified by:
getParentIEEEAddress in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Returns:
parent's IEEE Address
Throws:
java.io.IOException

getParentShortAddress

public short getParentShortAddress()
                            throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Retrieve the short address of the ZigBee device's parent.

Specified by:
getParentShortAddress in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Returns:
parent's short address
Throws:
java.io.IOException

getPANID

public short getPANID()
               throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Retrieve the PAN ID of the ZigBee PAN.

Specified by:
getPANID in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Returns:
the PAN's ID
Throws:
java.io.IOException

getExtendedPANID

public com.buglabs.bug.module.bugbee.pub.IEEEAddress getExtendedPANID()
                                                               throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Retrieve the extended PAN ID of the ZigBee PAN.

Specified by:
getExtendedPANID in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Returns:
the PAN's extended ID
Throws:
java.io.IOException

getChannel

public byte getChannel()
                throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Retrieve the channel the ZigBee PAN is operating on.

Specified by:
getChannel in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Returns:
the PAN's channel.
Throws:
java.io.IOException

setInterfaceState

public void setInterfaceState(boolean interfaceUp)
                       throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Brings up the interface (if interfaceUp is true). This must be done before packets can be sent or received.

Specified by:
setInterfaceState in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

registerAppRequest

public void registerAppRequest(byte appEndPoint,
                               short appProfileId,
                               short deviceId,
                               byte deviceVersion,
                               short[] appInClusterList,
                               short[] appOutClusterList)
                        throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
An Application Registration Request (SAPI) Registers the profile ID as well as the list of commands that the device ???output??? or ???input??? to the ZigBee device. This information is used by the ZigBee device when the binding feature is used to bind complementary devices in the network. The user must register the application with the ZigBee device after every device reset, if he/she wishes to use the simple API interface. The AppEndpoint and AppProfileID fields should be populated with the same values for all devices in the network. TODO: Implement a mechanism that lets applications register a callback along with their app registration, so that incoming data packets for that endpoint get sent automatically to the app. Without this there can only really be one since otherwise the apps would be fighting over the data coming into IBUGBeePacket.read(byte[], int, int).

Specified by:
registerAppRequest in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Parameters:
appEndPoint - the end point of the device
appProfileId - the profile ID of the application
deviceId - the device description ID for this endpoint
deviceVersion - the device version number
appInClusterList - list of input cluster IDs (null or byte[0] if not N/A)
appOutClusterList - list of output cluster IDs (null or byte[0] if not N/A)
Throws:
java.io.IOException

registerAFRequest

public void registerAFRequest(byte appEndPoint,
                              short appProfileId,
                              short deviceId,
                              byte deviceVersion,
                              short[] inputCommands,
                              short[] outputCommands)
                       throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
An Application Registration Request (AF Interface) Registers the profile ID as well as the list of commands that the device ???output??? or ???input??? to the ZigBee device. This information is used by the ZigBee device when the binding feature is used to bind complementary devices in the network. The lists of input and output commands are only used by the ZigBee stack when performing binding. If the binding feature is not used, these may be ignored.

Specified by:
registerAFRequest in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
appProfileId - the profile id of the application. This should be set to the same value for all devices in the network.
deviceId - an application-specific identifier; it identifies the device type within the particular profile ID. This is not used by the ZigBee stack in any way other than to identify itself when requested.
deviceVersion - an application-specific identifier; it identifies the version of the device and is not used by the ZigBee stack in any way other than to identify itself when requested.
inputCommands - a list of identifiers of input commands that are processed by this application; set to null if N/A.
outputCommands - a list of identifiers of output commands that are generated by this application; set to null if N/A.
Throws:
java.io.IOException

startRequest

public void startRequest()
                  throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Starts the stack on the ZigBee device; blocks until confirmation is received from the device that the stack is running.

Specified by:
startRequest in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

permitJoining

public void permitJoining(short deviceId,
                          byte timeout)
                   throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Control the joining permission and allow or disallow new devices from joining the network. The device must be a coordinator or router to use this method.

Specified by:
permitJoining in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Parameters:
deviceId - the address of the device for which the joining permission should be set. This is usually the local device address or the special broadcast address that denotes all routers and coordinator (ALL_ROUTERS_AND_COORD_ADDRESS). This way the joining permissions of a single device or the whole network can be controlled.
timeout - the timeout in seconds for which the joining permissions should be turned on; setting to JOINING_OFF_TIMEOUT will turn off joining permissions entirely; setting to JOINING_ON_INDEFINITELY_TIMEOUT will turn on joining permissions indefinitely. Note that CC2480 docs incorrectly say indefinitely value is 65, but it is not.
Throws:
java.io.IOException

allowBind

public void allowBind(byte timeout)
               throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Puts the ZigBee device into the Allow Binding Mode for a given period of time. This allows a peer device to establish a binding with this device.

Specified by:
allowBind in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Parameters:
timeout - the timeout period in seconds; setting to BINDING_DISALLOWED_TIMEOUT will disable binding entirely; setting to BINDING_ALLOWED_INDEFINITELY_TIMEOUT will enable binding indefinitely.
Throws:
java.io.IOException

bindDeviceRequest

public void bindDeviceRequest(byte bindingRequest,
                              short commandId,
                              com.buglabs.bug.module.bugbee.pub.IEEEAddress destination)
                       throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Create or delete a ???binding??? to another device on the network. Once bound, an application can send messages to a device by referencing the commandId for the binding. The command can also be issued with NULL destination address (set to all zeros) to establish with another device that is in the Allow Bind mode.

Specified by:
bindDeviceRequest in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Parameters:
bindingRequest - CREATE_BINDING_REQUEST or REMOVE_BINDING_REQUEST
commandId - binding identifier
destination - the IEEE address of the device to bind to. Set to NULL if the destination address is unknown and it will bind to the destination device that is set to Allow Bind Mode
Throws:
java.io.IOException

findDeviceRequest

public void findDeviceRequest(com.buglabs.bug.module.bugbee.pub.IEEEAddress device)
                       throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Determine the short address for a device in the network. The device being discovered must both be a member of the same network. When the search is completed, the driver sends a Find Device Confirm message indication back through the control channel; @see #read(byte[], int, int)

Specified by:
findDeviceRequest in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

configurePA

public void configurePA(boolean powerAmpOn,
                        byte powerLevel)
                 throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Turn on and off the RF power amplifier capable of up to 100mW of output power. If you turn on the PA be careful not to have ZigBee devices too close to one another. See http://en.wikipedia.org/wiki/DBm Power level Output Power Output Power Power Amp Off 100mW Power Amp 0 0 dBm (1mW) 20 dBm (100mW) 1-2 -1 dBm 19 dBm (79mW) 3 -3 dBm 18.5 dBm (71mW) 4 -4 dBm 5-7 -5 dBm 18 dBm (63mw) 8-10 -8 dBm 11-14 -11 dBm 15-18 -15 dBm 11 dBm (13mW) 19-24 -19 dBm 25 -25 dBm (3uW) 1.5 dBm (1.4mW)

Specified by:
configurePA in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Parameters:
powerAmpOn - if true enable the PA, if false disable it
powerLevel - the power level; see the table above.
Throws:
java.io.IOException

sendZAccelCommand

public void sendZAccelCommand(short command,
                              byte[] data)
                       throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Send an arbitrary Z-Accel command directly to the device. Consult the Z-Accel 2.4 GHz ZigBee processor specification for the commands. (http://www.ti.com/lit/pdf/swra175). This method is only applicable to BUGbee modules containing the TI CC2430/2480 or similar.

Specified by:
sendZAccelCommand in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setStartUpOptionConfig

public void setStartUpOptionConfig(byte option)
                            throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Controls the device startup options. Default is START_OP_CURRENT.

Specified by:
setStartUpOptionConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getStartUpOptionConfig

public byte getStartUpOptionConfig()
                            throws java.io.IOException
Specified by:
getStartUpOptionConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setLogicalTypeConfig

public void setLogicalTypeConfig(byte logicalType)
                          throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Set the ZigBee logical type of the device. Default is COORDINATOR.

Specified by:
setLogicalTypeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getLogicalTypeConfig

public byte getLogicalTypeConfig()
                          throws java.io.IOException
Specified by:
getLogicalTypeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setPollRateConfig

public void setPollRateConfig(short pollRate)
                       throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
An End-device will wake up periodically with the non-zero duration to check for data with its parent device. Range 1-0xFFFF, in ms unit. If the value is zero, the device will not automatically wake up to poll for data. It needs an external trigger or an internal event (software timer even) to wake up the device. Default is 2000.

Specified by:
setPollRateConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getPollRateConfig

public short getPollRateConfig()
                        throws java.io.IOException
Specified by:
getPollRateConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setQueuePollRateConfig

public void setQueuePollRateConfig(short pollRate)
                            throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Duration to retry if the first poll fails. Default is 100.

Specified by:
setQueuePollRateConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getQueuePollRateConfig

public short getQueuePollRateConfig()
                             throws java.io.IOException
Specified by:
getQueuePollRateConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setResponsePollRateConfig

public void setResponsePollRateConfig(short pollRate)
                               throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Duration to poll for response after sending a data packet out. Default is 100.

Specified by:
setResponsePollRateConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getResponsePollRateConfig

public short getResponsePollRateConfig()
                                throws java.io.IOException
Specified by:
getResponsePollRateConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setPollFailureRetriesConfig

public void setPollFailureRetriesConfig(byte pollFailureRetries)
                                 throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
The number of times to retry before invoking the rejoin mechanism. Default is 2.

Specified by:
setPollFailureRetriesConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getPollFailureRetriesConfig

public byte getPollFailureRetriesConfig()
                                 throws java.io.IOException
Specified by:
getPollFailureRetriesConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setIndirectMessageTimeoutConfig

public void setIndirectMessageTimeoutConfig(byte indirectMessageTimeout)
                                     throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
The amount of time (in seconds) that a router or coordinator will buffer messages destined to their end-device child nodes. Recommend that this is at least greater than the poll rate. Default is 7.

Specified by:
setIndirectMessageTimeoutConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getIndirectMessageTimeoutConfig

public byte getIndirectMessageTimeoutConfig()
                                     throws java.io.IOException
Specified by:
getIndirectMessageTimeoutConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setApsFrameRetriesConfig

public void setApsFrameRetriesConfig(byte apsFrameRetries)
                              throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Number of retransmissions of a data packet at the application layer. Default is 3.

Specified by:
setApsFrameRetriesConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getApsFrameRetriesConfig

public byte getApsFrameRetriesConfig()
                              throws java.io.IOException
Specified by:
getApsFrameRetriesConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setApsAckWaitDurationConfig

public void setApsAckWaitDurationConfig(short apsAckWaitDuration)
                                 throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
The amount of time to wait for ACK packet before retransmission. Default is 3000.

Specified by:
setApsAckWaitDurationConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getApsAckWaitDurationConfig

public short getApsAckWaitDurationConfig()
                                  throws java.io.IOException
Specified by:
getApsAckWaitDurationConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setBindingTimeConfig

public void setBindingTimeConfig(short bindingTime)
                          throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
The amount of time (in ms) a device will wait for a response to a binding request. Default is 8000.

Specified by:
setBindingTimeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getBindingTimeConfig

public short getBindingTimeConfig()
                           throws java.io.IOException
Specified by:
getBindingTimeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setUserDescConfig

public void setUserDescConfig(java.lang.String userDesc)
                       throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
An optional user-defined data (upto 16bytes ) that can be configured in the ZigBee device so that it can easily identified or described later. The first byte is the length of the user descriptor data and must not be greater than IBUGBeeControl.MAX_USER_DESC_LEN.

Specified by:
setUserDescConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getUserDescConfig

public java.lang.String getUserDescConfig()
                                   throws java.io.IOException
Specified by:
getUserDescConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setPANIDConfig

public void setPANIDConfig(short PANID)
                    throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
This parameter identifies the ZigBee network. This should be set to a value between 0 and 0x3FFF. Networks that exist in the same vicinity must have different values for this parameter. It can be set to a special value of 0xFFFF to indicate ???don???t care???. Default is 0xFFFF.

Specified by:
setPANIDConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getPANIDConfig

public short getPANIDConfig()
                     throws java.io.IOException
Specified by:
getPANIDConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setChannelListConfig

public void setChannelListConfig(int channelList)
                          throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Bit mask of the channels on which this network can operate. Default is 0x00000800.

Specified by:
setChannelListConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getChannelListConfig

public int getChannelListConfig()
                         throws java.io.IOException
Specified by:
getChannelListConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setPreCfgKeyConfig

public void setPreCfgKeyConfig(byte[] preCfgKey)
                        throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
PreCfgKey is used for securing and un-securing packets in the network, if security is enabled for the network. Length is IBUGBeeControl.PRE_CFG_KEY_LEN.

Specified by:
setPreCfgKeyConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getPreCfgKeyConfig

public byte[] getPreCfgKeyConfig()
                          throws java.io.IOException
Specified by:
getPreCfgKeyConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setPreCfgKeyEnableConfig

public void setPreCfgKeyEnableConfig(boolean preCfgKeyEnable)
                              throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
If security functionality is enabled, there are two options to distribute the security key to all devices in the network. If this parameter is true, the same security key is assumed to be pre-configured in all devices in the network. If it is set to false, then the key only needs to be configured on the coordinator device. In this case, the key is distributed to each device upon joining by the coordinator. This key distribution will happen in the ???clear??? on the last hop of the packet transmission and this constitutes a brief ???period of vulnerability??? during which a malicious device can capture the key. Hence it is not recommended unless it can be ensured that there are no malicious devices in the vicinity at the time of network formation.

Specified by:
setPreCfgKeyEnableConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getPreCfgKeyEnableConfig

public boolean getPreCfgKeyEnableConfig()
                                 throws java.io.IOException
Specified by:
getPreCfgKeyEnableConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setSecurityModeConfig

public void setSecurityModeConfig(boolean securityMode)
                           throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Enable or disable security mode. Default is disabled.

Specified by:
setSecurityModeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getSecurityModeConfig

public boolean getSecurityModeConfig()
                              throws java.io.IOException
Specified by:
getSecurityModeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setBroadcastRetriesConfig

public void setBroadcastRetriesConfig(byte broadcastRetries)
                               throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Max number for broadcast packet retransmission. Default is 2.

Specified by:
setBroadcastRetriesConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getBroadcastRetriesConfig

public byte getBroadcastRetriesConfig()
                               throws java.io.IOException
Specified by:
getBroadcastRetriesConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setPassiveAckTimeoutConfig

public void setPassiveAckTimeoutConfig(byte passiveAckTimeout)
                                throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Duration to wait (in 100ms) before retransmitting a broadcast packet Default is 5.

Specified by:
setPassiveAckTimeoutConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getPassiveAckTimeoutConfig

public byte getPassiveAckTimeoutConfig()
                                throws java.io.IOException
Specified by:
getPassiveAckTimeoutConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setBroadcastDeliveryTimeConfig

public void setBroadcastDeliveryTimeConfig(byte broadcastDeliveryTime)
                                    throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
The maximum amount of time (in units of 100ms) that it can take for a broadcast packet to propagate through the entire network. This includes time for all retransmissions. This parameter must be set with caution. It must be set to a value of at least (ZCD_NV_BCAST_RETRIES + 1) * (ZCD_NV_PASSIVE_ACK_TIMEOUT). To be safe, the actual value should be higher than the above minimum by about 500ms or more. Default is 30.

Specified by:
setBroadcastDeliveryTimeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getBroadcastDeliveryTimeConfig

public byte getBroadcastDeliveryTimeConfig()
                                    throws java.io.IOException
Specified by:
getBroadcastDeliveryTimeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

setRouteExpiryTimeConfig

public void setRouteExpiryTimeConfig(byte routeExpiryTime)
                              throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
The amount of time (in seconds) for which a route must be idle ( i.e. no packets are transmitted on that route ) before that routing entry is marked as expired. An expired entry may be deleted if the table is full and the space is needed for another new routing entry. This can be set to a special value of 0 to turn off route- expiry. In this case, route entries are not expired.

Specified by:
setRouteExpiryTimeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

getRouteExpiryTimeConfig

public byte getRouteExpiryTimeConfig()
                              throws java.io.IOException
Specified by:
getRouteExpiryTimeConfig in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Throws:
java.io.IOException

read

public int read(byte[] buf,
                int len,
                int flags)
         throws java.io.IOException
Description copied from interface: com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
read a control message response from the ZigBee device; this may be in response to a previously-issues command such as @see #findDeviceRequest(IEEEAddress)

Specified by:
read in interface com.buglabs.bug.module.bugbee.pub.IBUGBeeControl
Parameters:
buf - the buffer into which the data should be read
len - the maximum number of bytes of data to read
flags - MSG_PEEK or MSG_DONTWAIT
Returns:
Throws:
java.io.IOException