Skip to content

Commit

Permalink
Compilation warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti Kauppila committed Dec 21, 2016
1 parent 7d72eb4 commit 8640d05
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions source/coap_connection_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ static NS_LIST_DEFINE(socket_list, internal_socket_t, link);

static void timer_cb(void* param);

static void recv_sckt_msg(void *cb_res);
#ifdef COAP_SECURITY_AVAILABLE
static void secure_recv_sckt_msg(void *cb_res);
#endif

#define TIMER_STATE_CANCELLED -1 /* cancelled */
#define TIMER_STATE_NO_EXPIRY 0 /* none of the delays is expired */
#define TIMER_STATE_INT_EXPIRY 1 /* the intermediate delay only is expired */
Expand Down Expand Up @@ -195,11 +200,6 @@ static secure_session_t *secure_session_find(internal_socket_t *parent, const ui
return this;
}



static void recv_sckt_msg(void *cb_res);
static void secure_recv_sckt_msg(void *cb_res);

static internal_socket_t *int_socket_create(uint16_t listen_port, bool use_ephemeral_port, bool is_secure, bool real_socket, bool bypassSec)
{
internal_socket_t *this = ns_dyn_mem_alloc(sizeof(internal_socket_t));
Expand Down Expand Up @@ -519,6 +519,7 @@ static int read_data(socket_callback_t *sckt_data, internal_socket_t *sock, ns_a

}

#ifdef COAP_SECURITY_AVAILABLE
static void secure_recv_sckt_msg(void *cb_res)
{
socket_callback_t *sckt_data = cb_res;
Expand Down Expand Up @@ -601,6 +602,7 @@ static void secure_recv_sckt_msg(void *cb_res)
}
}
}
#endif

static void recv_sckt_msg(void *cb_res)
{
Expand Down
4 changes: 2 additions & 2 deletions source/coap_service_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ static uint8_t coap_tx_function(uint8_t *data_ptr, uint16_t data_len, sn_nsdl_ad
ns_address_t dest_addr;

if (!transaction_ptr || !data_ptr) {
return -1;
return 0;
}

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

this = service_find(transaction_ptr->service_id);
if (!this) {
return -1;
return 0;
}

memcpy(&(dest_addr.address), address_ptr->addr_ptr, 16);
Expand Down
6 changes: 3 additions & 3 deletions source/include/coap_security_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
#ifndef __COAP_SECURITY_HANDLER_H__
#define __COAP_SECURITY_HANDLER_H__

#include <stddef.h>
#include <inttypes.h>
#include <stdbool.h>
#include "ns_types.h"

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

#else

NS_DUMMY_DEFINITIONS_OK

/* Dummy definitions, including needed error codes */
#define MBEDTLS_ERR_SSL_TIMEOUT (-1)
#define MBEDTLS_ERR_SSL_WANT_READ (-2)
Expand Down

0 comments on commit 8640d05

Please sign in to comment.