xbee communication for UWB quadcopter project Originally by Greg Abdo Forking to reduce impact of interrupt by moving packetbuilder out of the interrupt and letting be handled in the main loop

Fork of com by Prosper Van

Revision:
12:bf4642578682
Parent:
5:7cdf299ea7a4
Child:
13:2fb7b19dcd70
--- a/com.h	Fri Apr 25 06:21:19 2014 +0000
+++ b/com.h	Sat Apr 26 02:38:08 2014 +0000
@@ -28,26 +28,26 @@
         com( PinName, PinName, PinName );   // Setup the com serial port. (tx, rx)
         bool isData();              // Is there data to be read?
         bool isSignalGood();
-        void write( short, short ); // Write to the port.
         short * read();             // Read from the queue.
-        void setAPImode(bool mode);
         void ackCheck();
         bool rdy2ack();
         
     private:         
+        void write( short, short ); // Write to the port.
         Serial xbeeTx;                // tx - DIN, rx - DOUT
         Serial xbeeRx;                // tx - DIN, rx - DOUT
-        queue *rxBuffer;            // queue of commands ready to be read.
         queue *txBuffer;
         PwmIn rssi;
           
-        bool api_mode;
-          
+        bool rdy2build;
+        bool isA1;
         void callback();            // Handle the interrupts.
-        void packetBuilder();       // Called by callback to place commandes into the queue.
         
-        char buffer[BUFFERSIZE];    // Buffer for holding serial data.
-        int bLength;                // Location in the buffer to place next data.
+        char buffer1[BUFFERSIZE];    // Buffer for holding serial data.
+        char buffer2[BUFFERSIZE];    // Buffer for holding serial data.
+        int index1;                // Location in the buffer to place next data.
+        int index2;                // Location in the buffer to place next data.
+        int pindex;                // Location in the buffer to place next data.
         int signalStrength;
 
 };