zephyr/drivers/modem
Xavier Chapron 5cc583bf3a drivers: modem: modem_cmd_handler.c: Drop cmd from buf if args are missing
In 90c6dc5e7f, a change was introduced to
allow modem commands determine if they have enough data or not.
In a situation where some data is missing, the command should return
-EAGAIN and this should lead to another call of the command with more
data.
In this commit, the argument parser was also allowed to return -EAGAIN
to request more data due to missing arguments.

However, this can't work because in cmd_handler_process_rx_buf() before
calling process_cmd():
- we make sure that a CR/LF has been found.
- we compute match_len which can't be greater than the distance to the
  next CR/LF.
Therefore, even if the command argument parser ask for more data by
returning -EAGAIN, next call will have the same value for match_len,
meaning that the parsing of argument will result in the same missing
argument situation.
This leads to an infinite loop of parsing the same data over and over in
an infinite loop.

This commit change this behavior to always drop the data in such a
situation. The command will not be answered and will therefore timeout,
but at least, next commands will correctly parse their returned data.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2022-03-17 11:33:17 +01:00
..
CMakeLists.txt drivers: modem: Added simcom sim7080 modem driver. 2021-12-20 17:48:47 +01:00
gsm_ppp.c drivers: modem: gsm: Use Kconfig macros directly 2022-03-16 10:23:32 +01:00
hl7800.c everywhere: fix typos 2022-03-14 20:22:24 -04:00
Kconfig kconfig: tweak Kconfig prompts 2022-03-09 15:35:54 +01:00
Kconfig.gsm drivers: modem: gsm: wait for cellular registration 2022-03-16 10:23:32 +01:00
Kconfig.hl7800 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
Kconfig.quectel-bg9x kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
Kconfig.simcom-sim7080 everywhere: fix typos 2022-03-14 20:22:24 -04:00
Kconfig.ublox-sara-r4 kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
Kconfig.wncm14a2a kconfig: remove Enable from boolean prompts 2022-03-09 15:35:54 +01:00
modem_cmd_handler.c drivers: modem: modem_cmd_handler.c: Drop cmd from buf if args are missing 2022-03-17 11:33:17 +01:00
modem_cmd_handler.h drivers: modem: modem_cmd_handler: Fix missing documentations 2022-02-28 11:05:06 +01:00
modem_context.c drivers: modem: Fix reference to stack in modem_context_sprint_ip_addr 2021-10-01 11:06:32 -04:00
modem_context.h drivers: modem: improve modem context RSSI member 2021-11-07 15:02:43 +02:00
modem_iface_uart.c driver: modem: Fix mux device name comparison 2021-11-06 10:20:42 -04:00
modem_iface_uart.h drivers: modem: operate on device pointers instead of names 2021-07-15 11:48:00 -04:00
modem_pin.c drivers: modem: Fix loop variables type 2022-02-04 11:19:28 +01:00
modem_receiver.c device: remove inclusion of pm/device.h 2021-11-29 11:08:38 +01:00
modem_receiver.h drivers: modem: improve modem context RSSI member 2021-11-07 15:02:43 +02:00
modem_shell.c drivers: modem: improve modem context RSSI member 2021-11-07 15:02:43 +02:00
modem_socket.c modem: Update modem sockets poll to allow eventfd 2021-11-11 19:12:46 -05:00
modem_socket.h modem: Update modem sockets poll to allow eventfd 2021-11-11 19:12:46 -05:00
quectel-bg9x.c everywhere: fix typos 2022-03-14 20:22:24 -04:00
quectel-bg9x.h drivers: modem: improve modem context RSSI member 2021-11-07 15:02:43 +02:00
simcom-sim7080.c everywhere: fix typos 2022-03-14 20:22:24 -04:00
simcom-sim7080.h drivers: modem: Added simcom sim7080 modem driver. 2021-12-20 17:48:47 +01:00
ublox-sara-r4.c everywhere: fix typos 2022-03-14 20:22:24 -04:00
wncm14a2a.c everywhere: fix typos 2022-03-14 20:22:24 -04:00