Monado OpenXR Runtime
Loading...
Searching...
No Matches
os_serial_device Interface Reference

Representing a single serial interface on a device. More...

#include <os/os_serial.h>

Collaboration diagram for os_serial_device:

Static Public Member Functions

static ssize_t os_serial_read (struct os_serial_device *serial_dev, uint8_t *data, size_t size, int milliseconds)
 Read the next input report, if any, from the given serial device.
 
static ssize_t os_serial_write (struct os_serial_device *serial_dev, const uint8_t *data, size_t size)
 Write an output report to the given device.
 
static int os_serial_set_line_control (struct os_serial_device *serial_dev, bool dtr, bool rts)
 Set the line control signals (DTR and RTS) for the given serial device.
 
static void os_serial_destroy (struct os_serial_device *serial_dev)
 Close and free the given device.
 

Data Fields

ssize_t(* read )(struct os_serial_device *serial_dev, uint8_t *data, size_t size, int milliseconds)
 
ssize_t(* write )(struct os_serial_device *serial_dev, const uint8_t *data, size_t size)
 
int(* set_line_control )(struct os_serial_device *serial_dev, bool dtr, bool rts)
 
void(* destroy )(struct os_serial_device *serial_dev)
 

Detailed Description

Representing a single serial interface on a device.

Member Function Documentation

◆ os_serial_destroy()

static void os_serial_destroy ( struct os_serial_device serial_dev)
inlinestatic

Close and free the given device.

◆ os_serial_read()

static ssize_t os_serial_read ( struct os_serial_device serial_dev,
uint8_t *  data,
size_t  size,
int  milliseconds 
)
inlinestatic

Read the next input report, if any, from the given serial device.

If milliseconds are negative, this call blocks indefinitely, 0 polls, and positive will block for that amount of milliseconds.

◆ os_serial_set_line_control()

static int os_serial_set_line_control ( struct os_serial_device serial_dev,
bool  dtr,
bool  rts 
)
inlinestatic

Set the line control signals (DTR and RTS) for the given serial device.

◆ os_serial_write()

static ssize_t os_serial_write ( struct os_serial_device serial_dev,
const uint8_t *  data,
size_t  size 
)
inlinestatic

Write an output report to the given device.


The documentation for this interface was generated from the following file: