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

ThingstreamTransport implementation that delays a modem's communication a serial connection so that the modem hardware can wake up from low power mode. More...

#include "transport_api.h"

Functions

ThingstreamTransportThingstream_createModemDelayTransport (ThingstreamTransport *inner, uint16_t sleepMs, const char *wakeupString, uint16_t afterWakeMs)
 

Detailed Description

ThingstreamTransport implementation that delays a modem's communication a serial connection so that the modem hardware can wake up from low power mode.

Function Documentation

◆ Thingstream_createModemDelayTransport()

ThingstreamTransport* Thingstream_createModemDelayTransport ( ThingstreamTransport inner,
uint16_t  sleepMs,
const char *  wakeupString,
uint16_t  afterWakeMs 
)

Create an instance of a delay transport for the modem transport.

Some modems (e.g. Simcom, Quectel and u-blox) have a low power mode where the UART clocks are reduced. When in this mode the modem wakes up when the first byte is sent by the MCU, but the character is discarded (it will have framing errors since the clocks are not correct). The MCU should send something (e.g. "\n") and then wait to allow the modem to wakeup before sending the real command to the modem.

This transport sends the wakeupString and delays when needed by simulating the sleep and wakeup.

Parameters
innerthe inner ThingstreamTransport instance to use
sleepMsthe number of milliseconds before sleep mode activated.
wakeupStringthe string to send to the modem to wakeup (e.g. "\n")
afterWakeMsthe number of milliseconds to wait after wakeupString.
Returns
the ThingstreamTransport instance