Skip to content

Commit 7898384

Browse files
committed
make S return stdout err
1 parent 486207c commit 7898384

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

MIDAS/src/hilsim/stream/main.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,16 @@ int main(int argc, char** argv) {
163163
case 'S':
164164
// (S)erial <COM>: Set serial port
165165
{
166-
char sbuf[128];
167-
sscanf(_inbuf + 1, " %s", &sbuf);
168-
169-
char serial_open_err = Serial.openDevice(sbuf, 115200);
170-
if (serial_open_err != 1) return wrap_err(serial_open_err);
171-
printf("SERIAL OK\n", sbuf);
172-
fflush(stdout);
166+
char sbuf[128];
167+
sscanf(_inbuf + 1, " %s", &sbuf);
168+
169+
char serial_open_err = Serial.openDevice(sbuf, 115200);
170+
if (serial_open_err != 1) {
171+
printf(".SERIAL_BAD\n");
172+
} else {
173+
printf(".SERIAL_OK\n");
174+
}
175+
fflush(stdout);
173176
}
174177
break;
175178
case 'o':

0 commit comments

Comments
 (0)