Commit Graph
474 Commits
Author SHA1 Message Date
Olaf Bergmann 143597a71d Improved logging function for Contiki.
Use vprintf() for log output when HAVE_VPRINTF is defined. Otherwise,
PRINTF will be used which does not work together with va_args.
2014-06-19 00:11:16 +02:00
Olaf Bergmann 77183cdc48 Use type tag in coap_free_type(). 2014-06-18 23:35:19 +02:00
Olaf Bergmann 6dcf3c7128 added header include for size_t 2014-06-18 18:52:25 +02:00
Olaf Bergmann 0f0169ee24 suppress gnu compiler warning on unused parameter 2014-06-18 18:51:59 +02:00
Olaf Bergmann c77c3cda32 fixed coap_iterator_next() to work on utlist structure. 2014-06-18 18:50:44 +02:00
Olaf Bergmann e90be63294 changed type of m and szx in coap_block_t back to unsigned int.
This is a partial revert of commit 4f6a7f5db to avoid compiler-specific
code.
2014-06-18 18:48:37 +02:00
Olaf Bergmann 4146735548 bugfix: use header format from coap-17 in hnd_get_time() 2014-06-18 18:31:50 +02:00
Olaf Bergmann 3d3e2a11d6 definitions for Contiki platform minimal-net 2014-06-18 18:30:13 +02:00
Olaf Bergmann 978577c686 Use a generalized iterator to walk through resources. 2014-06-18 18:28:57 +02:00
Olaf Bergmann 4882cc1caf added missing includes for debug.h and assert.h 2014-06-18 18:28:13 +02:00
Olaf Bergmann e6047eddb2 More code cleanup for Contiki.
coap_cancel() now uses the new resource_iterator.
2014-06-18 18:26:41 +02:00
Olaf Bergmann 68947e5e36 code cleanup for Contiki 2014-06-18 16:50:31 +02:00
Olaf Bergmann 4f6a7f5dbf Replaced bit field for data from block header by unsigned int.
Usually, the block number can grow to 20 bits which is not
guaranteed to fit in a single unsigned int. To avoid compilers
(especially msp430-gcc) complaining about the width of the used
bit field, the type for num has been changed to unsigned int
hence restricting the number of acceptable blocks to 65536 on
those platforms. (No bounds check is done yet.)

