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

Revision:
0:837e6c48e90d
Child:
6:5f31ddc17239
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Request/RemoteATCommandRequest.cpp	Thu Oct 22 12:28:26 2015 +0000
@@ -0,0 +1,40 @@
+#include "RemoteATCommandRequest.h"
+
+RemoteATCommandRequest::RemoteATCommandRequest(char frameID, Address * remoteAddress, const char * command, OptionsBase * transmitOptions, const char * parameter, int parameterOffset, int parameterLength)
+    : TxBase(13 + (parameter == NULL ? 0 : parameterLength), APIFrame::Remote_Command_Request, frameID)
+{
+    sets(remoteAddress->getAddressValue(), 0, 10);
+    set(transmitOptions->getValue());
+    sets(command, 0, 2);
+
+    if (parameter != NULL)
+        sets(parameter, parameterOffset, parameterLength);
+}
+
+void RemoteATCommandRequest::setTransmitOptions(OptionsBase * transmitOptions)
+{
+    data[12] = transmitOptions->getValue();
+}
+
+void RemoteATCommandRequest::setAppleChanges(bool appleChanges)
+{
+    if (appleChanges)
+       data[12] |= 0x02;
+    else data[12] &= 0xFD;
+}
+
+void RemoteATCommandRequest::setCommand(const char * command)
+{
+    sets(13, command, 0, 2);
+}
+
+void RemoteATCommandRequest::setParameter(const char * parameter, int offset, int length)
+{
+    setPosition(15);
+    sets(parameter, offset, length);
+}
+
+void RemoteATCommandRequest::setRemoteAddress(Address * remoteAddress)
+{
+    sets(2, remoteAddress->getAddressValue(), 0, 10);
+}
\ No newline at end of file