Merge pull request #9087 from miri64/gcoap/enh/conf-msg-queue-size
gcoap: make message queue size configurable
This commit is contained in:
commit
492d7c1a43
@ -227,7 +227,9 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* @brief Size for module message queue
|
* @brief Size for module message queue
|
||||||
*/
|
*/
|
||||||
|
#ifndef GCOAP_MSG_QUEUE_SIZE
|
||||||
#define GCOAP_MSG_QUEUE_SIZE (4)
|
#define GCOAP_MSG_QUEUE_SIZE (4)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Server port; use RFC 7252 default if not defined
|
* @brief Server port; use RFC 7252 default if not defined
|
||||||
|
|||||||
@ -92,16 +92,17 @@ static gcoap_state_t _coap_state = {
|
|||||||
|
|
||||||
static kernel_pid_t _pid = KERNEL_PID_UNDEF;
|
static kernel_pid_t _pid = KERNEL_PID_UNDEF;
|
||||||
static char _msg_stack[GCOAP_STACK_SIZE];
|
static char _msg_stack[GCOAP_STACK_SIZE];
|
||||||
|
static msg_t _msg_queue[GCOAP_MSG_QUEUE_SIZE];
|
||||||
static sock_udp_t _sock;
|
static sock_udp_t _sock;
|
||||||
|
|
||||||
|
|
||||||
/* Event/Message loop for gcoap _pid thread. */
|
/* Event/Message loop for gcoap _pid thread. */
|
||||||
static void *_event_loop(void *arg)
|
static void *_event_loop(void *arg)
|
||||||
{
|
{
|
||||||
msg_t msg_rcvd, msg_queue[GCOAP_MSG_QUEUE_SIZE];
|
msg_t msg_rcvd;
|
||||||
(void)arg;
|
(void)arg;
|
||||||
|
|
||||||
msg_init_queue(msg_queue, GCOAP_MSG_QUEUE_SIZE);
|
msg_init_queue(_msg_queue, GCOAP_MSG_QUEUE_SIZE);
|
||||||
|
|
||||||
sock_udp_ep_t local;
|
sock_udp_ep_t local;
|
||||||
memset(&local, 0, sizeof(sock_udp_ep_t));
|
memset(&local, 0, sizeof(sock_udp_ep_t));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user