We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fc987c commit d0f6066Copy full SHA for d0f6066
simple_uart_term.c
@@ -1,6 +1,7 @@
1
#include <fcntl.h>
2
#include <stdio.h>
3
#include <stdlib.h>
4
+#include <string.h>
5
#include <sys/select.h>
6
#include <termios.h>
7
#include <unistd.h>
@@ -27,9 +28,13 @@ int main(int argc, char *argv[])
27
28
case 'l': {
29
char **names;
30
ssize_t nuarts = simple_uart_list(&names);
31
+ char description[256] = {0};
32
printf("Found %zd ports\n", nuarts);
33
for (ssize_t i = 0; i < nuarts; i++) {
- printf("Port %zd: %s\n", i, names[i]);
34
+ printf("Port %zd: %s", i, names[i]);
35
+ if (simple_uart_describe(names[i], description, sizeof(description)) == 0 && strlen(description) > 0)
36
+ printf(" Description: %s", description);
37
+ printf("\n");
38
}
39
40
0 commit comments