Commit Graph
185 Commits
Author SHA1 Message Date
Olaf Bergmann 2c36cf4ade client.c: fixed malformed mode-line 2016-09-22 12:41:19 +02:00
chrysn d43d92e40b examples/lwip: depend on coap.h
The handcrafted Makefile will not attempt to build the coap.h, but will
indicate to the user how to generate it.
2016-06-22 12:51:46 +02:00
chrysn 6b6840599a lwip: cleanups of leftover variables and similar compiler warnings
note on coap_read removal: as the lwip implementation currently launches
the package handling right from the recv callback, a coap_read function
is not meaningful (as it is in posix or contiki where it actively
fetches the messages from the network buffer).
2016-06-22 12:38:01 +02:00
chrysn 909d863a4e lwip: Use latest version
This drops the cumbersome mintapif mechanisms from server.c, fixes
header troubles that have popped up probably during the header cleanups,
drops old workarounds and enables IPv6.
2016-06-22 12:37:27 +02:00
Olaf Bergmann 392deff2d7 Makefile.contiki: Added -Os to remove undefined symbol
handle_periodic_timer() in rpl-timers.c relies on the optimizer to
remove the if(0)-guarded call to rpl_ns_periodic() when storing
mode is selected. This does not happen with clang's default options
and thus leads to an error for the undefined reference at link time.

This modification adds -Os to fix this.
2016-06-10 16:41:53 +02:00
Olaf Bergmann 68d910f4fe examples/contiki/Makefile: use --depth 1 for cloning Contiki
This change avoids cloning the entire Contiki history when building
the Contiki server example.
2016-06-10 15:10:02 +02:00
Olaf Bergmann a267d3a2b0 server.c: fixed Contiki-related debug functions
The debug function for printing lladdress have been renamed and moved
to net-debug.h. This change now includes this header and uses the
appropriate macros instead.
2016-06-10 15:07:25 +02:00
Olaf Bergmann 6bf7cdcc45 examples/lwip/Makefile: fixed lwip branch
This example now uses LwIP release 1.4.1 as the devel branch seems
to have disappeared from the git repository. Moreover, we just do
a shallow clone so maybe the server does not kick us that often.
2016-02-16 16:22:45 +01:00
Olaf Bergmann 0afbf5ecba examples/lwip/Makefile: fixed lwip build flags
Since configure does not set WITH_LWIP, we need to tell the compiler.
This change also replaces the deprecated -I. -I- by -iquote.
2016-02-16 15:13:52 +01:00
Olaf Bergmann 0f062e557e Makefile: fixed build infrastructure for Contiki examples
The new structure of libcoap allows to clone Contiki in a
subdirectory. The example build now uses Makefile to first clone
Contiki and then invoke Makefile.contiki for the actual build.
The TARGET is set to minimal-net by default but can be changed to
any other (tested) target.
2016-02-16 14:19:11 +01:00
Olaf Bergmann 4c299f9da6 Makefile.contiki: Fixed build flags for Contiki-3.0
Some configuration flags have been changed since Contiki version 3.
The Makefile.contiki for building a server example that uses libcoap
as a Contiki app has been fixed. The following builds now succeed:

