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