XBee API operation library for mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RemoteCommandIndicator.cpp Source File

RemoteCommandIndicator.cpp

00001 #include "RemoteCommandIndicator.h"
00002 
00003 RemoteCommandIndicator::RemoteCommandIndicator(APIFrame * frame)
00004     : RxBase(frame)
00005 {}
00006 
00007 int RemoteCommandIndicator::getFrameID()
00008 {
00009     return data[1];
00010 }
00011 
00012 unsigned  char * RemoteCommandIndicator::getRequestCommand()
00013 {
00014     return data + 12;
00015 }
00016 
00017 int RemoteCommandIndicator::getCommandStatus()
00018 {
00019     return data[14];
00020 }
00021 
00022 Address RemoteCommandIndicator::getRemoteDevice()
00023 {
00024     return Address(data + 2);
00025 }
00026 
00027 unsigned  char * RemoteCommandIndicator::getParameter()
00028 {
00029     if (getParameterLength() <= 0)
00030         return NULL;
00031 
00032     return data + 15;
00033 }
00034 
00035 unsigned char RemoteCommandIndicator::getParameter(int index)
00036 {
00037     return data[15 + index];
00038 }
00039 
00040 int RemoteCommandIndicator::getParameterLength()
00041 {
00042     return getPosition() - 15;
00043 }
00044 
00045 int RemoteCommandIndicator::getParameterOffset()
00046 {
00047     return 15;
00048 }
00049 
00050 bool  RemoteCommandIndicator::convert(APIFrame * frame)
00051 {
00052     if (frame == NULL)
00053         return false;
00054 
00055     if (frame->getFrameType() != APIFrame::Remote_Command_Response)
00056         return false;
00057 
00058     return APIFrame::convert(frame);
00059 }