SERIAL: Add advice message when no serial ports are found in SHOW SERIAL
This commit is contained in:
parent
e7090e784e
commit
dcf746a72a
1 changed files with 14 additions and 10 deletions
10
sim_serial.c
10
sim_serial.c
|
@ -338,9 +338,12 @@ int number = sim_serial_devices(SER_MAX_DEVICE, list);
|
|||
fprintf(st, "Serial devices:\n");
|
||||
if (number == -1)
|
||||
fprintf(st, " serial support not available in simulator\n");
|
||||
else
|
||||
if (number == 0)
|
||||
fprintf(st, " no serial devices are available\n");
|
||||
else {
|
||||
if (number == 0) {
|
||||
fprintf(st, " no serial devices are available.\n");
|
||||
fprintf(st, "You may need to run with privilege or set device permissions\n");
|
||||
fprintf(st, "to access local serial ports\n");
|
||||
}
|
||||
else {
|
||||
size_t min, len;
|
||||
int i;
|
||||
|
@ -350,6 +353,7 @@ else {
|
|||
for (i=0; i<number; i++)
|
||||
fprintf(st," ser%d\t%-*s%s%s%s\n", i, (int)min, list[i].name, list[i].desc[0] ? " (" : "", list[i].desc, list[i].desc[0] ? ")" : "");
|
||||
}
|
||||
}
|
||||
if (serial_open_device_count) {
|
||||
int i;
|
||||
char desc[SER_DEV_DESC_MAX], *d;
|
||||
|
|
Loading…
Add table
Reference in a new issue