fix request handler signature

Since the local_interface was added to the request handler callback,
the examples rd.c and etsi_iot_01.c were broken. This change fixes
rd.c and abandons etsi_iot_01.c (as it is very outdated).
This commit is contained in:
Olaf Bergmann committed 2014-07-05 22:11:51 +02:00
1 parent f769519ace
commit 91a20eb67f
2 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ abs_builddir = @abs_builddir@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# files and flags
PROGRAMS:=coap-server coap-client rd etsi_iot_01 #tiny
PROGRAMS:=coap-server coap-client rd #etsi_iot_01 tiny
SOURCES:= tiny.c client.c server.c rd.c etsi_iot_01.c
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
#CFLAGS:=-g -Wall -ansi -pedantic -I..
+6 -1
View File
@@ -86,6 +86,7 @@ handle_sigint(int signum) {
void
hnd_get_resource(coap_context_t *ctx, struct coap_resource_t *resource,
const coap_endpoint_t *local_interface,
coap_address_t *peer, coap_pdu_t *request, str *token,
coap_pdu_t *response) {
rd_t *rd = NULL;
@@ -107,6 +108,7 @@ hnd_get_resource(coap_context_t *ctx, struct coap_resource_t *resource,
void
hnd_put_resource(coap_context_t *ctx, struct coap_resource_t *resource,
const coap_endpoint_t *local_interface,
coap_address_t *peer, coap_pdu_t *request, str *token,
coap_pdu_t *response) {
#if 1
@@ -181,6 +183,7 @@ hnd_put_resource(coap_context_t *ctx, struct coap_resource_t *resource,
void
hnd_delete_resource(coap_context_t *ctx, struct coap_resource_t *resource,
const coap_endpoint_t *local_interface,
coap_address_t *peer, coap_pdu_t *request, str *token,
coap_pdu_t *response) {
rd_t *rd = NULL;
@@ -199,6 +202,7 @@ hnd_delete_resource(coap_context_t *ctx, struct coap_resource_t *resource,
void
hnd_get_rd(coap_context_t *ctx, struct coap_resource_t *resource,
const coap_endpoint_t *local_interface,
coap_address_t *peer, coap_pdu_t *request, str *token,
coap_pdu_t *response) {
unsigned char buf[3];
@@ -347,6 +351,7 @@ make_rd(coap_address_t *peer, coap_pdu_t *pdu) {
void
hnd_post_rd(coap_context_t *ctx, struct coap_resource_t *resource,
const coap_endpoint_t *local_interface,
coap_address_t *peer, coap_pdu_t *request, str *token,
coap_pdu_t *response) {
coap_resource_t *r;
@@ -692,7 +697,7 @@ main(int argc, char **argv) {
} else if ( result > 0 ) { /* read from socket */
if ( FD_ISSET( ctx->sockfd, &readfds ) ) {
coap_read( ctx ); /* read received data */
coap_dispatch( ctx ); /* and dispatch PDUs from receivequeue */
/* coap_dispatch( ctx ); /\* and dispatch PDUs from receivequeue *\/ */
}
} else { /* timeout */
/* coap_check_resource_list( ctx ); */