Xiaofei Qiu / Xbee

Xbee.h

Committer:
Xiaofei
Date:
2015-11-28
Revision:
17:2271d7a273e7
Parent:
16:cc598ae4ab52
Child:
19:4bc3e2e68495

File content as of revision 17:2271d7a273e7:

#pragma once
#include "mbed.h"

class Xbee
{
public:
    // Use p9 and p10 as default serial pins
    Xbee(PinName tx = p9, PinName rx = p10, PinName rst = p11);
    
    // Reset
    void Reset();
    
    // Send buffer
    void Send(const char&);
    
    // Read buffer
    void Recv(char&,const size_t& sz = 1);
        
private:
    Serial _xbee;
    DigitalOut _rst;
};