Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/net/coaps_client/src/coaps_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void dtls_client(void)
int ret;
struct udp_context ctx;
struct dtls_timing_context timer;
struct zoap_packet request, zkt;
struct zoap_packet request, zpkt;
struct zoap_reply *reply;
struct net_pkt *pkt;
struct net_buf *frag;
Expand Down
7 changes: 2 additions & 5 deletions samples/net/coaps_client/src/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int udp_tx(void *context, const unsigned char *buf, size_t size)
}
}

int udp_rx(void *context, unsigned char *buf, size_t size, u32_t timeout)
int udp_rx(void *context, unsigned char *buf, size_t size)
{
struct udp_context *ctx = context;
struct net_buf *rx_buf = NULL;
Expand All @@ -92,10 +92,7 @@ int udp_rx(void *context, unsigned char *buf, size_t size, u32_t timeout)
int len;
int rc;

rc = k_sem_take(&ctx->rx_sem, timeout == 0 ? K_FOREVER : timeout);
if (rc != 0) {
return MBEDTLS_ERR_SSL_TIMEOUT;
}
k_sem_take(&ctx->rx_sem, K_FOREVER);

read_bytes = net_pkt_appdatalen(ctx->rx_pkt);
if (read_bytes > size) {
Expand Down
2 changes: 1 addition & 1 deletion samples/net/coaps_client/src/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ struct udp_context {

int udp_init(struct udp_context *ctx);
int udp_tx(void *ctx, const unsigned char *buf, size_t size);
int udp_rx(void *ctx, unsigned char *buf, size_t size, u32_t timeout);
int udp_rx(void *ctx, unsigned char *buf, size_t size);

#endif
2 changes: 1 addition & 1 deletion samples/net/coaps_client/testcase.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[test]
tags = net
build_only = true
arch_whitelist = qemu_x86 arduino_101
platform_whitelist = qemu_x86