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.

Dependencies:   BufferedArray

Dependents:   MBEDminiproject

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ZigBeeExplicitRxIndicator.cpp Source File

ZigBeeExplicitRxIndicator.cpp

00001 #include "ZigBeeExplicitRxIndicator.h"
00002 
00003 ZigBeeExplicitRxIndicator::ZigBeeExplicitRxIndicator(APIFrame * frame)
00004     : RxBase(frame)
00005 { }
00006 
00007 unsigned  char * ZigBeeExplicitRxIndicator::getReceivedData()
00008 {
00009     if (getReceivedDataLength() <=0)
00010         return NULL;
00011 
00012     return data + 18;
00013 }
00014 
00015 int ZigBeeExplicitRxIndicator::getReceivedDataOffset()
00016 {
00017     return 18;
00018 }
00019 
00020 char ZigBeeExplicitRxIndicator::getReceivedData(int index)
00021 {
00022     return data[18 + index];
00023 }
00024 
00025 int ZigBeeExplicitRxIndicator::getReceivedDataLength()
00026 {
00027     return getPosition() - 18;
00028 }
00029 
00030 ExplicitAddress ZigBeeExplicitRxIndicator::getExplicitRemoteDevice()
00031 {
00032     return ExplicitAddress(data + 1, data + 11);
00033 }
00034 
00035 Address ZigBeeExplicitRxIndicator::getRemoteDevice()
00036 {
00037     return Address(data + 1);
00038 }
00039 
00040 int ZigBeeExplicitRxIndicator::getReceiveStatus()
00041 {
00042     return data[17];
00043 }
00044 
00045 int ZigBeeExplicitRxIndicator::getRSSI()
00046 {
00047     return 0;
00048 }
00049 
00050 bool  ZigBeeExplicitRxIndicator::convert(APIFrame * frame)
00051 {
00052     if (frame == NULL)
00053         return false;
00054 
00055     if (frame->getFrameType() != APIFrame::ZigBee_Explicit_Rx_Indicator)
00056         return false;
00057 
00058     return APIFrame::convert(frame);
00059 }