From 1e103bd41f1ee87bca5ece1b42892682fa3c2dee Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:50:07 +0900 Subject: [PATCH] drivers/modem/alt1250: Fix issue where the program would get stuck Fix issue where the program would get stuck if an unsupported ALTCOM packet was sent. --- drivers/modem/alt1250/alt1250.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/modem/alt1250/alt1250.c b/drivers/modem/alt1250/alt1250.c index 6280515031a..e88999c498f 100644 --- a/drivers/modem/alt1250/alt1250.c +++ b/drivers/modem/alt1250/alt1250.c @@ -856,6 +856,24 @@ static int parse_altcompkt(FAR struct alt1250_dev_s *dev, FAR uint8_t *pkt, if (*container) { (*container)->result = -ENOSYS; + *bitmap = get_bitmap(dev, cid, get_altver(h)); + if (LTE_IS_ASYNC_CMD((*container)->cmdid)) + { + /* Asynchronous types need to call the callback corresponding + * to the received event, so the REPLY bit is added to the + * received event. + */ + + *bitmap |= ALT1250_EVTBIT_REPLY; + } + else + { + /* Synchronous types do not call a callback, + * so only the REPLY bit is needed. + */ + + *bitmap = ALT1250_EVTBIT_REPLY; + } } return *container == NULL ? ERROR: OK;