![]() |
Thingstream Client Library
BLD4131-v2.13
|
The required stack for communicating with Thingstream infrastructure looks like this
Application |
---|
Client (client_api.h) |
Protocol layer (thingstream_transport.h) |
Base64 codec (base64_codec_transport.h) |
* Modem transport (modem_transport.h) |
* Line buffer input (line_buffer_transport.h) |
* Serial port driver (serial_transport.h) |
The layers marked '*' depend on the porting code for the target.
This architecture allows adding additional transport layers, for example to provide log output during development. While testing layers have been implemented, they are not yet part of the SDK, due to platform dependencies.
Example code initializing the stack:
In order to minimize the memory requirement of the client stack, one single buffer is used for sending and receiving data. This buffer should be reserved by the lowest level transport implementation and passed up via the ThingstreamTransport::get_buffer() function.
An exception to this rule is the Thingstream protocol layer implementation, whose Thingstream_createProtocolTransport() function can optionally be passed a larger buffer to be used for sending and receiving messages that are longer than supported by the underlying transport instances.