summaryrefslogtreecommitdiffstats
path: root/src/libserialport-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserialport-test.c')
-rw-r--r--src/libserialport-test.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libserialport-test.c b/src/libserialport-test.c
new file mode 100644
index 0000000..a4bbd7e
--- /dev/null
+++ b/src/libserialport-test.c
@@ -0,0 +1,23 @@
+/*
+ * This file is part of MXE. See LICENSE.md for licensing information.
+ */
+
+#include <stdio.h>
+#include <libserialport.h>
+
+int main(int argc, char *argv[])
+{
+ int i;
+ struct sp_port **ports;
+ (void)argc;
+ (void)argv;
+
+ sp_list_ports(&ports);
+
+ for (i = 0; ports[i]; i++)
+ printf("Found port: '%s'.\n", sp_get_port_name(ports[i]));
+
+ sp_free_port_list(ports);
+
+ return 0;
+}