A library allowing basic functions of the XBEE pro to be used. Currently supported are: Enter/exit config mode, reading device serial number, setting encryption key, writing settings to non volatile memory and sending data strings.

Dependents:   IOT_sensor_nfc Xbee_Hello_world Xbee_Hello_world_A Xbee_Hello_World_B ... more

Revision:
1:c3d9bdcb0b03
Parent:
0:2656fb225c5d
Child:
2:cb627ea9b817
--- a/xbee.h	Tue Aug 28 14:00:33 2012 +0000
+++ b/xbee.h	Wed Aug 29 10:39:42 2012 +0000
@@ -1,21 +1,48 @@
 #include "mbed.h"
 
-
+/** Xbee interface class for configuring, sending and recieving data using an Xbee */
 class xbee {
 private:
     PinName _tx;
     PinName _rx;
 public:
-    xbee(PinName _tx, PinName _rx);
+    /** Configure serial data pin
+      * @param tx The serial tx pin the xbee is conected to
+      * @param rx The serial rx pin the xbee is conected to
+      */
+    xbee(PinName tx, PinName rx);
     ~xbee();
+    /** Puts the Xbee into config mode
+      * @return Returns 1 on success
+      */
     int ConfigMode();
+    /** Gets the serial number of the Xbee
+      * @return Returns 1 on success
+      */
     int GetSerial();
+    /** Sets the encryption key for the Xbee
+      * @return Returns 1 on success
+      */
     int SetKey();
+    /** Writes the settings to the Non volatile memory on the Xbee 
+      * @return Returns 1 on success
+      */
     int WriteSettings();
+    /** Exits config mode
+      * @return Returns 1 on success
+      */
     int ExitConfigMode();
+    /** Sends data in the sendData buffer
+      * @return Returns 1 on success
+      */
     int SendData();
+    /** Recieves data and puts it into the recieveData buffer. Will over write anything already in the buffer
+      * @param numchar Number of characters to read
+      */
+    void RecieveData(int numchar);
     
     int serial_no[8];
     int security_key[16]; 
     char sendData[202];
+    char readData[202];
 };
\ No newline at end of file