Lely core libraries
2.3.4
|
#include "io.h"
#include <lely/io/serial.h>
#include <assert.h>
#include <string.h>
#include "attr.h"
#include "default.h"
Go to the source code of this file.
Functions | |
io_handle_t | io_open_serial (const char *path, io_attr_t *attr) |
Opens a serial I/O device. More... | |
int | io_purge (io_handle_t handle, int flags) |
Purges the receive and/or transmit buffers of a serial I/O device. More... | |
int | io_serial_get_attr (io_handle_t handle, io_attr_t *attr) |
Retrieves the current attributes of a serial I/O device and stores them in *attr. More... | |
int | io_serial_set_attr (io_handle_t handle, const io_attr_t *attr) |
Sets the attributes of a serial I/O device to those in *attr. More... | |
This file is part of the I/O library; it contains the implementation of the serial I/O functions.
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 serial.c.
io_handle_t io_open_serial | ( | const char * | path, |
io_attr_t * | attr | ||
) |
Opens a serial I/O device.
path | the (platform dependent) path name of the device. |
attr | the address at which to store the original device attributes (can be NULL). |
int io_purge | ( | io_handle_t | handle, |
int | flags | ||
) |
Purges the receive and/or transmit buffers of a serial I/O device.
handle | a valid serial device handle. |
flags | a flag specifying which of the buffers is to be discarded (any combination of IO_PURGE_RX and IO_PURGE_TX). |
int io_serial_get_attr | ( | io_handle_t | handle, |
io_attr_t * | attr | ||
) |
Retrieves the current attributes of a serial I/O device and stores them in *attr.
int io_serial_set_attr | ( | io_handle_t | handle, |
const io_attr_t * | attr | ||
) |
Sets the attributes of a serial I/O device to those in *attr.