com.rapplogic.xbee.api.zigbee
Class ZNetTxRequest
java.lang.Object
com.rapplogic.xbee.api.XBeeRequest
com.rapplogic.xbee.api.zigbee.ZNetTxRequest
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ZNetExplicitTxRequest
public class ZNetTxRequest
- extends XBeeRequest
Series 2 XBee. Sends a packet to a remote radio. The remote radio
receives the data as a ZNetRxResponse packet.
API ID: 0x10
- Author:
- andrew
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ZNET_MAX_PAYLOAD_SIZE
public static final int ZNET_MAX_PAYLOAD_SIZE
- This is the maximum payload size for ZNet firmware, as specified in the datasheet.
This value is provided for reference only and is not enforced by this software unless
max size unless specified in the setMaxPayloadSize(int) method.
Note: this size refers to the packet size prior to escaping the control bytes.
Note: ZB Pro firmware provides the ATNP command to determine max payload size.
For ZB Pro firmware, the TX Status will return a PAYLOAD_TOO_LARGE (0x74) delivery status
if the payload size is exceeded
- See Also:
- Constant Field Values
DEFAULT_BROADCAST_RADIUS
public static final int DEFAULT_BROADCAST_RADIUS
- See Also:
- Constant Field Values
ZNetTxRequest
public ZNetTxRequest(int frameId,
XBeeAddress64 dest64,
XBeeAddress16 dest16,
int broadcastRadius,
ZNetTxRequest.Option option,
int[] payload)
- From manual p. 33:
The ZigBee Transmit Request API frame specifies the 64-bit Address and the network address (if
known) that the packet should be sent to. By supplying both addresses, the module will forego
network address Discovery and immediately attempt to route the data packet to the remote. If the
network address of a particular remote changes, network address and route discovery will take
place to establish a new route to the correct node. Upon successful
Key points:
- always specify the 64-bit address and also specify the 16-bit address, if known. Set
the 16-bit network address to 0xfffe if not known.
- check the 16-bit address of the tx status response frame as it may change.
- keep a hash table mapping of 64-bit address to 16-bit network address.
- Parameters:
frameId
- dest64
- dest16
- broadcastRadius
- option
- payload
-
ZNetTxRequest
public ZNetTxRequest(XBeeAddress64 dest64,
int[] payload)
- Abbreviated constructor for sending a unicast TX packet
- Parameters:
dest64
- payload
-
getFrameDataAsIntArrayOutputStream
protected IntArrayOutputStream getFrameDataAsIntArrayOutputStream()
getFrameData
public int[] getFrameData()
- Specified by:
getFrameData
in class XBeeRequest
getApiId
public ApiId getApiId()
- Overrides:
getApiId
in class XBeeRequest
getDestAddr64
public XBeeAddress64 getDestAddr64()
setDestAddr64
public void setDestAddr64(XBeeAddress64 destAddr64)
getDestAddr16
public XBeeAddress16 getDestAddr16()
setDestAddr16
public void setDestAddr16(XBeeAddress16 destAddr16)
getBroadcastRadius
public int getBroadcastRadius()
setBroadcastRadius
public void setBroadcastRadius(int broadcastRadius)
getOption
public ZNetTxRequest.Option getOption()
setOption
public void setOption(ZNetTxRequest.Option option)
getPayload
public int[] getPayload()
setPayload
public void setPayload(int[] payload)
toString
public java.lang.String toString()
- Overrides:
toString
in class XBeeRequest
getMaxPayloadSize
public int getMaxPayloadSize()
setMaxPayloadSize
public void setMaxPayloadSize(int maxPayloadSize)