Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Xbee.cpp
- Revision:
- 29:7b328499f9cf
- Parent:
- 28:8fdfd5bffe15
- Child:
- 30:18ef9d8f1eea
--- a/Xbee.cpp Sat Nov 28 13:47:44 2015 +0000 +++ b/Xbee.cpp Sat Nov 28 14:02:21 2015 +0000 @@ -17,33 +17,34 @@ } -void Xbee::Send(const char& buffer) +void Xbee::Send(const char* buffer) { while(1) { if(_xbee.writeable()) { - _xbee.putc(buffer); - _xbee.putc('\0'); + _xbee.puts(buffer); } if(_xbee.readable()) { + _xbee.getc(); break; } } } -void Xbee::Recv(char& buffer) +void Xbee::Recv(char* buffer) { while(1) { if(!_xbee.readable()) { - _xbee.putc('\0'); + _xbee.putc('\n'); } else { - buffer = _xbee.getc(); + _xbee.gets(buffer,2); + break; } } } \ No newline at end of file