summaryrefslogtreecommitdiffstats
path: root/src/libserialport-test.c
blob: a4bbd7ef6936b957092b44831cdcab9b9c8cc7c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}