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.
This commit is contained in:
SPRESENSE 2024-09-24 13:50:07 +09:00 committed by Xiang Xiao
parent a5251161c6
commit 1e103bd41f
1 changed files with 18 additions and 0 deletions

View File

@ -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;