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/ZigBeeExplicitTxRequest.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 "ZigBeeExplicitTxRequest.h" |
yangcq88517 | 0:837e6c48e90d | 2 | |
yangcq88517 | 0:837e6c48e90d | 3 | ZigBeeExplicitTxRequest::ZigBeeExplicitTxRequest(char frameID, ExplicitAddress * remoteAddress, OptionsBase * transmitOptions, const char * payload, int offset, int length) |
yangcq88517 | 0:837e6c48e90d | 4 | : TxBase(18 + length, APIFrame::Explicit_Addressing_ZigBee_Command_Frame, frameID) |
yangcq88517 | 0:837e6c48e90d | 5 | { |
yangcq88517 | 0:837e6c48e90d | 6 | sets(remoteAddress->getAddressValue(), 0, 10); |
yangcq88517 | 0:837e6c48e90d | 7 | sets(remoteAddress->getExplicitValue(), 0, 6); |
yangcq88517 | 0:837e6c48e90d | 8 | set(0x00); |
yangcq88517 | 0:837e6c48e90d | 9 | set(transmitOptions->getValue()); |
yangcq88517 | 0:837e6c48e90d | 10 | sets(payload, offset, length); |
yangcq88517 | 0:837e6c48e90d | 11 | } |
yangcq88517 | 0:837e6c48e90d | 12 | |
yangcq88517 | 0:837e6c48e90d | 13 | void ZigBeeExplicitTxRequest::setBroadcastRadius(char broadcastRadius) |
yangcq88517 | 0:837e6c48e90d | 14 | { |
yangcq88517 | 0:837e6c48e90d | 15 | data[18] = broadcastRadius; |
yangcq88517 | 0:837e6c48e90d | 16 | } |
yangcq88517 | 0:837e6c48e90d | 17 | |
yangcq88517 | 0:837e6c48e90d | 18 | void ZigBeeExplicitTxRequest::setTransmitOptions(OptionsBase * transmitOptions) |
yangcq88517 | 0:837e6c48e90d | 19 | { |
yangcq88517 | 0:837e6c48e90d | 20 | data[19] = transmitOptions->getValue(); |
yangcq88517 | 0:837e6c48e90d | 21 | } |
yangcq88517 | 0:837e6c48e90d | 22 | |
yangcq88517 | 0:837e6c48e90d | 23 | void ZigBeeExplicitTxRequest::setPayload(const char * data, int offset, int length) |
yangcq88517 | 0:837e6c48e90d | 24 | { |
yangcq88517 | 0:837e6c48e90d | 25 | setPosition(20); |
yangcq88517 | 0:837e6c48e90d | 26 | sets(data, offset, length); |
yangcq88517 | 0:837e6c48e90d | 27 | } |
yangcq88517 | 0:837e6c48e90d | 28 | |
yangcq88517 | 0:837e6c48e90d | 29 | void ZigBeeExplicitTxRequest::setRemoteAddress(Address * remoteAddress) |
yangcq88517 | 0:837e6c48e90d | 30 | { |
yangcq88517 | 0:837e6c48e90d | 31 | sets(2, remoteAddress->getAddressValue(), 0, 10); |
yangcq88517 | 0:837e6c48e90d | 32 | } |
yangcq88517 | 0:837e6c48e90d | 33 | |
yangcq88517 | 0:837e6c48e90d | 34 | void ZigBeeExplicitTxRequest::setRemoteAddress(ExplicitAddress * remoteAddress) |
yangcq88517 | 0:837e6c48e90d | 35 | { |
yangcq88517 | 0:837e6c48e90d | 36 | sets(2, remoteAddress->getAddressValue(), 0, 10); |
yangcq88517 | 0:837e6c48e90d | 37 | sets(12, remoteAddress->getExplicitValue(), 0, 6); |
yangcq88517 | 0:837e6c48e90d | 38 | } |