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.
Fork of XBee by
Revision 6:dc1f35defd71, committed 2013-01-18
- Comitter:
- FalconOnishi
- Date:
- Fri Jan 18 17:00:51 2013 +0000
- Parent:
- 5:547cfff7adf7
- Commit message:
- Add some utility methods
Changed in this revision
XBee.cpp | Show annotated file Show diff for this revision Revisions of this file |
XBeeWiFi.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/XBee.cpp Tue Mar 13 09:11:35 2012 +0000 +++ b/XBee.cpp Fri Jan 18 17:00:51 2013 +0000 @@ -25,7 +25,7 @@ * @brief XBee library for mbed */ -//#define DEBUG +#define DEBUG #include "dbg.h" #include "mbed.h" @@ -857,7 +857,7 @@ continue; } } - DBG("%02x_", b); + //DBG("%02x_", b); if (_escape == true) { b = 0x20 ^ b; @@ -1396,6 +1396,16 @@ // _frame = frame; //} +void flushSerialBuffer(Serial &device) +{ + char c = 0; + while (device.readable()) { + c = device.getc(); + c = c;//escape warning + } + return; +} + void XBee::send(XBeeRequest &request) { // the new new deal @@ -1437,7 +1447,9 @@ // send packet Serial.flush(); */ - DBG("\r\n"); + flushSerialBuffer(_xbee); + +// DBG("\r\n"); } void XBee::sendByte(uint8_t b, bool escape) { @@ -1449,6 +1461,6 @@ } else { _xbee.putc(b); } - DBG("%02x ", b); +// DBG("%02x ", b); }
--- a/XBeeWiFi.cpp Tue Mar 13 09:11:35 2012 +0000 +++ b/XBeeWiFi.cpp Fri Jan 18 17:00:51 2013 +0000 @@ -8,7 +8,7 @@ * @brief XBee Wi-Fi library for mbed */ -//#define DEBUG +#define DEBUG #include "dbg.h" #include "mbed.h"