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.
Diff: Indicator/XBeeRx16Indicator.cpp
- Revision:
- 0:837e6c48e90d
- Child:
- 6:5f31ddc17239
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Indicator/XBeeRx16Indicator.cpp Thu Oct 22 12:28:26 2015 +0000 @@ -0,0 +1,54 @@ +#include "XBeeRx16Indicator.h" + +XBeeRx16Indicator::XBeeRx16Indicator(APIFrame * frame) + : RxBase(frame) +{ } + +char * XBeeRx16Indicator::getReceivedData() +{ + if (getReceivedDataLength() <= 0) + return NULL; + + return data + 5; +} + +int XBeeRx16Indicator::getReceivedDataOffset() +{ + return 5; +} + +char XBeeRx16Indicator::getReceivedData(int index) +{ + return data[5 + index]; +} + +int XBeeRx16Indicator::getReceivedDataLength() +{ + return getPosition() - 5; +} + +int XBeeRx16Indicator::getRSSI() +{ + return data[3] * -1; +} + +int XBeeRx16Indicator::getReceiveStatus() +{ + return data[4]; +} + +Address XBeeRx16Indicator::getRemoteDevice() +{ + return Address(NULL, data + 1); +} + +bool XBeeRx16Indicator::convert(APIFrame * frame) +{ + if (frame == NULL) + return false; + + if (frame->getFrameType() != APIFrame::Rx16_Receive_Packet) + return false; + + return APIFrame::convert(frame); +} \ No newline at end of file