Input module is used to input received data from GSM device to LwGSM-Lib middleware part.
2 processing options are possible:
Direct or indirect processing mode is select by setting
LWGSM_CFG_INPUT_USE_PROCESS configuration value.
With indirect processing mode, every received character from GSM physical device is written to intermediate buffer between low-level driver and processing thread.
lwgsm_input() is used to write data to buffer, which is later processed
by processing thread.
Indirect processing mode allows embedded systems to write received data to buffer from interrupt context (outside threads). As a drawback, its performance is decreased as it involves copying every receive character to intermediate buffer, and may also introduce RAM memory footprint increase.
Direct processing is targeting more advanced host controllers, like STM32 or WIN32 implementation use. It is developed with DMA support in mind, allowing low-level drivers to skip intermediate data buffer and process input bytes directly.
When using this mode, function
lwgsm_input_process() must be used and it may
only be called from thread context. Processing of input bytes is done in low-level
input thread, started by application.
Check Porting guide for implementation examples.
- group LWGSM_INPUT
Input function for received data.
lwgsmr_t lwgsm_input(const void *data, size_t len)¶
Write data to input buffer.
LWGSM_CFG_INPUT_USE_PROCESS must be disabled to use this function
lwgsmr_t lwgsm_input_process(const void *data, size_t len)¶
Process input data directly without writing it to input buffer.
This function may only be used when in OS mode, where single thread is dedicated for input read of AT receive
LWGSM_CFG_INPUT_USE_PROCESS must be enabled to use this function
- lwgsmr_t lwgsm_input(const void *data, size_t len)¶