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/RemoteCommandIndicator.cpp
- Revision:
- 0:837e6c48e90d
- Child:
- 6:5f31ddc17239
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Indicator/RemoteCommandIndicator.cpp Thu Oct 22 12:28:26 2015 +0000 @@ -0,0 +1,59 @@ +#include "RemoteCommandIndicator.h" + +RemoteCommandIndicator::RemoteCommandIndicator(APIFrame * frame) + : RxBase(frame) +{} + +int RemoteCommandIndicator::getFrameID() +{ + return data[1]; +} + +char * RemoteCommandIndicator::getRequestCommand() +{ + return data + 12; +} + +int RemoteCommandIndicator::getCommandStatus() +{ + return data[14]; +} + +Address RemoteCommandIndicator::getRemoteDevice() +{ + return Address(data + 2); +} + +char * RemoteCommandIndicator::getParameter() +{ + if (getParameterLength() <= 0) + return NULL; + + return data + 15; +} + +char RemoteCommandIndicator::getParameter(int index) +{ + return data[15 + index]; +} + +int RemoteCommandIndicator::getParameterLength() +{ + return getPosition() - 15; +} + +int RemoteCommandIndicator::getParameterOffset() +{ + return 15; +} + +bool RemoteCommandIndicator::convert(APIFrame * frame) +{ + if (frame == NULL) + return false; + + if (frame->getFrameType() != APIFrame::Remote_Command_Response) + return false; + + return APIFrame::convert(frame); +}