2017-11-07 17:27:09 +00:00
|
|
|
A Quick Introduction to the Erbium (Er) CoAP Engine
|
2013-03-26 12:09:49 +00:00
|
|
|
===================================================
|
|
|
|
|
|
|
|
EXAMPLE FILES
|
|
|
|
-------------
|
|
|
|
|
2017-11-07 17:27:09 +00:00
|
|
|
- coap-example-server.c: A CoAP server example showing how to use the CoAP
|
|
|
|
layer to develop server-side applications.
|
2017-09-01 15:45:50 +00:00
|
|
|
- coap-example-client.c: A CoAP client that polls the /actuators/toggle resource
|
2013-03-26 12:09:49 +00:00
|
|
|
every 10 seconds and cycles through 4 resources on button press (target
|
|
|
|
address is hard-coded).
|
2017-09-01 15:45:50 +00:00
|
|
|
- plugtest-server.c: The server used for draft compliance testing at ETSI
|
2013-06-19 12:53:21 +00:00
|
|
|
IoT CoAP Plugtests. Erbium (Er) participated in Paris, France, March 2012 and
|
2017-11-07 17:27:09 +00:00
|
|
|
Sophia-Antipolis, France, November 2012 (configured for native).
|
2013-03-26 12:09:49 +00:00
|
|
|
|
|
|
|
PRELIMINARIES
|
|
|
|
-------------
|
|
|
|
|
|
|
|
- Get the Copper (Cu) CoAP user-agent from
|
|
|
|
[https://addons.mozilla.org/en-US/firefox/addon/copper-270430](https://addons.mozilla.org/en-US/firefox/addon/copper-270430)
|
|
|
|
|
2017-11-07 17:27:09 +00:00
|
|
|
TMOTE SKY HOWTO
|
|
|
|
---------------
|
2013-03-26 12:09:49 +00:00
|
|
|
|
2018-01-12 15:08:42 +00:00
|
|
|
The CoAP example no longer fits in the limited ROM of the Tmote Sky.
|
|
|
|
Please use a platform with larger ROM instead.
|
2013-03-26 12:09:49 +00:00
|
|
|
|
2017-11-07 17:27:09 +00:00
|
|
|
NATIVE HOWTO
|
|
|
|
------------
|
2013-03-26 12:09:49 +00:00
|
|
|
|
2017-11-07 17:27:09 +00:00
|
|
|
With the target native you can test your CoAP applications without
|
2013-03-26 12:09:49 +00:00
|
|
|
constraints, i.e., with large buffers, debug output, memory protection, etc.
|
2017-11-07 17:27:09 +00:00
|
|
|
The plugtest-server is thought for the native platform, as it requires
|
2013-03-26 12:09:49 +00:00
|
|
|
an 1280-byte IP buffer and 1024-byte blocks.
|
|
|
|
|
2017-11-07 17:27:09 +00:00
|
|
|
make TARGET=native plugtest-server
|
|
|
|
sudo ./plugtest-server.native
|
2013-03-26 12:09:49 +00:00
|
|
|
|
|
|
|
Open new terminal
|
|
|
|
|
2017-11-07 17:27:09 +00:00
|
|
|
make connect-native
|
2013-03-26 12:09:49 +00:00
|
|
|
|
|
|
|
- Start Copper and discover resources at coap://[fdfd::ff:fe00:10]:5683/
|
|
|
|
- You can enable the ETSI Plugtest menu in Copper's preferences
|
|
|
|
|
|
|
|
Under Windows/Cygwin, WPCAP might need a patch in
|
|
|
|
<cygwin>\usr\include\w32api\in6addr.h:
|
|
|
|
|
|
|
|
21,23c21
|
|
|
|
< #ifdef __INSIDE_CYGWIN__
|
|
|
|
< uint32_t __s6_addr32[4];
|
|
|
|
< #endif
|
|
|
|
---
|
|
|
|
> u_int __s6_addr32[4];
|
|
|
|
36d33
|
|
|
|
< #ifdef __INSIDE_CYGWIN__
|
|
|
|
39d35
|
|
|
|
< #endif
|
|
|
|
|
|
|
|
DETAILS
|
|
|
|
-------
|
|
|
|
|
2014-05-15 11:12:22 +00:00
|
|
|
Erbium implements the Proposed Standard of CoAP. Central features are commented
|
2017-09-01 15:45:50 +00:00
|
|
|
in coap-example-server.c. In general, coap supports:
|
2013-03-26 12:09:49 +00:00
|
|
|
|
2014-05-15 11:12:22 +00:00
|
|
|
- All draft-18 header options
|
2013-03-26 12:09:49 +00:00
|
|
|
- CON Retransmissions (note COAP_MAX_OPEN_TRANSACTIONS)
|
2017-11-07 17:27:09 +00:00
|
|
|
- Blockwise Transfers (note COAP_MAX_CHUNK_SIZE, see plugtest-server.c for
|
2013-03-26 12:09:49 +00:00
|
|
|
Block1 uploads)
|
|
|
|
- Separate Responses (no rest_set_pre_handler() required anymore, note
|
|
|
|
coap_separate_accept(), _reject(), and _resume())
|
|
|
|
- Resource Discovery
|
2018-01-12 15:08:42 +00:00
|
|
|
- Observing Resources (see EVENT_ and PERIODIC_RESOURCE, note
|
2013-03-26 12:09:49 +00:00
|
|
|
COAP_MAX_OBSERVERS)
|
|
|
|
|
|
|
|
TODOs
|
|
|
|
-----
|
|
|
|
|
|
|
|
- Dedicated Observe buffers
|
|
|
|
- Optimize message struct variable access (directly access struct without copying)
|
|
|
|
- Observe client
|
|
|
|
- Multiple If-Match ETags
|
|
|
|
- (Message deduplication)
|