SERIAL module operations. More...
#include <systemio/artik_serial.h>
Data Fields | |
| artik_error(* | request )(artik_serial_handle *handle, artik_serial_config *config) |
| Request a SERIAL instance. More... | |
| artik_error(* | release )(artik_serial_handle handle) |
| Release a SERIAL instance. More... | |
| artik_error(* | read )(artik_serial_handle handle, unsigned char *buf, int *len) |
| Read a message from a serial port through a SERIAL instance. More... | |
| artik_error(* | write )(artik_serial_handle handle, unsigned char *const msg, int *len) |
| Write a message to a serial port through a SERIAL instance. More... | |
| artik_error(* | set_received_callback )(artik_serial_handle handle, artik_serial_callback callback, void *user_data) |
| Wait for incoming data on a SERIAL instance. More... | |
| artik_error(* | unset_received_callback )(artik_serial_handle handle) |
| Cancel a blocking wait on a SERIAL instance. More... | |
Detailed Description
Structure containing all the exposed operations exposed by the module to operate on a SERIAL instance
- Examples:
- serial_test/artik_serial_test.c.
Definition at line 190 of file artik_serial.h.
Field Documentation
| artik_error(* artik_serial_module::read) (artik_serial_handle handle, unsigned char *buf, int *len) |
- Parameters
-
[in] handle Handle tied to the requested Serial instance. This handle is returned by the request function. [out] buff Preallocated buffer filled by the function with the received data.
- Examples:
- serial_test/artik_serial_test.c.
Definition at line 231 of file artik_serial.h.
| artik_error(* artik_serial_module::release) (artik_serial_handle handle) |
- Parameters
-
[in] handle Handle tied to the requested Serial instance to be released. This handle is returned by the request function.
- Returns
- S_OK on success, error code otherwise
- Examples:
- serial_test/artik_serial_test.c.
Definition at line 213 of file artik_serial.h.
| artik_error(* artik_serial_module::request) (artik_serial_handle *handle, artik_serial_config *config) |
- Parameters
-
[out] handle Handle tied to the requested Serial instance. [in] config Configuration to apply to the requested SERIAL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- serial_test/artik_serial_test.c.
Definition at line 201 of file artik_serial.h.
| artik_error(* artik_serial_module::set_received_callback) (artik_serial_handle handle, artik_serial_callback callback, void *user_data) |
This function is blocking and will return only after data has been received on the serial line
- Parameters
-
[in] handle Handle tied to the requested Serial instance to wait on. This handle is returned by the request function.
- Returns
- S_OK if data is ready to be read, E_INTERRUPTED if the function has been interrupted manually by the cancel_wait function or by a signal sent to the process.
- Examples:
- serial_test/artik_serial_test.c.
Definition at line 266 of file artik_serial.h.
| artik_error(* artik_serial_module::unset_received_callback) (artik_serial_handle handle) |
This function cancels any pending blocking function call operated on the SERIAL instance. The concerned functions will return E_INTERRUPTED when affected.
- Parameters
-
[in] handle Handle tied to the requested Serial instance. This handle is returned by the request function.
- Returns
- S_OK on success, error code otherwise.
- Examples:
- serial_test/artik_serial_test.c.
Definition at line 280 of file artik_serial.h.
| artik_error(* artik_serial_module::write) (artik_serial_handle handle, unsigned char *const msg, int *len) |
- Parameters
-
[in] handle Handle tied to the requested Serial instance. This handle is returned by the request function. [in] msg Buffer containing data to write to the serial port.
- Examples:
- serial_test/artik_serial_test.c.
Definition at line 249 of file artik_serial.h.
The documentation for this struct was generated from the following file:
- inc/systemio/artik_serial.h