Thingstream Client Library  BLD4131-v2.13
Functions | Variables
modem_transport.h File Reference

ThingstreamTransport implementation that communicates with a modem through a serial connection. More...

#include "transport_api.h"
#include "modem_ussd_transport.h"
#include "modem2_transport.h"
#include "modem_set_callback.h"

Macros

Common modem flags

The following flags can be passed to either Thingstream_createModemUssdTransport() or Thingstream_createModem2Transport(). Multiple flags can be combined using bitwise OR.

#define MODEM_SKIP_INIT   (0x01)
 
#define MODEM_STAGE_SHORTCODE   (0x02)
 
#define MODEM_MERGE_USSD_SESSION_END   (0x4)
 
#define MODEM_SPLIT_USSD_SESSION_END   (0x8)
 
#define MODEM_IGNORE_PLUS_CUSD2   (0x10)
 

Functions

void Thingstream_Application_modemCallback (const char *response, uint16_t len)
 

Variables

const char Thingstream_Modem_initString []
 
const char Thingstream_Modem_informationString []
 
const char Thingstream_Modem_ussdEndSessionString []
 
const char Thingstream_Modem_readFplmnString []
 
const char Thingstream_Modem_clearFplmnString []
 
const char Thingstream_Modem_forceResetString []
 

Detailed Description

ThingstreamTransport implementation that communicates with a modem through a serial connection.

Macro Definition Documentation

◆ MODEM_IGNORE_PLUS_CUSD2

#define MODEM_IGNORE_PLUS_CUSD2   (0x10)

Some modems (e.g. Quectel UG96) return unsolicited "+CUSD: 2" when a USSD session is terminated by the server, but most modems return this for various USSD error conditions. By default the modem driver will treat an unsolicited "+CUSD: 2" as an error condition. Setting this flag causes unsolicited "+CUSD: 2" messages to be treated as informational only.

◆ MODEM_MERGE_USSD_SESSION_END

#define MODEM_MERGE_USSD_SESSION_END   (0x4)

The modem allows the AT+CUSD=2 command (which denotes the end of a USSD session) to be combined with the last USSD message.

This flag and MODEM_SPLIT_USSD_SESSION_END are mutually exclusive. Do not set both flags. If neither flag is set, then one of them will be chosen during initialisation.

◆ MODEM_SKIP_INIT

#define MODEM_SKIP_INIT   (0x01)

When this flag is set, the modem transport layer considers the modem hardware to be initialised already and will skip its own initialisation. This is needed when other features of the modem hardware are programmed by non-Thingstream software.

◆ MODEM_SPLIT_USSD_SESSION_END

#define MODEM_SPLIT_USSD_SESSION_END   (0x8)

The modem requires the AT+CUSD=2 command (which denotes the end of a USSD session) to be split from the last USSD message.

This flag and MODEM_MERGE_USSD_SESSION_END are mutually exclusive. Do not set both flags. If neither flag is set, then one of them will be chosen during initialisation.

◆ MODEM_STAGE_SHORTCODE

#define MODEM_STAGE_SHORTCODE   (0x02)

The modem will usually talk to the normal (or "live") Thingstream software server stack, but occasionally the Thingstream support team may request that you use the debugging rather than live stack. Setting this flag tells the modem transport layer to use the stage debugging stack.

Variable Documentation

◆ Thingstream_Modem_clearFplmnString

const char Thingstream_Modem_clearFplmnString[]
extern

See modem_fplmn_string.c

This string is used to clear the SIM's FPLMN list of barred operators. The SDK modem driver issues this string (and the sequence from the Thingstream_Modem_forceResetString) when it has been unable to register with an operator.

◆ Thingstream_Modem_forceResetString

const char Thingstream_Modem_forceResetString[]
extern

See modem_reset_string.c

This string is used to reset the modem after a serious problem has been detected. Each entry in the string is terminated by "\n". If an entry starts with a "?" then the "?" is not passed to the modem, but any ERROR (or +CME ERROR:) produced will be ignored.

If the forced reset is successful it will be followed by the normal commands used to initialise the modem.

◆ Thingstream_Modem_informationString

const char Thingstream_Modem_informationString[]
extern

See modem_info_string.c

This string is used to obtain information from the modem once it has been initialised. Each entry in the string is terminated by "\n". If an entry starts with a "?" then the "?" is not passed to the modem, but any ERROR (or +CME ERROR:) produced will be ignored.

◆ Thingstream_Modem_initString

const char Thingstream_Modem_initString[]
extern

See modem_init_string.c

This string is used to initialise the modem. Each entry in the string is terminated by "\n". If an entry starts with a "?" then the "?" is not passed to the modem, but any ERROR (or +CME ERROR:) produced will be ignored. An entry of the form ~n inserts a delay of n ms into the sequence.

◆ Thingstream_Modem_readFplmnString

const char Thingstream_Modem_readFplmnString[]
extern

See modem_fplmn_string.c

This string is used to read the SIM's FPLMN list of barred operators. The SDK modem driver issues this string when it has been unable to register with an operator.

◆ Thingstream_Modem_ussdEndSessionString

const char Thingstream_Modem_ussdEndSessionString[]
extern

See modem_ussd_end_string.c

This string is used to terminate the current USSD session