Skip to content

Commit 2997149

Browse files
committed
fixed dump of messages with old firmwares
1 parent 1f458d1 commit 2997149

1 file changed

Lines changed: 22 additions & 16 deletions

File tree

examples/TestEasyVR/TestEasyVR.ino

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ void setup()
9292
// setup EasyVR serial port
9393
port.begin(9600);
9494
// run normally
95-
pcSerial.println(F("---"));
9695
pcSerial.println(F("Bridge not started!"));
96+
pcSerial.println(F("---"));
9797
break;
9898

9999
case EasyVR::BRIDGE_NORMAL:
@@ -102,8 +102,8 @@ void setup()
102102
// soft-connect the two serial ports (PC and EasyVR)
103103
easyvr.bridgeLoop(pcSerial);
104104
// resume normally if aborted
105-
pcSerial.println(F("---"));
106105
pcSerial.println(F("Bridge connection aborted!"));
106+
pcSerial.println(F("---"));
107107
break;
108108

109109
case EasyVR::BRIDGE_BOOT:
@@ -112,8 +112,8 @@ void setup()
112112
// soft-connect the two serial ports (PC and EasyVR)
113113
easyvr.bridgeLoop(pcSerial);
114114
// resume normally if aborted
115-
pcSerial.println(F("---"));
116115
pcSerial.println(F("Bridge connection aborted!"));
116+
pcSerial.println(F("---"));
117117
break;
118118
}
119119

@@ -140,23 +140,29 @@ void setup()
140140
}
141141
}
142142

143-
pcSerial.println(F("Recorded messages:"));
144-
for (int8_t idx = 0; idx < 32; ++idx)
143+
pcSerial.print(F("Recorded messages:"));
144+
if (easyvr.getID() >= EasyVR::EASYVR3_1)
145145
{
146-
int8_t bits = -1; int32_t len = 0;
147-
if (easyvr.dumpMessage(idx, bits, len) && (bits == 0))
148-
continue; // skip empty
149-
pcSerial.print(idx);
150-
pcSerial.print(F(" = "));
151-
if (bits < 0)
152-
pcSerial.println(F(" has errors"));
153-
else
146+
pcSerial.println();
147+
for (int8_t idx = 0; idx < 32; ++idx)
154148
{
155-
pcSerial.print(bits);
156-
pcSerial.print(F(" bits, size "));
157-
pcSerial.println(len);
149+
int8_t bits = -1; int32_t len = 0;
150+
if (easyvr.dumpMessage(idx, bits, len) && (bits == 0))
151+
continue; // skip empty
152+
pcSerial.print(idx);
153+
pcSerial.print(F(" = "));
154+
if (bits < 0)
155+
pcSerial.println(F(" has errors"));
156+
else
157+
{
158+
pcSerial.print(bits);
159+
pcSerial.print(F(" bits, size "));
160+
pcSerial.println(len);
161+
}
158162
}
159163
}
164+
else
165+
pcSerial.println(F("n/a"));
160166

161167
easyvr.setTimeout(5);
162168
lang = EasyVR::ENGLISH;

0 commit comments

Comments
 (0)