Thingstream Client Library  BLD4131-v2.13
Functions
modem_ussd_transport.h File Reference

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

#include "transport_api.h"

Functions

ThingstreamTransportThingstream_createModemUssdTransport (ThingstreamTransport *inner, uint16_t flags)
 
ThingstreamTransportResult Thingstream_ModemUssd_sendLine (ThingstreamTransport *self, const char *line, uint32_t millis)
 
uint32_t Thingstream_ModemUssd_getCUSDErrors (ThingstreamTransport *self, uint32_t andClear)
 
uint32_t Thingstream_ModemUssd_getSeriousErrors (ThingstreamTransport *self, uint32_t andClear)
 

Detailed Description

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

Function Documentation

◆ Thingstream_createModemUssdTransport()

ThingstreamTransport* Thingstream_createModemUssdTransport ( ThingstreamTransport inner,
uint16_t  flags 
)

Create an instance of the modem transport.

Parameters
innerthe inner ThingstreamTransport instance to use
flagsa set of control flags. See modem flags. Set flags to '0' to get the default settings.
Returns
the ThingstreamTransport instance

◆ Thingstream_ModemUssd_getCUSDErrors()

uint32_t Thingstream_ModemUssd_getCUSDErrors ( ThingstreamTransport self,
uint32_t  andClear 
)

Return the number of accumulated +CUSD: errors.

Parameters
selfinstance of modem transport
andClearif non-zero, then clear the count.
Returns
the number of accumulated +CUSD: errors.

◆ Thingstream_ModemUssd_getSeriousErrors()

uint32_t Thingstream_ModemUssd_getSeriousErrors ( ThingstreamTransport self,
uint32_t  andClear 
)

Return the number of accumulated serious errors (those that trigger a modem reset to recover)

Parameters
selfinstance of modem transport
andClearif non-zero, then clear the count.
Returns
the number of accumulated serious errors.

◆ Thingstream_ModemUssd_sendLine()

ThingstreamTransportResult Thingstream_ModemUssd_sendLine ( ThingstreamTransport self,
const char *  line,
uint32_t  millis 
)

Send the line to the modem and wait for an OK response. The application can implement Thingstream_Application_modemCallback() to receive any response from the modem caused by the sent line.

Parameters
selfinstance of modem transport
linea null-terminated line to send to the modem ("\r\n" will be added)
millisthe maximum number of milliseconds to run
Returns
a ThingstreamTransportResult status code (0 => success / fail)