System Management code

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers XbeeManager.h Source File

XbeeManager.h

00001 #ifndef XBEE_MANAGER_H
00002 #define XBEE_MANAGER_H
00003 
00004 #include "mbed.h"
00005 #include "CAN-xbee.h"
00006 
00007 class XbeeManager {
00008 public:
00009     XbeeManager(PinName tx1, PinName rx1, PinName tx2, PinName rx2, int baud, int txSize, int rxSize);
00010     void baud(int baudrate) {
00011         x1.baud(baudrate);
00012         x2.baud(baudrate);   
00013     }
00014     bool txSize(unsigned int size) {
00015         return (x1.txSize(size) && x2.txSize(size));   
00016     }
00017     bool rxSize(unsigned int size) {
00018         return (x1.rxSize(size) && x2.rxSize(size));          
00019     }
00020     
00021     bool send(CANMessage &msg);
00022     bool receive(CANMessage &msg); 
00023     unsigned int counterX1in;
00024     unsigned int counterX2in;
00025     unsigned int counterX1out;
00026     unsigned int counterX2out;
00027     unsigned int bytesX1out;
00028     unsigned int bytesX2out;
00029     
00030 private:
00031     bool alternate;
00032     CANxbee x1;
00033     CANxbee x2;
00034     CANMessage extra;
00035     bool extraAvail;
00036 };
00037 
00038 #endif