TMR_SR_SerialTransport Struct Reference
#include <tmr_serial_transport.h>
List of all members.
Detailed Description
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().
- See also:
- TMR_SR_SerialPortTransportInit and TMR_SR_LlrpEapiTransportInit for pre-existing TMR_SR_SerialTransport implementations.
Member Data Documentation
Context value made available to callback functions
This callback takes any actions necessary (possibly none) to remove unsent data from the output path.
- Parameters:
-
This callback causes the communication interface to be opened but does not transmit any serial-layer data. This should perform actions such as opening a serial port device or establishing a network connection within a wrapper protocol.
- Parameters:
-
This callback receives 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.
- Parameters:
-
| 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 received bytes. |
| timeoutMs | The duration for the operation to complete. |
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.
- Parameters:
-
| 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. |
This callback causes the underlying serial transport connected to the device to the provided baud rate.
- Parameters:
-
This callback releases any resources allocated by the transport layer and informs the other end, if necessary, that the connection is ending.
- Parameters:
-
The documentation for this struct was generated from the following file: