xbee test program 1

Dependencies:   XBee mbed

Revision:
0:fb7cf60c8229
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jul 21 04:06:22 2012 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include "XBee.h"
+
+XBee xbee(p13, p14);
+
+int main() {
+    uint8_t Cmd[] = {'D', '4'};
+    uint8_t Low[] = {0x05};
+    uint8_t Val[] = {0x04};
+    XBeeAddress64 remoteAddress(0x0013A200, 0x403A8C82);
+    RemoteAtCommandRequest remoteAtRequest;
+
+    wait(1);
+    xbee.begin(115200);
+
+    remoteAtRequest = RemoteAtCommandRequest(remoteAddress, Cmd, Low, sizeof(Low));
+    remoteAtRequest.setApplyChanges(true);
+
+    remoteAtRequest.setCommandValue(Val);
+    remoteAtRequest.setCommandValueLength(sizeof(Val));
+    xbee.send(remoteAtRequest);
+}