31 lines
445 B
C++
31 lines
445 B
C++
#ifndef _WBEE_WRAPPER_H_
|
|
#define _WBEE_WRAPPER_H_
|
|
|
|
#include <Wire.h>
|
|
#include <XBee.h>
|
|
#include "protocol.h"
|
|
#include "packet.h"
|
|
|
|
#define XBWRCV_OK 0
|
|
#define XBWRCV_NONE 1
|
|
#define XBWRCV_ERROR 2
|
|
|
|
|
|
class XBeeWrapper{
|
|
private:
|
|
XBee xbee;
|
|
|
|
public:
|
|
XBeeWrapper();
|
|
|
|
// initialises the XBee interface
|
|
void begin(unsigned long baud);
|
|
|
|
// tries to extract a received packet
|
|
uint8_t receive(Packet& pkt);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif |