When TESTS=yes is given, the scripts invokes the test driver from
the top build directory. Platform-specific actions hence must ensure
that they stay in that directory and keep the last exit code.
The build script invokes configure and make with different
parameters depending on the environment variables PLATFORM
and TESTS. PLATFORM currently must be one of 'posix', 'contiki', or
'lwip'. If TESTS is set to 'yes' or 'true', the option --enable-tests
will be passed to configure and tests/testdriver will be invoked
after configuration and make.
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.
COAP_MAX_BLOCK_SZX is defined to "2" already before a define rule for
CONTIKI_TARGET_CC2538DK, just add a simply undefine line before the
redefine of COAP_MAX_BLOCK_SZX to make the compiler happy.
After splitting of the platform header part within libcoap some source
files that use functions of the network stack need to include coap.h
(which is including the libcoap.h) to get the platform specific header file
for the network stack.
Sort list of included headers in alphabetical order.
To get a proper public header setup for libcoap we need to split out the
static and platform related header files.
This commit is about creating the platform specific header file which
have to contain platform relevant header and or declarations and is
included by the coap.h header file.
Currently there is only Contiki as non Linux/BSD based platform we have
to take care. Potentially there is more to come.
Resume the cleaning of the public header files, no functional changes.
Reformatting the infos in the head of the header files, restructure header
inclusion check to be more generic. Reorder some include directives in a
alphabetical order. Remove including instructions for C++ stuff, it's
already done in the coap.h header, and the user only has to include this
header file.
Dropping the prefixing of the include guarding of uthash.h because it would
cause trouble with the macro handling in TinyDLS.
Thanks Olaf for reminding this!
The various variable checks within the public header files are not
useful as such checks doesn't have to be done in these files.
The public header files have only to provide the function declarations
and some macro definitions, any check for the availability of needed
other system header files has to be done by the user on his own.
TODO: The check for syslog.h in debug.h has to be moved out of the
public part into the source of the library later.
This fixes a bug reported by Daniel Petrie:
"When the coap-client is used and a local address to bind to is
specified, but the local port is not specified, I get errors for the
response coming in from an unexpected interface and the response is
dropped/ignored."
The solution here is to call getsockname() after successful bind()
in coap_new_endpoint() to set ep->addr to the actual transport
address being used.
The limitation of COAP_OPT_FILTER_SHORT to six entries made the
critical option check fail e.g. for Block2. This change hard-codes
the built-in critical options in coap_option_check_critical() so
that up to COAP_OPT_FILTER_SHORT short options and COAP_OPT_FILTER_LONG
long options can be registered dynamically.
Please note that registering critical options that are already known
(i.e. listed in pdu.h and checked in coap_option_check_critical())
is a waste of storage space.
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 testdriver was linked against the statically generated library of
libcoap. By this the testdriver will *always* find any symbols, no
matter if it is a private or public symbol.
Due this the testing behavior isn't the same as a user would use the
shared library and can get a potentially pitfall even if the testdriver
was successful.
Due previous changes to the public header the testdriver source needs
now the local header coap_config.h to find all needed functions so there
are small changes needed to the source files.
The public header doesn't have to include a local dynamically created
header file from the autotools. This would break the usability of the
public header files.
Commit 1baa816 moved the implementation of coap_clock_init() and
coap_ticks_to_rt() to coap_time.c. This commit updates the public
API of the shared lib accordingly.
For POSIX platforms, ticks have been absolute which caused an
overflow on 32-bit architectures. This modification makes values
returned by coap_ticks() relative to a global offset stored
internally in coap_clock_offset.
A2X is explicitly declared with AC_ARG_VAR to allow users to pass
a custom value to configure. Thus, users who do not have a2x
installed can invoke
A2X=/bin/true ./configure --enable-examples
to prevent configure stopping on the a2x check.
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-*.
The pkg-config file is now named libcoap-1.pc and was forgotten to
change too in autogen.sh while changing the API versioning within the
commits 1ea9e1c and 24a83b7.
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.
is_local_if() checks if a message's destination address matches
a local interface. As multicast requests are allowed on either
interface, this function now returns true when the destination
address is a multicast address.