RTEMS 6.1-rc1
Data Fields
rtems_termios_device_handler Struct Reference

Termios device handler. More...

#include <termiosdevice.h>

Data Fields

bool(* first_open )(struct rtems_termios_tty *tty, rtems_termios_device_context *context, struct termios *term, struct rtems_libio_open_close_args *args)
 First open of this device. More...
 
void(* last_close )(struct rtems_termios_tty *tty, rtems_termios_device_context *context, struct rtems_libio_open_close_args *args)
 Last close of this device. More...
 
int(* poll_read )(rtems_termios_device_context *context)
 Polled read. More...
 
void(* write )(rtems_termios_device_context *context, const char *buf, size_t len)
 Polled write in case mode is TERMIOS_POLLED or write support otherwise. More...
 
bool(* set_attributes )(rtems_termios_device_context *context, const struct termios *term)
 Set attributes after a Termios settings change. More...
 
int(* ioctl )(rtems_termios_device_context *context, ioctl_command_t request, void *buffer)
 IO control handler. More...
 
rtems_termios_device_mode mode
 Termios device mode.
 

Detailed Description

Termios device handler.

See also
rtems_termios_device_install().

Field Documentation

◆ first_open

bool(* rtems_termios_device_handler::first_open) (struct rtems_termios_tty *tty, rtems_termios_device_context *context, struct termios *term, struct rtems_libio_open_close_args *args)

First open of this device.

Parameters
[in]ttyThe Termios control. This parameter may be passed to interrupt service routines since it must be provided for the rtems_termios_enqueue_raw_characters() and rtems_termios_dequeue_characters() functions.
[in]contextThe Termios device context.
[in]termThe current Termios attributes.
[in]argsThe open/close arguments. This is parameter provided to support legacy drivers. It must not be used by new drivers.
Return values
trueSuccessful operation.
falseCannot open device.
See also
rtems_termios_get_device_context() and rtems_termios_set_best_baud().

◆ ioctl

int(* rtems_termios_device_handler::ioctl) (rtems_termios_device_context *context, ioctl_command_t request, void *buffer)

IO control handler.

Invoked in case the Termios layer cannot deal with the IO request.

Parameters
[in]contextThe Termios device context.
[in]requestThe IO control request.
[in]bufferThe IO control buffer.

◆ last_close

void(* rtems_termios_device_handler::last_close) (struct rtems_termios_tty *tty, rtems_termios_device_context *context, struct rtems_libio_open_close_args *args)

Last close of this device.

Parameters
[in]ttyThe Termios control.
[in]contextThe Termios device context.
[in]argsThe open/close arguments. This is parameter provided to support legacy drivers. It must not be used by new drivers.

◆ poll_read

int(* rtems_termios_device_handler::poll_read) (rtems_termios_device_context *context)

Polled read.

In case mode is TERMIOS_IRQ_DRIVEN, TERMIOS_IRQ_SERVER_DRIVEN or TERMIOS_TASK_DRIVEN, then data is received via rtems_termios_enqueue_raw_characters().

Parameters
[in]contextThe Termios device context.
Return values
charThe received data encoded as unsigned char.
-1No data currently available.

◆ set_attributes

bool(* rtems_termios_device_handler::set_attributes) (rtems_termios_device_context *context, const struct termios *term)

Set attributes after a Termios settings change.

Parameters
[in]contextThe Termios device context.
[in]termThe new Termios attributes.
Return values
trueSuccessful operation.
falseInvalid attributes.

◆ write

void(* rtems_termios_device_handler::write) (rtems_termios_device_context *context, const char *buf, size_t len)

Polled write in case mode is TERMIOS_POLLED or write support otherwise.

Parameters
[in]contextThe Termios device context.
[in]bufThe output buffer.
[in]lenThe output buffer length in characters.

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