make -f Makefile.contiki TARGET=minimal-net
make -f Makefile.contiki TARGET=econotag
make -f Makefile.contiki TARGET=mbxxx
2016-02-16 13:12:26 +01:00
onovo1 fe69ba5fb6 Update coap-rd.c
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
2016-01-28 10:34:14 +02:00
Olaf Bergmann 7452d7d50f coap-server.c: updated URI to libcoap's homepage in resource '/' 2016-01-10 18:06:26 +01:00
Carsten Schoenert b4973f1d73 fixup argument list for uip_ds6_prefix_add
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.
2016-01-10 17:49:07 +01:00
Olaf Bergmann 2da31de732 configure.ac: fix disable options
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.
2015-09-30 19:46:34 +02:00
Olaf Bergmann 683337890e bugfix: add flag for CON/NON notification messages
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.
2015-09-29 09:03:18 +02:00
Olaf Bergmann 7f2134db6f client.c: fixed empty service parameter in getaddrinfo call
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.
2015-09-08 18:06:03 +02:00
Carsten Schoenert 141eefdbb6 a2x: adding a check for needed helper
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.
2015-06-22 21:25:43 +02:00
Carsten Schoenert 3e9afb1460 examples/*: adding example binaries man page support
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.
2015-06-22 21:25:43 +02:00
Carsten Schoenert cb55cb44da examples/*coap-client*: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-06-19 20:54:31 +02:00
Carsten Schoenert 60bb15edd7 examples/coap-server.c: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-06-19 20:54:31 +02:00
Carsten Schoenert bda1a2360b examples/coap-rd.c: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-06-19 20:54:30 +02:00
Carsten Schoenert 1043892391 rename the example binaries to more strict naming schema
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-*.
2015-06-19 20:53:47 +02:00
Carsten Schoenert f0f271778f drop previous renamed *.in files
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.
2015-06-19 20:52:47 +02:00
Olaf Bergmann ee931e8f37 examples/client.c: Removed multicast join
As the client can send to multicast groups without explicitly joining,
this code is not required here and instead moved to the server
implementation.
2015-06-10 18:10:43 +02:00
Olaf Bergmann b9bcdc10ff examples/server.c: added flag -g to join multicast groups
This code is taken from client.c where it makes no sense.

TODO: leave group when the server is stopped.
2015-06-10 18:08:33 +02:00
Carsten Schoenert 21431bcb2f examples/Makefile.am: small fix for the path declaration 2015-06-02 20:41:37 +02:00
Carsten Schoenert 47e0c25c38 examples/Makefile.am: changing header includes
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.
2015-03-22 14:38:36 +01:00
Carsten Schoenert da3570cb41 examples/Makefile.am: fix not needed target
The target 'install-exec-am' is obviosly wrong and not really needed.
2015-03-22 13:37:28 +01:00
Olaf Bergmann d9d20d906b rd.c: Fixed type-specifier warning
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.
2015-03-12 13:05:56 +01:00
Olaf Bergmann 41e3247c9b rd.c: Fixed a bunch of compiler warnings 2015-03-12 12:30:57 +01:00
Carsten Schoenert 60030d0fb4 examples: adding the examples folder to the build
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.
2015-03-12 11:25:26 +01:00
Olaf Bergmann d55bd85e14 examples/contiki/server.c: Define clock_offset locally
The global variable clock_offset has been removed from libcoap, so
we have to define our own.
2015-03-11 14:37:18 +01:00
Olaf Bergmann f1b36046f2 Contiki: Make sure that COAP_RESOURCES_NOHASH is defined 2015-03-11 14:34:06 +01:00
Olaf Bergmann b9adebec93 client.c: Fixed signed/unsigned in comparisons 2015-03-10 13:47:38 +01:00
Olaf Bergmann 005d00bf5b client.c: Declare unused parameters to make -Wunused quiet 2015-03-10 13:42:40 +01:00
Olaf Bergmann 445849d5ba client.c: Made private functions static to quiet compiler warnings 2015-03-10 13:41:02 +01:00
Olaf Bergmann c38a6d9ca4 Made private functions static to quiet compiler warnings 2015-03-10 13:25:08 +01:00
Olaf Bergmann 9b1ab5eef3 server.c: Declare unused parameters to make -Wunused quiet 2015-03-10 13:06:03 +01:00
Olaf Bergmann 4ca91190d6 Revised time-related functions to get rid of clock_offset for POSIX platform.
* 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().
2015-03-08 15:14:43 +01:00
Olaf Bergmann a31981b95b Implement decode_segment() and check_segment(), LWS cleanup
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.
2015-03-08 15:09:22 +01:00
Olaf Bergmann 78b96e606d Fix lwip example 2015-03-03 22:03:37 +01:00
Olaf Bergmann 124d871cc8 Fixed path to source and header path
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.
2015-03-03 21:53:26 +01:00
Olaf Bergmann 8d664dd475 Fixed Contiki-specific Makefile 2015-03-03 12:30:42 +01:00
Olaf Bergmann 9d673c8cfd moved platform-specific Makefile.contiki into examples/contiki 2015-03-03 12:30:42 +01:00
Olaf Bergmann 7e300c04d9 fix CoAP RFC number in comments 2015-03-03 12:29:13 +01:00
Olaf Bergmann a81a37b29d bugfix: CLIENT_OBJS in Makefile.in unknown
This variable has been renamed to client_OBJECTS but the change was
missing in target coap-client.
2015-02-21 16:32:35 +01:00
Olaf Bergmann aa3a050641 Replaced custom list implementation with linked lists from utlist.h
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 :-)
2015-02-20 13:30:32 +01:00
Olaf Bergmann f4f4ffd900 Moved coap_list.[hc] to examples
The list implementation in coap_list.c is only used in client.c
hence it was moved into the examples sub-directory.
2015-02-20 13:10:04 +01:00
Olaf Bergmann b87f45eeb2 remove unused code from Contiki server example 2015-02-16 17:04:57 +01:00