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