Thingstream Client Library  BLD4131-v2.13
Data Structures | Macros | Typedefs
transport_api.h File Reference

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,...)
 

Detailed Description

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.

Macro Definition Documentation

◆ THINGSTREAM_USSD_BUFFER_LEN

#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.

◆ TLOG_PROTOCOL

#define TLOG_PROTOCOL   (1<<2)

enable protocol tracing

◆ TLOG_TIME

#define TLOG_TIME   (1<<3)

add timestamps to start of log lines

◆ TLOG_TRACE

#define TLOG_TRACE   (1<<0)

enable tracing

◆ TLOG_VERBOSE

#define TLOG_VERBOSE   (1<<1)

enable verbose tracing

◆ TRANSPORT_CHECK_VERSION_1

#define TRANSPORT_CHECK_VERSION_1 (   passed)

Check that the version number supplied is as expected

◆ TRANSPORT_VERSION

#define TRANSPORT_VERSION   TRANSPORT_VERSION_1
Deprecated:
This is the symbol used in the example serial driver in older releases.

◆ 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.

◆ TSEND_NEED_USERAGENT

#define TSEND_NEED_USERAGENT   (1U << 15)

packet being sent requires additional UserAgent block (valid for use between client layer and thingstream transport only).

◆ TSEND_USSD_SESSION_END

#define TSEND_USSD_SESSION_END   (1U << 14)

a USSD disconnect is needed (valid for use between thingstream, base64 and modem transports only).

◆ TSEND_WANT_BEARER_INDICATOR

#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).

◆ TSEND_WANT_GSM_BEARER

#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 Documentation

◆ ThingstreamPrintf_t

typedef int(* ThingstreamPrintf_t) (const char *format,...)

This function is used by a number of transport loggers

◆ ThingstreamTransportCallback_t

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.

Parameters
cookiea pointer to the user supplied cookie
dataa pointer to the data
lenthe length of the data

◆ ThingstreamTransportResult

The subset of ThingstreamResult values that start with TRANSPORT_

See ThingstreamResult for details of individual values.

◆ ThingstreamTransportState_t

typedef struct ThingstreamTransportState_s ThingstreamTransportState_t

Opaque type representing the internal state of a transport instance.