XBee and XBee-PRO ZigBee RF modules provide cost-effective wireless connectivity to electronic devices. They are interoperable with other ZigBee PRO feature set devices, including devices from other vendors.
Request/ZigBeeTxRequest.cpp@0:837e6c48e90d, 2015-10-22 (annotated)
- Committer:
- yangcq88517
- Date:
- Thu Oct 22 12:28:26 2015 +0000
- Revision:
- 0:837e6c48e90d
- Child:
- 6:5f31ddc17239
initial upload
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangcq88517 | 0:837e6c48e90d | 1 | #include "ZigBeeTxRequest.h" |
yangcq88517 | 0:837e6c48e90d | 2 | |
yangcq88517 | 0:837e6c48e90d | 3 | ZigBeeTxRequest::ZigBeeTxRequest(char frameID, Address * remoteAddress, OptionsBase * transmitOptions, const char * payload, int offset, int length) |
yangcq88517 | 0:837e6c48e90d | 4 | : TxBase(9 + length, APIFrame::ZigBee_Transmit_Request, frameID) |
yangcq88517 | 0:837e6c48e90d | 5 | { |
yangcq88517 | 0:837e6c48e90d | 6 | sets(remoteAddress->getAddressValue(), 0, 10); |
yangcq88517 | 0:837e6c48e90d | 7 | set(0x00); |
yangcq88517 | 0:837e6c48e90d | 8 | set(transmitOptions->getValue()); |
yangcq88517 | 0:837e6c48e90d | 9 | sets(payload, offset, length); |
yangcq88517 | 0:837e6c48e90d | 10 | } |
yangcq88517 | 0:837e6c48e90d | 11 | |
yangcq88517 | 0:837e6c48e90d | 12 | void ZigBeeTxRequest::setPayload(const char * data, int offset, int length) |
yangcq88517 | 0:837e6c48e90d | 13 | { |
yangcq88517 | 0:837e6c48e90d | 14 | setPosition(14); |
yangcq88517 | 0:837e6c48e90d | 15 | sets(data, offset, length); |
yangcq88517 | 0:837e6c48e90d | 16 | } |
yangcq88517 | 0:837e6c48e90d | 17 | |
yangcq88517 | 0:837e6c48e90d | 18 | void ZigBeeTxRequest::setTransmitOptions(OptionsBase * transmitOptions) |
yangcq88517 | 0:837e6c48e90d | 19 | { |
yangcq88517 | 0:837e6c48e90d | 20 | data[13] = transmitOptions->getValue(); |
yangcq88517 | 0:837e6c48e90d | 21 | } |
yangcq88517 | 0:837e6c48e90d | 22 | |
yangcq88517 | 0:837e6c48e90d | 23 | void ZigBeeTxRequest::setRemoteAddress(Address * remoteAddress) |
yangcq88517 | 0:837e6c48e90d | 24 | { |
yangcq88517 | 0:837e6c48e90d | 25 | sets(2, remoteAddress->getAddressValue(), 0, 10); |
yangcq88517 | 0:837e6c48e90d | 26 | } |
yangcq88517 | 0:837e6c48e90d | 27 | |
yangcq88517 | 0:837e6c48e90d | 28 | |
yangcq88517 | 0:837e6c48e90d | 29 | void ZigBeeTxRequest::setBroadcastRadius(char broadcastRadius) |
yangcq88517 | 0:837e6c48e90d | 30 | { |
yangcq88517 | 0:837e6c48e90d | 31 | data[12] = broadcastRadius; |
yangcq88517 | 0:837e6c48e90d | 32 | } |