Skip to content

Commit 1e103bd

Browse files
SPRESENSExiaoxiang781216
authored andcommitted
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.
1 parent a525116 commit 1e103bd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/modem/alt1250/alt1250.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,24 @@ static int parse_altcompkt(FAR struct alt1250_dev_s *dev, FAR uint8_t *pkt,
856856
if (*container)
857857
{
858858
(*container)->result = -ENOSYS;
859+
*bitmap = get_bitmap(dev, cid, get_altver(h));
860+
if (LTE_IS_ASYNC_CMD((*container)->cmdid))
861+
{
862+
/* Asynchronous types need to call the callback corresponding
863+
* to the received event, so the REPLY bit is added to the
864+
* received event.
865+
*/
866+
867+
*bitmap |= ALT1250_EVTBIT_REPLY;
868+
}
869+
else
870+
{
871+
/* Synchronous types do not call a callback,
872+
* so only the REPLY bit is needed.
873+
*/
874+
875+
*bitmap = ALT1250_EVTBIT_REPLY;
876+
}
859877
}
860878

861879
return *container == NULL ? ERROR: OK;

0 commit comments

Comments
 (0)