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 RemoteATCommandRequest.cpp Source File

RemoteATCommandRequest.cpp

00001 #include "RemoteATCommandRequest.h"
00002 
00003 RemoteATCommandRequest::RemoteATCommandRequest(unsigned  char frameID, Address * remoteAddress, const char * command, OptionsBase * transmitOptions, const unsigned  char * parameter, int parameterOffset, int parameterLength)
00004     : TxBase(13 + (parameter == NULL ? 0 : parameterLength), APIFrame::Remote_Command_Request, frameID)
00005 {
00006     sets(remoteAddress->getAddressValue(), 0, 10);
00007     set(transmitOptions->getValue());
00008     set(command[0]);
00009     set(command[1]);
00010 
00011     if (parameter != NULL)
00012         sets(parameter, parameterOffset, parameterLength);
00013 }
00014 
00015 void RemoteATCommandRequest::setTransmitOptions(OptionsBase * transmitOptions)
00016 {
00017     data[12] = transmitOptions->getValue();
00018 }
00019 
00020 void RemoteATCommandRequest::setAppleChanges(bool appleChanges)
00021 {
00022     if (appleChanges)
00023        data[12] |= 0x02;
00024     else data[12] &= 0xFD;
00025 }
00026 
00027 void RemoteATCommandRequest::setCommand(const char * command)
00028 {
00029     set(13, command[0]);
00030     set(14, command[1]);
00031 }
00032 
00033 void RemoteATCommandRequest::setParameter(const unsigned  char * parameter, int offset, int length)
00034 {
00035     setPosition(15);
00036     sets(parameter, offset, length);
00037 }
00038 
00039 void RemoteATCommandRequest::setRemoteAddress(Address * remoteAddress)
00040 {
00041     sets(2, remoteAddress->getAddressValue(), 0, 10);
00042 }