Simple xbee library based on the Serial class with added reset signaling

Dependents:   m3Dpi

xbee.cpp

Committer:
sillevl
Date:
2015-11-06
Revision:
0:a4621ef93d99

File content as of revision 0:a4621ef93d99:

#include "xbee.h"


Xbee::Xbee(PinName tx, PinName rx, PinName _reset, const char* name) : Serial(tx, rx, name), rst(_reset)
{
    disable();
}

void Xbee::enable(){
    rst = 1;
}

void Xbee::disable(){
    rst = 0;
}

void Xbee::reset(){
    disable();
    wait_ms(1);
    enable();
}