Skip to content

Commit 8640d05

Browse files
author
Antti Kauppila
committed
Compilation warnings fixed
1 parent 7d72eb4 commit 8640d05

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

source/coap_connection_handler.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ static NS_LIST_DEFINE(socket_list, internal_socket_t, link);
4646

4747
static void timer_cb(void* param);
4848

49+
static void recv_sckt_msg(void *cb_res);
50+
#ifdef COAP_SECURITY_AVAILABLE
51+
static void secure_recv_sckt_msg(void *cb_res);
52+
#endif
53+
4954
#define TIMER_STATE_CANCELLED -1 /* cancelled */
5055
#define TIMER_STATE_NO_EXPIRY 0 /* none of the delays is expired */
5156
#define TIMER_STATE_INT_EXPIRY 1 /* the intermediate delay only is expired */
@@ -195,11 +200,6 @@ static secure_session_t *secure_session_find(internal_socket_t *parent, const ui
195200
return this;
196201
}
197202

198-
199-
200-
static void recv_sckt_msg(void *cb_res);
201-
static void secure_recv_sckt_msg(void *cb_res);
202-
203203
static internal_socket_t *int_socket_create(uint16_t listen_port, bool use_ephemeral_port, bool is_secure, bool real_socket, bool bypassSec)
204204
{
205205
internal_socket_t *this = ns_dyn_mem_alloc(sizeof(internal_socket_t));
@@ -519,6 +519,7 @@ static int read_data(socket_callback_t *sckt_data, internal_socket_t *sock, ns_a
519519

520520
}
521521

522+
#ifdef COAP_SECURITY_AVAILABLE
522523
static void secure_recv_sckt_msg(void *cb_res)
523524
{
524525
socket_callback_t *sckt_data = cb_res;
@@ -601,6 +602,7 @@ static void secure_recv_sckt_msg(void *cb_res)
601602
}
602603
}
603604
}
605+
#endif
604606

605607
static void recv_sckt_msg(void *cb_res)
606608
{

source/coap_service_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ static uint8_t coap_tx_function(uint8_t *data_ptr, uint16_t data_len, sn_nsdl_ad
127127
ns_address_t dest_addr;
128128

129129
if (!transaction_ptr || !data_ptr) {
130-
return -1;
130+
return 0;
131131
}
132132

133133
tr_debug("Service %d, CoAP TX Function - mid: %d", transaction_ptr->service_id, common_read_16_bit(data_ptr + 2));
134134

135135
this = service_find(transaction_ptr->service_id);
136136
if (!this) {
137-
return -1;
137+
return 0;
138138
}
139139

140140
memcpy(&(dest_addr.address), address_ptr->addr_ptr, 16);

source/include/coap_security_handler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
#ifndef __COAP_SECURITY_HANDLER_H__
1919
#define __COAP_SECURITY_HANDLER_H__
2020

21-
#include <stddef.h>
22-
#include <inttypes.h>
23-
#include <stdbool.h>
21+
#include "ns_types.h"
2422

2523
#ifdef NS_USE_EXTERNAL_MBED_TLS
2624
#include "mbedtls/ssl.h"
@@ -99,6 +97,8 @@ const void *coap_security_handler_keyblock(const coap_security_t *sec);
9997

10098
#else
10199

100+
NS_DUMMY_DEFINITIONS_OK
101+
102102
/* Dummy definitions, including needed error codes */
103103
#define MBEDTLS_ERR_SSL_TIMEOUT (-1)
104104
#define MBEDTLS_ERR_SSL_WANT_READ (-2)

0 commit comments

Comments
 (0)