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: DSgatewayMBED mbed TrackReporterS88_DS
Revision 2:4bece8af05e8, committed 2015-01-31
- Comitter:
- yaasan
- Date:
- Sat Jan 31 22:16:02 2015 +0000
- Parent:
- 1:28c58a355b7f
- Commit message:
- Support S88 decoders
Changed in this revision
| TrackReporterS88_DS.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TrackReporterS88_DS.lib Sat Jan 31 22:16:02 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/yaasan/code/TrackReporterS88_DS/#b32bb4602f54
--- a/main.cpp Sat Jan 24 06:46:34 2015 +0000
+++ b/main.cpp Sat Jan 31 22:16:02 2015 +0000
@@ -1,5 +1,6 @@
#include "mbed.h"
#include "DSGatewayMBED.h"
+#include "TrackReporterS88_DS.h"
#include <string>
#define MAX_S88DECODER 1
@@ -12,6 +13,7 @@
/* class definition */
Serial serial_pc(SERIAL_TX, SERIAL_RX);
DSGatewayLib ds_gw;
+TrackReporterS88_DS reporter(MAX_S88DECODER);
int gCounter = 0;
string gReceivedMessage;
@@ -142,7 +144,7 @@
}
boolean dispatch() {
- boolean aResult;
+ //boolean aResult;
if (function.compare("setLocoDirection") == 0) {
return ds_gw.SetLocoDirection(arguments[0], (unsigned char)arguments[1]);
@@ -168,7 +170,7 @@
aMaxS88Num = arguments[0];
}
- //reporter.refresh(aMaxS88Num);
+ reporter.refresh(aMaxS88Num);
//Send a S88 sensor reply
serial_pc.printf("@S88,");
@@ -177,8 +179,8 @@
for( int j = 0; j < aMaxS88Num; j++)
{
- //aFlags = (reporter.getByte((j << 1) + 1) << 8) + reporter.getByte(j << 1);
- aFlags = 0;
+ aFlags = (reporter.getByte((j << 1) + 1) << 8) + reporter.getByte(j << 1);
+ //aFlags = 0;
serial_pc.printf("%x", aFlags);
serial_pc.printf(",");