![]() |
Thingstream Client Library
BLD4131-v2.13
|
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 | |
ThingstreamTransport * | Thingstream_createModemDelayTransport (ThingstreamTransport *inner, uint16_t sleepMs, const char *wakeupString, uint16_t afterWakeMs) |
ThingstreamTransport implementation that delays a modem's communication a serial connection so that the modem hardware can wake up from low power mode.
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.
inner | the inner ThingstreamTransport instance to use |
sleepMs | the number of milliseconds before sleep mode activated. |
wakeupString | the string to send to the modem to wakeup (e.g. "\n") |
afterWakeMs | the number of milliseconds to wait after wakeupString. |