![]() |
Thingstream Client Library
BLD4131-v2.13
|
#include <transport_api.h>
Data Fields | |
ThingstreamTransportState_t * | _state |
ThingstreamTransportResult(* | init )(ThingstreamTransport *self, uint16_t version) |
ThingstreamTransportResult(* | shutdown )(ThingstreamTransport *self) |
ThingstreamTransportResult(* | get_buffer )(ThingstreamTransport *self, uint8_t **buffer, uint16_t *len) |
const char *(* | get_client_id )(ThingstreamTransport *self) |
ThingstreamTransportResult(* | send )(ThingstreamTransport *self, uint16_t flags, uint8_t *data, uint16_t len, uint32_t millis) |
ThingstreamTransportResult(* | register_callback )(ThingstreamTransport *self, ThingstreamTransportCallback_t callback, void *cookie) |
ThingstreamTransportResult(* | unused_slot )(ThingstreamTransport *self) |
ThingstreamTransportResult(* | run )(ThingstreamTransport *self, uint32_t millis) |
Type definition for a transport instance.
Type representing a transport instance.
ThingstreamTransportState_t* ThingstreamTransport::_state |
Internal representation of the transport state. For portability, ThingstreamTransport implementations should not access this directly, but rather cast it to their concrete type definitions.
ThingstreamTransportResult(* ThingstreamTransport::get_buffer) (ThingstreamTransport *self, uint8_t **buffer, uint16_t *len) |
Obtain a buffer to write data into.
buffer | where to write the buffer pointer |
len | where the write the buffer length |
const char*(* ThingstreamTransport::get_client_id) (ThingstreamTransport *self) |
Obtain the client ID from the transport. This is useful for cases where the transport implementation can obtain a unique ID, such as reading the IMSI from an attached cellular modem. The returned pointer remains valid until shutdown of the transport.
ThingstreamTransportResult(* ThingstreamTransport::init) (ThingstreamTransport *self, uint16_t version) |
Initialize the transport. This may involve the setup on GPIO, UART ports, interrupts and other platform dependencies.
version | the transport API version |
ThingstreamTransportResult(* ThingstreamTransport::register_callback) (ThingstreamTransport *self, ThingstreamTransportCallback_t callback, void *cookie) |
Register a callback function that will be called when this transport has data to send to its next outermost ThingstreamTransport.
callback | the callback function |
cookie | a opaque value passed to the callback function |
ThingstreamTransportResult(* ThingstreamTransport::run) (ThingstreamTransport *self, uint32_t millis) |
Allow the transport instance to run for at most the given number of milliseconds.
millis | the maximum number of milliseconds to run (a value of zero processes all pending operations). |
ThingstreamTransportResult(* ThingstreamTransport::send) (ThingstreamTransport *self, uint16_t flags, uint8_t *data, uint16_t len, uint32_t millis) |
Send the data to the next innermost ThingstreamTransport or hardware device.
flags | an indication of the type of the data, zero is normal. |
data | a pointer to the data |
len | the length of the raw data |
millis | the maximum number of milliseconds to run |
ThingstreamTransportResult(* ThingstreamTransport::shutdown) (ThingstreamTransport *self) |
Shutdown the transport (i.e. the opposite of initialize)
ThingstreamTransportResult(* ThingstreamTransport::unused_slot) (ThingstreamTransport *self) |