Skip to content

Commit

Permalink
driver/alt1250: Notice instance information
Browse files Browse the repository at this point in the history
Use macro for retrurn value.
  • Loading branch information
SPRESENSE committed Feb 27, 2024
1 parent 5a4b0c2 commit 6e29024
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/modem/alt1250/altcom_lwm2m_hdlr.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@

#include "altcom_lwm2m_hdlr.h"

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

#define NO_MEMBER (-1)

/****************************************************************************
* Private Function Prototypes
****************************************************************************/
Expand Down Expand Up @@ -361,7 +367,7 @@ static int parse_inst_number(FAR uint8_t **buf, FAR size_t *bufsz)

if (!isdigit(**buf))
{
return -1;
return NO_MEMBER;
}

while (*bufsz)
Expand Down Expand Up @@ -391,7 +397,7 @@ static int32_t server_op_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR int *srvid = (FAR int *)&cb_args[1];
FAR int *inst = (FAR int *)cb_args[2];

/* The valiable of "inst" is a type of struct lwm2mstub_instance_s in fact.
/* The content of "inst" is a type of struct lwm2mstub_instance_s in fact.
* But actually it is the same as int[4].
* To make simpler logic, inst is defined as int[4] (int pointer).
*/
Expand All @@ -413,7 +419,7 @@ static int32_t server_op_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz,
*event = parse_inst_number(&pktbuf, &pktsz);
if (*event < 0)
{
return -1;
return ERROR;
}

if (pktsz > 0 && pktbuf[0] == ',')
Expand All @@ -434,7 +440,7 @@ static int32_t server_op_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz,
}
}

return 1;
return OK;
}

/****************************************************************************
Expand Down

0 comments on commit 6e29024

Please sign in to comment.