According to the Core Resource directory draft [1]. The discovery of the registration should be done using the /.well-known/core and including a Resource Type (rt) with the value "core.rd". Like that:
GET /.well-known/core?rt=core.rd
There is a typo in the libcoap which accept the "core-rd" instead of the "core.rd" parameter. Fixing that in this version.
[1] - https://tools.ietf.org/html/draft-ietf-core-resource-directory-05#section-5.1
uip_ds6_prefix_add is using 6 arguments, better use explicit argument
list than let the compiler decide. Some compiler will complain if some
optionally arguments are missed.
The options --disable-documentation and --disable-examples did
not have the desired effect in some configurations. Now, if any
of documentation or examples is disabled, the manual pages in
the examples folder are not created.
Two new flags COAP_RESOURCE_FLAGS_NOTIFY_NON and
COAP_RESOURCE_FLAGS_NOTIFY_CON have been added to control the
message type for notifications to send. The default type is
COAP_RESOURCE_FLAGS_NOTIFY_NON which can be changed with the
function coap_resource_set_mode().
The observer-specific flag has been removed.
Baptiste Clenet <bapclenet@gmail.com> has pointed out that passing
an empty string causes address resolution to fail in certain cases.
This modification replaces the service parameter in the getaddrinfo
call with NULL as suggested.
The previous commit added some asciidoc based man pages that need a2x
from the asciidoc package. To ensure the build will not break due a not
available a2x binary we better check before.
This commmit adds the build of man pages for the binaries from the
example/ folder, in detail these are coap-client.5, coap-rd.5 and
coap-server.5.
The source of the man pages is written in asciidoc so the build
environment must have access to a installed asciidoc package.
To normalize (and in preparation for manpages) the currently used files
for the example implementation of a CoAP based client, server and a
resource directory various files and variables are rename to coap-*.
With commit cda3b72 the migration to a fully Autotools controled build
environment was started which is now finished. The previous used *.in
files was renamed to *.in.old to hold some maybe usefull informations
from the old system. We don't need this renamed files any longer so kill
it with fire.
The build of the examples is complaining about a function that are not
inline'd. The compiler is mentioned this because we use the '-I'
directive for pointing to the header files. Just say the compiler also
that the header files are system headers so the false positive is going
away.
For POSIX, coap_tick_t is defined as unsigned long to support
timestamps in wallclock time. The rd uses ticks to make node
identifiers locally unique. As this is just one part of the
generated identifier, the timestamp's lower 32 bits are
sufficient.
After including the doc/ and the tests/ folder under the hood of the
autotools now adding the examples/ foolder too.
The user is now able to add the build of the example binarys if
configure is called with '--enable-examples' as option. The example
binarys will not be build by default!
Currently only 'coap-client', 'coap-server' and 'rd' is build.
* Removed tne preprocessor defines for coap_tick() and coap_clock_init() --
this made the code less readable and seemed to be of little use.
* Introduced the new type coap_time_t to represent wall clock time. On POSIX,
this is the number of seconds since the epoch, while on embedded systems
without a real time clock, this could be the number of seconds since the
last reboot. The new function coap_ticks_to_rt() is used to convert
coap_tick_t to coap_time.h. Currently, this is a division by COAP_TICKS_PER_SECOND
on all platforms.
* POSIX: coap_tick_t is now defined as unsigned long to avoid overflows in
coap_ticks().
The helper functions decode_segment() and check_segment() are private
functions in uri.c and thus should not be accessible from outside. For
simplicity, these functions have been copied to client.c.
Made vpath %.c point to ../../src and repaired include path.
The common part of the Makefile has been moved to Makefile.common
to leverage Makefile creation for other platforms such as econotag.
coap_insert() now appends every item at the list's end, sorting must
be done explicitly using LL_SORT. As a side-effect, the new
implementation makes valgrind happy :-)
Directory examples/contiki now contains a small example server for
Contiki and a Makefile for platform minimal-net.
Build:
make contiki # clones Contiki
make server # creates the minimal-net coap server
Run:
Unfortunately, you have to run the server with sudo unless you
set CAP_NET_ADMIN for both, the server executable, and ifconfig
(sudo setcap cap_net_admin+pei ...).
sudo ./server
Then, add the server's interface address to the tap0 device and
optionally set a default route:
sudo ip -6 a a aaaa::1000 dev tap0
sudo ip -6 r a aaaa::/64 dev tap0
Although everything should work now, it does not. I had to send
router advertisements on tap0:
sudo radvd -C ./radvd.conf
Note that on Debian (and Ubuntu, and ...), radvd will not start
when IPv6 forwarding is disabled (which is usually the case on
end systems). Trying to enable like this did not work for me:
sudo sysctl -w net.ipv6.conf.tap0.forwarding=1
sudo sysctl -w net.ipv6.conf.tap0.mc_forwarding=1
Workaround (ugly): get the radvd sources, compile them and use that.
* resolve file resolution conflicts between lwip and libcoap in favor of
lwip by rearranging the makefile
* cover the config.h of a configured base libcoap with the local one
using the deprecated -I- gcc switch
* enable etharp (no idea why it wouldn't work ootb, the complete
server.c lwip-contrib copy needs to be reviewed)
* disable optimizations for easier debugging, enable -g3 for macro
expansions
This change contains a quick and dirty workaround for the following
bug that has been reported by Andrea Azzarà:
"When sending a file with a POST to a CoAP server, such as
./coap-client -m post coap://vs0.inf.ethz.ch:5683/large-create/ -b 64
-t 0 -f test
the M bit is not correctly set to 1."