ss
Diff: XBEE.cpp
- Revision:
- 0:cc6b98856c51
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/XBEE.cpp Tue Apr 21 10:22:19 2015 +0000 @@ -0,0 +1,31 @@ +#include "XBEE.h" + +XBEE::XBEE(PinName tx, PinName rx, PinName reset) +{ + _tx = tx; + _rx = rx; + _reset = reset; + _TCOMXbee = new Serial(_tx,_rx); +} +void XBEE::Init(unsigned int baud){ + + _TCOMXbee->baud(baud); + wait_ms(100); + Reset(); + +} +void XBEE::SendMSG(char *buf){ + + _TCOMXbee->printf("%s",buf); +} +void XBEE::RecieveMSG(char *buf){ + + _TCOMXbee->printf("%s",buf); +} +void XBEE::Reset(){ + DigitalOut XbeeRST(_reset); + XbeeRST = 0; + wait_ms(10); + XbeeRST = 1; + wait_ms(1); +} \ No newline at end of file