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

com.h

Committer:
oprospero
Date:
2014-11-02
Revision:
22:0e8e22f161ff
Parent:
21:117e01fc0373

File content as of revision 22:0e8e22f161ff:

#ifndef COM_H
#define COM_H


#include "mbed.h"
#include "queue.h"
#include "queueChar.h"

int const BAUDRATE = 38400;

class com
{
public:
    com(PinName, PinName);
    ~com();
    short * read();
    bool isData();
    bool rdy2ack();
    void sendACK();
    void write(short,short);
    void print(char*);
    
    
private:
    Serial xbee;
//    Serial xbtx;
    queue cmdBuffer;
    queue txBuffer;
    queueChar rxBuffer;
    void callback();

};

#endif