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.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Diff: Libs/XbeeManager/XbeeManager.cpp
- Revision:
- 38:8efacce315ae
- Parent:
- 34:18bcf276d3bf
--- a/Libs/XbeeManager/XbeeManager.cpp Thu Jan 22 07:59:48 2015 +0000
+++ b/Libs/XbeeManager/XbeeManager.cpp Sat Feb 07 08:54:51 2015 +0000
@@ -3,27 +3,31 @@
XbeeManager::XbeeManager(PinName tx1, PinName rx1, PinName tx2, PinName rx2, int baud, int txSize, int rxSize) :
x1(tx1, rx1, baud, txSize, rxSize), x2(tx2, rx2, baud, txSize, rxSize)
{
-
alternate = false;
extraAvail = false;
counterX1in = 0;
counterX2in = 0;
counterX1out = 0;
counterX2out = 0;
+ bytesX1out = 0;
+ bytesX2out = 0;
}
bool XbeeManager::send(CANMessage &msg)
{
alternate = !alternate;
+ unsigned int length;
if (alternate) {
- if (x1.send(msg)) {
+ if (x1.send(msg, &length)) {
counterX1out++;
+ bytesX1out += length;
return true;
}
} else {
- if (x2.send(msg)) {
+ if (x2.send(msg, &length)) {
counterX2out++;
- return true;
+ bytesX2out += length;
+ return true;
}
}
return false;
