Lely core libraries 2.3.4
|
This header file is part of the I/O library; it contains the serial I/O attributes declarations. More...
#include <lely/io/io.h>
Go to the source code of this file.
Data Structures | |
union | __io_attr |
An opaque serial I/O device attributes type. More... | |
Macros | |
#define | IO_ATTR_INIT |
The static initializer for io_attr_t. | |
Enumerations | |
enum | { IO_PARITY_NONE , IO_PARITY_ODD , IO_PARITY_EVEN } |
Functions | |
int | io_attr_get_speed (const io_attr_t *attr) |
Returns the baud rate from the attributes of a serial I/O device, or -1 on error. More... | |
int | io_attr_set_speed (io_attr_t *attr, int speed) |
Sets the baud rate of a serial I/O device. More... | |
int | io_attr_get_flow_control (const io_attr_t *attr) |
Checks if flow control is enabled in the attributes of a serial I/O device. More... | |
int | io_attr_set_flow_control (io_attr_t *attr, int flow_control) |
Disables flow control for a serial I/O device if flow_control is zero, and enables it otherwise. More... | |
int | io_attr_get_parity (const io_attr_t *attr) |
Obtains the parity scheme from the attributes of a serial I/O device. More... | |
int | io_attr_set_parity (io_attr_t *attr, int parity) |
Sets the parity scheme of a serial I/O device. More... | |
int | io_attr_get_stop_bits (const io_attr_t *attr) |
Obtains the number of stop bits used from the attributes of a serial I/O device. More... | |
int | io_attr_set_stop_bits (io_attr_t *attr, int stop_bits) |
Sets the number of stop bits used in a serial I/O device to one if stop_bits is zero, and two otherwise. More... | |
int | io_attr_get_char_size (const io_attr_t *attr) |
Obtains the character size (in bits) from the attributes of a serial I/O device. More... | |
int | io_attr_set_char_size (io_attr_t *attr, int char_size) |
Sets the character size (in bits) of a serial I/O device. More... | |
This header file is part of the I/O library; it contains the serial I/O attributes declarations.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file attr.h.
anonymous enum |
int io_attr_get_speed | ( | const io_attr_t * | attr | ) |
Returns the baud rate from the attributes of a serial I/O device, or -1 on error.
int io_attr_set_speed | ( | io_attr_t * | attr, |
int | speed | ||
) |
Sets the baud rate of a serial I/O device.
Note that the new device attributes will not take effect until a call to io_serial_set_attr().
attr | a pointer to the current device attributes. |
speed | the input and output baud rate. Note that not all possible values are supported. |
int io_attr_get_flow_control | ( | const io_attr_t * | attr | ) |
Checks if flow control is enabled in the attributes of a serial I/O device.
int io_attr_set_flow_control | ( | io_attr_t * | attr, |
int | flow_control | ||
) |
Disables flow control for a serial I/O device if flow_control is zero, and enables it otherwise.
Note that the new device attributes will not take effect until a call to io_serial_set_attr().
int io_attr_get_parity | ( | const io_attr_t * | attr | ) |
Obtains the parity scheme from the attributes of a serial I/O device.
int io_attr_set_parity | ( | io_attr_t * | attr, |
int | parity | ||
) |
Sets the parity scheme of a serial I/O device.
Note that the new device attributes will not take effect until a call to io_serial_set_attr().
attr | a pointer to the current device attributes. |
parity | the parity scheme to be used (one of IO_PARITY_NONE, IO_PARITY_ODD or IO_PARITY_EVEN). |
int io_attr_get_stop_bits | ( | const io_attr_t * | attr | ) |
Obtains the number of stop bits used from the attributes of a serial I/O device.
int io_attr_set_stop_bits | ( | io_attr_t * | attr, |
int | stop_bits | ||
) |
Sets the number of stop bits used in a serial I/O device to one if stop_bits is zero, and two otherwise.
Note that the new device attributes will not take effect until a call to io_serial_set_attr().
int io_attr_get_char_size | ( | const io_attr_t * | attr | ) |
Obtains the character size (in bits) from the attributes of a serial I/O device.
int io_attr_set_char_size | ( | io_attr_t * | attr, |
int | char_size | ||
) |
Sets the character size (in bits) of a serial I/O device.
Note that the new device attributes will not take effect until a call to io_serial_set_attr().