Skip to content

patgrosse/libspt

Repository files navigation

libspt

Serial Packet Transfer library

C library for transferring binary data packets over a single serial data connection side by side with log entries and other plain text messages.

Packet layout

A packet containing binary data sent by libspt has the following layout:

libspt packet layout

Dependencies

  • pthreads
  • libevent (optional)
  • termios (optional)

Building

Options

Set these environment variables/macros to:

NO_LIBEVENT - Use blocking IO instead of libevent

NO_TERMIOS - No <termios.h> will be required but the TTY utils won't be available

Creating the static library

make

will create the static library at build/libspt/libspt.a

Building/running the examples

The examples are created to work with a serial tty available at /dev/ttyUSB0

cd examples
make
cd ../build/examples
./serialexample

About

Serial Packet Transfer Library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published