XBee-Arduino  0.2
Public Member Functions | Protected Member Functions | List of all members
ZBTxRequest Class Reference

Represents a Series 2 TX packet that corresponds to Api Id: ZB_TX_REQUEST. More...

#include <XBee.h>

Inheritance diagram for ZBTxRequest:
PayloadRequest XBeeRequest

Public Member Functions

 ZBTxRequest (XBeeAddress64 &addr64, uint8_t *payload, uint8_t payloadLength)
 Creates a unicast ZBTxRequest with the ACK option and DEFAULT_FRAME_ID.
 
 ZBTxRequest (XBeeAddress64 &addr64, uint16_t addr16, uint8_t broadcastRadius, uint8_t option, uint8_t *payload, uint8_t payloadLength, uint8_t frameId)
 
 ZBTxRequest ()
 Creates a default instance of this class. More...
 
XBeeAddress64getAddress64 ()
 
uint16_t getAddress16 ()
 
uint8_t getBroadcastRadius ()
 
uint8_t getOption ()
 
void setAddress64 (XBeeAddress64 &addr64)
 
void setAddress16 (uint16_t addr16)
 
void setBroadcastRadius (uint8_t broadcastRadius)
 
void setOption (uint8_t option)
 
- Public Member Functions inherited from PayloadRequest
 PayloadRequest (uint8_t apiId, uint8_t frameId, uint8_t *payload, uint8_t payloadLength)
 
uint8_t * getPayload ()
 Returns the payload of the packet, if not null.
 
void setPayload (uint8_t *payloadPtr)
 Sets the payload array.
 
uint8_t getPayloadLength ()
 Returns the length of the payload array, as specified by the user.
 
void setPayloadLength (uint8_t payloadLength)
 Sets the length of the payload to include in the request. More...
 
- Public Member Functions inherited from XBeeRequest
 XBeeRequest (uint8_t apiId, uint8_t frameId)
 Constructor TODO make protected.
 
void setFrameId (uint8_t frameId)
 Sets the frame id. More...
 
uint8_t getFrameId ()
 Returns the frame id.
 
uint8_t getApiId ()
 Returns the API id.
 

Protected Member Functions

uint8_t getFrameData (uint8_t pos)
 Starting after the frame id (pos = 0) and up to but not including the checksum Note: Unlike Digi's definition of the frame data, this does not start with the API ID. More...
 
uint8_t getFrameDataLength ()
 Returns the size of the api frame (not including frame id or api id or checksum).
 
- Protected Member Functions inherited from XBeeRequest
void setApiId (uint8_t apiId)
 

Detailed Description

Represents a Series 2 TX packet that corresponds to Api Id: ZB_TX_REQUEST.

Be careful not to send a data array larger than the max packet size of your radio. This class does not perform any validation of packet size and there will be no indication if the packet is too large, other than you will not get a TX Status response. The datasheet says 72 bytes is the maximum for ZNet firmware and ZB Pro firmware provides the ATNP command to get the max supported payload size. This command is useful since the maximum payload size varies according to certain settings, such as encryption. ZB Pro firmware provides a PAYLOAD_TOO_LARGE that is returned if payload size exceeds the maximum.

Constructor & Destructor Documentation

ZBTxRequest::ZBTxRequest ( )

Creates a default instance of this class.

At a minimum you must specify a payload, payload length and a destination address before sending this request.

Member Function Documentation

uint8_t ZBTxRequest::getFrameData ( uint8_t  pos)
protectedvirtual

Starting after the frame id (pos = 0) and up to but not including the checksum Note: Unlike Digi's definition of the frame data, this does not start with the API ID.

The reason for this is the API ID and Frame ID are common to all requests, whereas my definition of frame data is only the API specific data.

Implements XBeeRequest.


The documentation for this class was generated from the following files: