Skip to content

Commit

Permalink
Merge pull request #109 from sonydevworld/develop
Browse files Browse the repository at this point in the history
Merge develop into new-master for v2.5.1 release
  • Loading branch information
SPRESENSE authored May 18, 2022
2 parents 9ec7705 + 6f97d73 commit fb3f4e3
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/lte/lte_lwm2m.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define LWM2MSTUB_RESOURCE_HANDLEMODEMH (2)

#define LWM2MSTUB_MAX_WRITE_SIZE (1500)
#define LWM2MSTUB_MAX_TOKEN_SIZE (9)
#define LWM2MSTUB_MAX_TOKEN_SIZE (8 * 2 + 1)

#define LWM2MSTUB_MAX_SERVER_NAME (256)
#define LWM2MSTUB_MAX_DEVID (256)
Expand Down
12 changes: 3 additions & 9 deletions lte/alt1250/alt1250_daemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,9 @@
* Pre-processor Definitions
****************************************************************************/

#if defined(CONFIG_NET_USRSOCK_CONNS)
# if (CONFIG_NET_USRSOCK_CONNS > ALTCOM_NSOCKET)
# define SOCKET_COUNT ALTCOM_NSOCKET
# else
# define SOCKET_COUNT CONFIG_NET_USRSOCK_CONNS
# endif
#else
# define SOCKET_COUNT ALTCOM_NSOCKET
#endif
/* The maximum number of sockets that the ALT1250 modem can open. */

#define SOCKET_COUNT 5

#define _TX_BUFF_SIZE (1500)
#define _RX_BUFF_SIZE (1500)
Expand Down
59 changes: 58 additions & 1 deletion lte/alt1250/usock_handlers/alt1250_accepthdlr.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,62 @@
* Private Functions
****************************************************************************/

/****************************************************************************
* name: postproc_accepterr
****************************************************************************/

static int postproc_accepterr(FAR struct alt1250_s *dev,
FAR struct alt_container_s *reply,
FAR struct usock_s *usock,
FAR int32_t *usock_result,
FAR uint8_t *usock_xid,
FAR struct usock_ackinfo_s *ackinfo,
unsigned long arg)
{
int ret = REP_SEND_ACK;

dbg_alt1250("%s start\n", __func__);

/* resp[0]: ret code
* resp[1]: error code
*/

*usock_xid = USOCKET_XID(usock);
*usock_result = -EBUSY;

return ret;
}

/****************************************************************************
* name: send_close_command
****************************************************************************/

static int send_close_command(FAR struct alt1250_s *dev,
FAR struct alt_container_s *container,
FAR struct usock_s *usock,
int altsock,
FAR int32_t *usock_result)
{
int idx = 0;
FAR void *inparam[1];

/* This member is referenced only when sending a command and
* not when receiving a response, so local variable is used.
*/

inparam[0] = &altsock;

USOCKET_SET_RESPONSE(usock, idx++, USOCKET_REP_RESULT(usock));
USOCKET_SET_RESPONSE(usock, idx++, USOCKET_REP_ERRCODE(usock));

set_container_ids(container, USOCKET_USOCKID(usock), LTE_CMDID_CLOSE);
set_container_argument(container, inparam, ARRAY_SZ(inparam));
set_container_response(container, USOCKET_REP_RESPONSE(usock), idx);
set_container_postproc(container, postproc_accepterr, 0);

return altdevice_send_command(dev->altfd, container, usock_result);
}

/****************************************************************************
* name: postproc_accept
****************************************************************************/
Expand Down Expand Up @@ -70,7 +126,8 @@ static int postproc_accept(FAR struct alt1250_s *dev,
accept_sock = usocket_alloc(dev);
if (!accept_sock)
{
*usock_result = -EBUSY;
ret = send_close_command(dev, reply, usock, altsock_res,
usock_result);
*usock_xid = USOCKET_XID(usock);
}
else
Expand Down
2 changes: 1 addition & 1 deletion lte/alt1250/usock_handlers/alt1250_usrsock_hdlr.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#define COMBINE_ERRCODE(res, ecode) (((res) < 0) ? -(ecode) : (res))

#define ALT1250_NETIF_READY_DELAY (500 * 1000)
#define ALT1250_NETIF_READY_DELAY (150 * 1000)

/****************************************************************************
* Public Function Prototypes
Expand Down

0 comments on commit fb3f4e3

Please sign in to comment.