![]() |
Thingstream Client Library
BLD4131-v2.13
|
The API describing transport implementations. More...
#include <stdint.h>
#include "thingstream_result.h"
#include "thingstream_deprecated_transport_short_names.h"
Data Structures | |
struct | ThingstreamTransport |
Macros | |
#define | THINGSTREAM_USSD_BUFFER_LEN 145 |
#define | TRANSPORT_VERSION_1 |
#define | TRANSPORT_VERSION TRANSPORT_VERSION_1 |
#define | TRANSPORT_CHECK_VERSION_1(passed) |
#define | TLOG_TRACE (1<<0) |
#define | TLOG_VERBOSE (1<<1) |
#define | TLOG_PROTOCOL (1<<2) |
#define | TLOG_TIME (1<<3) |
#define | TSEND_NEED_USERAGENT (1U << 15) |
#define | TSEND_USSD_SESSION_END (1U << 14) |
#define | TSEND_WANT_GSM_BEARER (1U << 12) |
#define | TSEND_WANT_BEARER_INDICATOR (1U << 11) |
Typedefs | |
typedef ThingstreamResult | ThingstreamTransportResult |
typedef void(* | ThingstreamTransportCallback_t) (void *cookie, uint8_t *data, uint16_t len) |
typedef struct ThingstreamTransportState_s | ThingstreamTransportState_t |
typedef int(* | ThingstreamPrintf_t) (const char *format,...) |
The API describing transport implementations.
Implementations of this API offer an implementation-specific function for creating an instance of ThingstreamTransport. Note that implementations can choose to return a single, statically allocated instance rather than allowing multiple instances to exist in parallel.
#define THINGSTREAM_USSD_BUFFER_LEN 145 |
A buffer of size THINGSTREAM_USSD_BUFFER_LEN is large enough to receive the biggest packet that the server believes can be handled by typical modems. The normal Thingstream modem transport will also use only this number of bytes in the buffer obtained from the serial (or line buffer transport) so using a larger value in the serial transport would just waste space.
#define TLOG_PROTOCOL (1<<2) |
enable protocol tracing
#define TLOG_TIME (1<<3) |
add timestamps to start of log lines
#define TLOG_TRACE (1<<0) |
enable tracing
#define TLOG_VERBOSE (1<<1) |
enable verbose tracing
#define TRANSPORT_CHECK_VERSION_1 | ( | passed | ) |
Check that the version number supplied is as expected
#define TRANSPORT_VERSION TRANSPORT_VERSION_1 |
#define TRANSPORT_VERSION_1 |
ThingstreamTransport API version. A version number is passed to the init entry point to allow a runtime check that sources compiled at different times are compatible.
Source files should use the specific version of the API they are written to.
#define TSEND_NEED_USERAGENT (1U << 15) |
packet being sent requires additional UserAgent block (valid for use between client layer and thingstream transport only).
#define TSEND_USSD_SESSION_END (1U << 14) |
a USSD disconnect is needed (valid for use between thingstream, base64 and modem transports only).
#define TSEND_WANT_BEARER_INDICATOR (1U << 11) |
packet being sent would like additional BearerIndicator block (valid for use between client layer and thingstream transport only).
#define TSEND_WANT_GSM_BEARER (1U << 12) |
Bit (1U << 13) is no longer used. packet being sent would like additional GsmBearer block if the information is available. (valid for use between client layer and thingstream transport only).
typedef int(* ThingstreamPrintf_t) (const char *format,...) |
This function is used by a number of transport loggers
typedef void(* ThingstreamTransportCallback_t) (void *cookie, uint8_t *data, uint16_t len) |
Type definition for the raw message received callback. When the transport-specific code discovers a new message has arrived (either by polling or using an interrupt or similar) the callback function will be called to pass the inbound raw data to the next outermost ThingstreamTransport.
cookie | a pointer to the user supplied cookie |
data | a pointer to the data |
len | the length of the data |
The subset of ThingstreamResult values that start with TRANSPORT_
See ThingstreamResult for details of individual values.
typedef struct ThingstreamTransportState_s ThingstreamTransportState_t |
Opaque type representing the internal state of a transport instance.