m and szx now share a uint8_t.
2014-06-18 16:43:32 +02:00
Olaf Bergmann ebc4eaccee quick fixes for Contiki platforms sky and wismote 2014-06-18 16:43:06 +02:00
Olaf Bergmann 302944cb76 bugfix: call coap_free() instead of free() 2014-06-18 16:41:49 +02:00
Olaf Bergmann 89186909da updated Changelog and Makefiles for new mem.c 2014-06-18 16:41:17 +02:00
Olaf Bergmann 0d78eab2e1 Some small additions for combined memory management.
Two new functions coap_malloc_type() and coap_free_type() have been
added to centralize the typed memory allocation for Contiki and LWIP.
Currently, calls to memb_alloc(), memp_malloc() and coap_malloc() are
distributed across several modules. The idea of the new functions is
to centralize memory management in one place (mem.c). coap_malloc()
and coap_free() are still available as wrappers for the new functions.
2014-06-18 16:30:07 +02:00
Maciej Wasilak 3d66bbb8e3 Fix message handler for client example
Fix 2 bugs in message handler:
- problem with sending confirmable next block requests
- problem with deleting pdu after sending
2014-06-17 18:33:05 +02:00
Olaf Bergmann a3fae3ce3a Support cancellation of observe relationships using GET w/ Observe: 1.
Adding and removal of observes is now handled by libcoap. The application's
GET handler only needs to add the Observe option (see server.c:hnd_get_time()).
2014-03-09 02:27:52 +00:00
Olaf Bergmann 1b3aa704e6 Do not restrict writing of block option to Block2, only.
Note that coap_write_block_opt() is not very useful for Block1 as
it sets the M bit according to the data length and block number.
2014-03-06 15:43:00 +00:00
Olaf Bergmann 37699fd058 Cancel retransmission of messages when response has arrived.
In case the ACK of a separate message is lost, the request would be
retransmitted until the maximum number of transmissions is reached because
the response usually has a different messsage id. The matching at this
point is done based on the response's source address and token.
2014-03-06 15:38:37 +00:00
Olaf Bergmann ed9c7ee560 bugfix: #25 async example creates short packet
Increased packet size by 5.
2014-02-25 19:15:52 +01:00
Olaf Bergmann e2dfed6035 bugfix: #24 Empty ACK improperly includes Token
Included the patch proposed by tbahls to fix this issue. Now, the
ACK message is always truncated to its bare header when the message code
is 0.00.
2014-02-25 19:03:25 +01:00
Olaf Bergmann 909cccd05d Support for response code 7.31 to cancel observation relationships.
This new behavior is described in Section 4.6 of draft-ietf-core-observe-12.
The idea is to send a response with code 7.31 and the token to identify
the subscription.
2014-02-25 19:00:10 +01:00
Olaf Bergmann 2c96f39e31 Always acknowledge confirmable responses.
Instead of letting the receipient acknowledge a confirmable response in
its custom response handler, this is now done automatically.
2014-02-25 17:14:10 +01:00
Olaf Bergmann 122200d3fd Defined two functions that return the library name and version string. 2014-02-18 13:38:34 +01:00
Olaf Bergmann ef41ce5d02 improved install target 2014-02-05 18:04:31 +01:00
Hung Le db3794b855 Added target install recipe to Makefile 2014-02-05 15:38:34 +01:00
Olaf Bergmann 6e293342f6 Updated version number after merging with branch relative-timestamps.
The branch was not included in release 4.1.0 by error.
v4.1.1 v4_1_1
2014-02-05 15:20:53 +01:00
Olaf Bergmann 9e25cd26cb merged with branch relative-timestamps 2014-02-05 15:08:37 +01:00
Olaf Bergmann 652bdd5f63 resolved conflict after cherry-picking from branch relative-timestamps 2014-02-05 15:04:39 +01:00
Olaf Bergmann a4358bd2ce added tests for relative timestamps 2014-02-05 14:53:58 +01:00
Olaf Bergmann 160f570c6f include tests with distribution 2014-02-04 18:15:26 +01:00
Olaf Bergmann 46a107dbcd update 2014-02-04 17:58:08 +01:00
Olaf Bergmann 660deefe73 Support for block-wise transfer of /.well-known/core. 2014-02-04 17:56:31 +01:00
Olaf Bergmann a3a17fcb1d use coap_opt_block_num() instead of COAP_OPT_BLOCK_NUM 2014-02-04 17:55:56 +01:00
Olaf Bergmann b5fe35646b Fixed handling of zero-length options in COAP_OPT_BLOCK_LAST macro.
The macro did not respect zero-length option values hence a pointer
to the option byte itself was returned. This macro now returns NULL
for zero-length option values. Macros and functions that use this
macro have been updated accordingly. COAP_OPT_BLOCK_NUM has been
replaced by the function coap_opt_block_num().
2014-02-04 17:50:35 +01:00
Olaf Bergmann a391c9e9cb Fixed delta for Accept option.
The number has changed from 16 to 17 in coap-18.
2014-02-04 17:48:45 +01:00
Olaf Bergmann f37ec9654e (Yet incomplete) support for block-wise transfer of .well-known/core.
The function wellknown_response() now honors a Block2 option when present
in the request or adds a new Block2 option to the response when the resource
description does not fit.

Bug: get_wkc_len() currently returns a hard-coded value instead of calculating
the size of the resource description (which requires changes in resource.c).
2014-01-07 23:41:15 +01:00
Olaf Bergmann 05713f48e8 Unit tests for the new functionality of coap_print_link() and print_wellknown() 2014-01-07 17:37:49 +01:00
Olaf Bergmann 591aa06783 Support for partial output of .well-known/core
This change provides basic support for block-wise transfer of resource
descriptions. print_wellknown() now takes an additional parameter that
specifies the offset in the resource description where output shall start.
coap_print_link() has been modified to truncate resource descriptions that
do not fit in the given buffer (instead of failing with an error code as
was the case before).
2014-01-07 17:33:49 +01:00
Olaf Bergmann 78794d3385 bugfix: wrong calculation of written bytes in .well-known/core payload 2014-01-03 16:18:27 +01:00
Dag Björklund c234833d16 renaming parameters named list, as there is a struct named list, and for c++ list and struct list is the same
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
2013-12-30 01:18:22 +01:00
Olaf Bergmann 3f69cd1e9b Use log levels from syslog.h when available.
Thanks to Dag Björklund for pointing this out.
2013-12-30 01:15:11 +01:00
Olaf Bergmann 2d57017540 removed comment 2013-12-30 01:05:18 +01:00
Dag Björklund 07065b3d1f adding extern C to make libcoap c++ compilable
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
2013-12-30 01:02:58 +01:00
Dag Björklund 85ea3eebc7 Only requiring an observervable resource to have a GET handler, if it is in fact an observable resource
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
2013-12-30 00:50:45 +01:00
Olaf Bergmann b966a0c834 increased minor version number for LWIP port 2013-12-30 00:29:06 +01:00
Olaf Bergmann 9e99ad975b Merged with LWIP port from chrysn, see <https://git.gitorious.org/coap-lwip/coap-lwip.git>
This introduces new compiler flags WITH_POSIX and WITH_LWIP to
distinguish target platforms.
coap-lwip
2013-12-23 12:16:27 +01:00
chrysn af2096a047 add coap to the lwip example 2013-12-09 15:38:55 +01:00