Amman Vedi / xbee_lib

Dependents:   IOT_Sockets

Fork of xbee_api by Wiktor Grajkowski

Revision:
8:3ef2044c1302
Parent:
7:8e5855f18ad3
Child:
9:08ccd085662f
--- a/xbeeFrame.h	Sat Jan 25 16:29:44 2014 +0000
+++ b/xbeeFrame.h	Sat Jan 25 21:20:41 2014 +0000
@@ -5,17 +5,17 @@
     PinName _rx;
     PinName _reset;
 
-    unsigned char _apiFrame[FRAME_SIZE];   //fully assembled frame
+    char _apiFrame[FRAME_SIZE];   //fully assembled frame
     unsigned char _length[2];               //length bytes
     unsigned char _frameType;              //frame type
     unsigned char _frameID;                //frame id
     unsigned char _destAddr[8];            //destination address
     unsigned char _sourceAddr[8];          //source address
     unsigned char _options;                 //other options
-    unsigned char* _payload;                         //actual data to be sent/received
+    char* _payload;                         //actual data to be sent/received
     unsigned char _checksum;                //checksum byte
     unsigned char _rssi;                    // RSSI
-    unsigned char _rfData[MAX_DATA_LEN];   //incoming data array
+    char* _rfData;                          //pointer to an array to store incoming data
     unsigned char _status;                  //status of transmitted frame
     
 public:
@@ -47,7 +47,7 @@
     /** Set the packet destination address 
       * @param dest_address Pointer to a array storing destination address
       */
-    void SetDestination(char* dest);
+    void SetDestination(unsigned char* dest);
     /** Set the packet payload 
       * @param payload Pointer to a array storing payload (must be '\0' ended)
       */
@@ -57,11 +57,19 @@
     void ParseFrame(void);
     /** Prints the received frame information
       */
-    void PrintData(void);
+    void PrintData(void);    
+    /** Sends the frame
+      */
+    void SendFrame(void);    
     /** Receives the frame
       */
-    void ReceiveFrame(void);
+    void ReceiveFrame(char* buf);
+    /** Returns pointer to api frame
+      */
+    char* GetFramePointer(void);
     /** Indicates if the frame has been received
       */
     unsigned char frameReceived;
+    
+    void PrintPayload();
 };
\ No newline at end of file