Skip to content

Commit

Permalink
Merge pull request #115 from sonydevworld/develop
Browse files Browse the repository at this point in the history
Merge develop into new-master for v2.6.0 release
  • Loading branch information
SPRESENSE authored Aug 5, 2022
2 parents fb3f4e3 + d145646 commit 1c5a6d9
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 31 deletions.
20 changes: 12 additions & 8 deletions include/lte/lte_fwupdate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/include/lte/lte_fw_api.h
* apps/include/lte/lte_fwupdate.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -59,15 +59,15 @@ extern "C"
****************************************************************************/

/* Initialze injection delta image to LTE modem.
*
*
* Initialize LTE modem delta image injection with some data of top of delta
* image.
*
* [in] initial_data: Pointer to top data of update image.
* [in] len: Size of initial_data.
*
* Return value : Positive value is the injected length. Negative falue is any
* error. In error case, the value can be below values.
* Return value : Positive value is the injected length. Negative value is
* any error. In error case, the value can be below values.
*
* - LTEFW_RESULT_NOT_ENOUGH_INJECTSTORAGE
* - LTEFW_RESULT_DELTAIMAGE_HDR_CRC_ERROR
Expand All @@ -80,15 +80,15 @@ extern "C"
int ltefwupdate_initialize(const char *initial_data, int len);

/* Inject rest delta image to LTE modem.
*
*
* Inject the rest of the delta image following the data injected
* by the ltefwupdate_initialize() and ltefwupdate_injectrest() functions.
*
* [in] rest_data: Pointer to top data of update image.
* [in] len: Size of initial_data.
*
* Return value : Positive value is the injected length. Negative falue is any
* error. In error case, the value can be below values.
* Return value : Positive value is the injected length. Negative value is
* any error. In error case, the value can be below values.
*
* - LTEFW_RESULT_NOT_ENOUGH_INJECTSTORAGE
* - LTEFW_RESULT_DELTAIMAGE_HDR_CRC_ERROR
Expand All @@ -112,10 +112,14 @@ int ltefwupdate_injected_datasize(void);
* attention When this function is executed, the modem is automatically
* rebooted multiple times. The progress of the update can be checked by
* the callback set by lte_set_report_restart().
* Before executing this function, the modem must be woken up using
* lte_acquire_wakelock() to safely update the modem. Then
* lte_release_wakelock() is executed when the callback set by
* lte_set_report_restart() is called.
*
* On success, 0 is returned. On failure,
* negative value is returned as below values.
*
*
* - LTEFW_RESULT_PRECHK_SET_DELTAIMAGE_FAILED
* - LTEFW_RESULT_PRECHK_DELTAIMAGE_MISSING
* - LTEFW_RESULT_PRECHK_OOM
Expand Down
2 changes: 1 addition & 1 deletion lte/alt1250/alt1250_reset_seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct reset_arg_s
* Private Data
****************************************************************************/

struct reset_arg_s reset_arg;
static struct reset_arg_s reset_arg;

static postproc_hdlr_t ponreset_seq[] =
{
Expand Down
5 changes: 3 additions & 2 deletions lte/alt1250/alt1250_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ static int send_select_command(FAR struct alt1250_s *dev,
{
FAR void *in[7];
uint16_t used_setbit = 0;
struct alt_container_s container;
int32_t usock_result;
struct alt_container_s container = {
0
};

if (readset)
{
Expand All @@ -113,7 +115,6 @@ static int send_select_command(FAR struct alt1250_s *dev,
in[5] = writeset;
in[6] = exceptset;

clear_container(&container);
set_container_ids(&container, 0, LTE_CMDID_SELECT);
set_container_argument(&container, in, ARRAY_SZ(in));

Expand Down
5 changes: 3 additions & 2 deletions lte/alt1250/usock_handlers/alt1250_sms.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,10 @@ static int send_smsdelete_command(FAR struct alt1250_s *dev,
static int send_smsreportrecv_command(FAR struct alt1250_s *dev,
FAR int32_t *usock_result)
{
struct alt_container_s container;
struct alt_container_s container = {
0
};

clear_container(&container);
set_container_ids(&container, 0, LTE_CMDID_SMS_REPORT_RECV);

return altdevice_send_command(dev->altfd, &container, usock_result);
Expand Down
9 changes: 1 addition & 8 deletions lte/lapi/src/lapi_lwm2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,20 +304,13 @@ int lte_enablem2m_objects(uint16_t *objids, int objnum)
objids, (void *)objnum
};

if (!objids || objnum < 2)
if (!objids || objnum <= 0)
{
return -EINVAL;
}

insert_sort(objids, objnum);

if (objids[0] != 0 || objids[1] != 1)
{
/* Object 0 and 1 are mandatory. */

return -EINVAL;
}

return lapi_req(LTE_CMDID_LWM2M_SETACTIVEOBJ, &inarg, 2, NULL, 0, NULL);
}

Expand Down
54 changes: 44 additions & 10 deletions wireless/gs2200m/gs2200m_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,24 @@ static int usock_send_event(int fd, FAR struct gs2200m_s *priv,
return _write_to_usock(fd, &event, sizeof(event));
}

/****************************************************************************
* Name: usock_sendevent_toall
****************************************************************************/

static void usock_sendevent_toall(FAR struct gs2200m_s *priv, int fd)
{
int i;

for (i = 0; i < SOCKET_COUNT; i++)
{
if (priv->sockets[i].state != CLOSED)
{
usock_send_event(fd, priv, &priv->sockets[i],
USRSOCK_EVENT_RECVFROM_AVAIL);
}
}
}

/****************************************************************************
* Name: socket_request
****************************************************************************/
Expand Down Expand Up @@ -1669,21 +1687,37 @@ static int gs2200m_loop(FAR struct gs2200m_s *priv)
ret = read(fd[1], &cid, sizeof(cid));
ASSERT(ret == sizeof(cid));

/* find usock by the cid */
/* Check if all socket destroy or not */

usock = gs2200m_find_socket_by_cid(priv, cid);

if (NULL == usock)
if (cid == DISASSOCIATION_CID)
{
gs2200m_printf("=== %s: cid=%c not found (ignored) \n",
__func__, cid);
gs2200m_printf("=== %s: Disassocitaion event\n",
__func__);

/* To release sockets blocking in user-sock,
* send event to all opened sockets.
*/

usock_sendevent_toall(priv, fd[0]);
}
else
{
/* send event to call xxxx_request() */

usock_send_event(fd[0], priv, usock,
USRSOCK_EVENT_RECVFROM_AVAIL);
/* find usock by the cid */

usock = gs2200m_find_socket_by_cid(priv, cid);

if (NULL == usock)
{
gs2200m_printf("=== %s: cid=%c not found (ignored)\n",
__func__, cid);
}
else
{
/* send event to call xxxx_request() */

usock_send_event(fd[0], priv, usock,
USRSOCK_EVENT_RECVFROM_AVAIL);
}
}
}
}
Expand Down

0 comments on commit 1c5a6d9

Please sign in to comment.