Thingstream Client Library  BLD4131-v2.13
Macros | Functions
line_buffer_transport.h File Reference

ThingstreamTransport implementation that adds line buffering on callbacks e.g. between a serial connection and a modem driver. More...

#include <transport_api.h>

Macros

#define Thingstream__lineBufferEncodedSize(dataSize, lineLen)    (dataSize | (((uint32_t)lineLen) << 16))
 

Functions

ThingstreamTransportThingstream_createLineBufferTransport (ThingstreamTransport *inner, uint8_t *data, uint32_t dataSize)
 
ThingstreamTransportThingstream_createLineBufferTransport_2 (ThingstreamTransport *inner, uint8_t *data, uint32_t dataSize)
 
ThingstreamTransportThingstream_createLineBufferTransport_3 (ThingstreamTransport *inner, uint8_t *data, uint32_t dataSize)
 
ThingstreamTransportThingstream__createLegacyLineBufferTransport (ThingstreamTransport *inner, uint8_t *data, uint16_t dataSize)
 

Detailed Description

ThingstreamTransport implementation that adds line buffering on callbacks e.g. between a serial connection and a modem driver.

Macro Definition Documentation

◆ Thingstream__lineBufferEncodedSize

#define Thingstream__lineBufferEncodedSize (   dataSize,
  lineLen 
)     (dataSize | (((uint32_t)lineLen) << 16))

The 'dataSize' argument to Thingstream_createLineBufferTransport() can be encoded to specify the length of the line buffer used for the callback. This helper encodes the two sizes (overall size of the data are and the length of the callback line buffer) in the format required by the Thingstream_createLineBufferTransport() apis.

Parameters
dataSizethe size of the data area (must be at least twice lineLen)
lineLenthe size of the callback buffer line
Returns
encoded size to be passed to Thingstream_createLineBufferTransport()

Function Documentation

◆ Thingstream_createLineBufferTransport()

ThingstreamTransport* Thingstream_createLineBufferTransport ( ThingstreamTransport inner,
uint8_t *  data,
uint32_t  dataSize 
)

Create a transport instance that line-buffers a sequence of bytes for callbacks.

The callback of this transport can be safely called from interrupt handlers.

Do not mix calls to Thingstream_createLineBufferTransport() with calls to either the legacy macro line_buffer_transport_create() or the Thingstream__createLegacyLineBufferTransport() function.

Parameters
innerthe inner ThingstreamTransport instance to use
dataan area of data to use for the buffers
dataSizethe size of the data area
Returns
an instance of the line buffer transport

◆ Thingstream_createLineBufferTransport_2()

ThingstreamTransport* Thingstream_createLineBufferTransport_2 ( ThingstreamTransport inner,
uint8_t *  data,
uint32_t  dataSize 
)

Create a transport instance (number 2) that line-buffers a sequence of bytes for callbacks.

The callback of this transport can be safely called from interrupt handlers.

Do not mix calls to Thingstream_createLineBufferTransport_2() with calls to either the legacy macro line_buffer_transport_create() or the Thingstream__createLegacyLineBufferTransport() function.

Parameters
innerthe inner ThingstreamTransport instance to use
dataan area of data to use for the buffers
dataSizethe size of the data area
Returns
an instance of the line buffer transport

◆ Thingstream_createLineBufferTransport_3()

ThingstreamTransport* Thingstream_createLineBufferTransport_3 ( ThingstreamTransport inner,
uint8_t *  data,
uint32_t  dataSize 
)

Create a transport instance (number 3) that line-buffers a sequence of bytes for callbacks.

The callback of this transport can be safely called from interrupt handlers.

Do not mix calls to Thingstream_createLineBufferTransport_3() with calls to either the legacy macro line_buffer_transport_create() or the Thingstream__createLegacyLineBufferTransport() function.

Parameters
innerthe inner ThingstreamTransport instance to use
dataan area of data to use for the buffers
dataSizethe size of the data area
Returns
an instance of the line buffer transport