fplayer
C99 Falcon Sequence (fseq) file player for Light-O-Rama hardware (like xLights)
Loading...
Searching...
No Matches
serial.h File Reference

Serial port communication interface. More...

#include <stdint.h>
#include "sl.h"
Include dependency graph for serial.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int Serial_init (struct serialdev_s **sdev, const char *devName, int baudRate)
 Initializes a write-mode serial port with the provided device name and baud rate pre-configured for use as a LOR network connection.
 
void Serial_write (struct serialdev_s *sdev, const uint8_t *b, unsigned long size)
 Writes the binary data to the open serial port. The data is copied to an internal buffer and written to the serial port asynchronously.
 
void Serial_drain (struct serialdev_s *sdev)
 Waits for all data to be written to the serial device.
 
void Serial_close (struct serialdev_s *sdev)
 Closes the open serial device and frees all resources.
 
slist_t * Serial_getPorts (void)
 Retrieves a list of available serial ports. The caller is responsible for freeing the list with slfree.
 

Detailed Description

Serial port communication interface.

Function Documentation

◆ Serial_close()

void Serial_close ( struct serialdev_s * sdev)

Closes the open serial device and frees all resources.

Parameters
sdevserial device to close, may be NULL
Here is the caller graph for this function:

◆ Serial_drain()

void Serial_drain ( struct serialdev_s * sdev)

Waits for all data to be written to the serial device.

Parameters
sdevserial device to drain, must not be NULL
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Serial_getPorts()

slist_t * Serial_getPorts ( void )

Retrieves a list of available serial ports. The caller is responsible for freeing the list with slfree.

Returns
list of available serial ports, or NULL on failure or no ports found
Here is the caller graph for this function:

◆ Serial_init()

int Serial_init ( struct serialdev_s ** sdev,
const char * devName,
int baudRate )

Initializes a write-mode serial port with the provided device name and baud rate pre-configured for use as a LOR network connection.

Parameters
sdevserial device to initialize, must not be NULL
devNamedevice name of the serial port
baudRatebaud rate of the serial port
Returns
0 on success, a negative error code on failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Serial_write()

void Serial_write ( struct serialdev_s * sdev,
const uint8_t * b,
unsigned long size )

Writes the binary data to the open serial port. The data is copied to an internal buffer and written to the serial port asynchronously.

Parameters
sdevserial device to write to, must not be NULL
bbinary data to write
sizesize of the binary data
Here is the call graph for this function:
Here is the caller graph for this function: