Skip to content

Commit

Permalink
fixup! add DTLS in gcoap
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiman Ismail committed Nov 6, 2019
1 parent 9f59746 commit d328465
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/gcoap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ USEMODULE += gnrc_icmpv6_echo
# DTLS configuration
# Choose which DTLS stack to use
USEMODULE += tinydtls_sock_dtls # tinyDTLS
USEMODULE += gcoap_lazy_init

CFLAGS += -DDTLS_PSK
#USEMODULE += wolfssl_sock_dtls # wolfSSL
Expand Down
5 changes: 2 additions & 3 deletions examples/gcoap/gcoap_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ int gcoap_cli_cmd(int argc, char **argv)
void gcoap_cli_init(void)
{
#ifdef MODULE_SOCK_DTLS
/* load credentials into pool with credman */
/* declare DTLS credential to use */
credman_credential_t credential = {
.type = CREDMAN_TYPE_PSK,
.tag = SOCK_DTLS_GCOAP_TAG,
Expand All @@ -418,7 +418,6 @@ void gcoap_cli_init(void)
/* tell gcoap with tag to use */
gcoap_set_credential_tag(SOCK_DTLS_GCOAP_TAG);
#endif
/* starts the gcoap server */
gcoap_init();

gcoap_register_listener(&_listener);
}
1 change: 1 addition & 0 deletions sys/net/application_layer/gcoap/gcoap.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ static kernel_pid_t _start_server(void)
}
_pid = thread_create(_msg_stack, sizeof(_msg_stack), THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST, _event_loop, NULL, "coap");
DEBUG("gcoap: server started\n");
return _pid;
}

Expand Down

0 comments on commit d328465

Please sign in to comment.