]> sigrok.org Git - libserialport.git/blame - examples/README
Add remaining examples to examples/README.
[libserialport.git] / examples / README
CommitLineData
8c1a14e6
ML
1This directory contains example programs showing how to use libserialport.
2
3The examples currently included are:
4
5list_ports.c - displays a list of ports on the system.
6port_info.c - displays info about a particular port on the system.
7b0686ed
ML
7port_config.c - sets and displays configuration settings on a port.
8send_receive.c - loopback test sending & receiving data on 1 or 2 ports.
9await_events.c - awaits receive events on multiple ports simultaneously.
10handle_errors.c - demonstrates handling errors returned from the library.
8c1a14e6
ML
11
12The programs themselves are completely OS-independent, and require only a
13C compiler and libserialport.
14
67b55d10
ML
15The 'examples.sln' file is a solution file for Microsoft Visual Studio 2019
16which will build libserialport and all of the example programs.
17
8c1a14e6
ML
18The Makefile in this directory will attempt to build all the examples,
19using 'gcc' to compile them and 'pkg-config' to discover the include
20paths and linker settings needed to build with libserialport. It provides
21a minimal example of how to write a Makefile to build a program using
22libserialport.
23
24If you have make, gcc, pkg-config and libserialport installed correctly
25then running 'make' should build the example programs in this directory.
26If this doesn't work, you may need to modify the Makefile or set necessary
27paths in your environment to suit your system.
28
29You can also build these examples using any other compiler, IDE or build
30system. You just need the libserialport.h header available to compile them,
31and the libserialport library available to link and run them.
ee12a01e
ML
32
33These example files are hereby released into the public domain by the author.