#include <tmr_serial_transport.h>
Public Attributes | |
void * | cookie |
TMR_Status(* | flush )(TMR_SR_SerialTransport *) |
TMR_Status(* | open )(TMR_SR_SerialTransport *) |
TMR_Status(* | receiveBytes )(TMR_SR_SerialTransport *, uint32_t length, uint32_t *messageLength, uint8_t *message, const uint32_t timeoutMs) |
TMR_Status(* | sendBytes )(TMR_SR_SerialTransport *, uint32_t length, uint8_t *message, const uint32_t timeoutMs) |
TMR_Status(* | setBaudRate )(TMR_SR_SerialTransport *, uint32_t rate) |
TMR_Status(* | shutdown )(TMR_SR_SerialTransport *) |
The TMR_SR_SerialTransport structure is the mechanism that the SerialReader layer uses to conduct low-level communications with the device. Users may create their own SerialTransport objects for systems with custom serial communication needs, and then use TMR_SR_SerialReader_init() to complete the construction of the reader object, as an alternative to using TMR_create().
Definition at line 73 of file tmr_serial_transport.h.
Context value made avaliable to callback functions
Definition at line 76 of file tmr_serial_transport.h.
This callback takes any actions necessary (possibly none) to remove unsent data from the output path.
this | The TMR_SR_SerialTransport structure. |
Definition at line 139 of file tmr_serial_transport.h.
This callback causes the communication interface to be opened but does not transmit any serial-layer data. This should perform actionms such as opening a serial port device or establishing a network connection within a wrapper protocol.
this | The TMR_SR_SerialTransport structure. |
Definition at line 86 of file tmr_serial_transport.h.
TMR_Status(* TMR_SR_SerialTransport::receiveBytes)(TMR_SR_SerialTransport *, uint32_t length, uint32_t *messageLength, uint8_t *message, const uint32_t timeoutMs) |
This callback recieves bytes message on the serial transport. The length parameter contains the size of the buffer pointed to by message. If the operation takes longer than timeoutMs to receive length bytes, TMR_ERROR_TIMEOUT should be returned.
this | The TMR_SR_SerialTransport structure. | |
length | The number of bytes to receive. | |
[out] | messageLength | The number of bytes received. |
[out] | message | Pointer to the location to store recieved bytes. |
timeoutMs | The duration for the operation to complete. |
Definition at line 113 of file tmr_serial_transport.h.
TMR_Status(* TMR_SR_SerialTransport::sendBytes)(TMR_SR_SerialTransport *, uint32_t length, uint8_t *message, const uint32_t timeoutMs) |
This callback transmits the provided bytes on the serial transport. If the operation takes longer than timeoutMs to complete, TMR_ERROR_TIMEOUT should be returned.
this | The TMR_SR_SerialTransport structure. |
length | The number of bytes to send. |
message | Pointer to the bytes to send. |
timeoutMs | The duration for the operation to complete. |
Definition at line 98 of file tmr_serial_transport.h.
TMR_Status(* TMR_SR_SerialTransport::setBaudRate)(TMR_SR_SerialTransport *, uint32_t rate) |
This callback causes the underlying serial transport connected to the device to the provided baud rate.
this | The TMR_SR_SerialTransport structure. |
rate | The baud rate to set. |
Definition at line 122 of file tmr_serial_transport.h.
This callback releases any resources allocated by the transport layer and informs the other end, if necessary, that the connection is ending.
this | The TMR_SR_SerialTransport structure. |
Definition at line 131 of file tmr_serial_transport.h.