aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-12-13 17:47:14 +0100
committerGuido Günther <agx@sigxcpu.org>2015-12-13 17:47:14 +0100
commitbd3ae9694c0e8669c8ce53aef685e8afede14f33 (patch)
treee849857832827f7be9a3166932bae7fe749fc84a /include
Initial commitHEADmaster
Diffstat (limited to 'include')
-rw-r--r--include/coaperl.hrl52
-rw-r--r--include/corerl.hrl8
2 files changed, 60 insertions, 0 deletions
diff --git a/include/coaperl.hrl b/include/coaperl.hrl
new file mode 100644
index 0000000..be3b0f1
--- /dev/null
+++ b/include/coaperl.hrl
@@ -0,0 +1,52 @@
+
+% RFC7252, Section 12.2
+% 0 (Reserved)
+% 1 if-match
+% 3 uri-host
+% 4 eTag
+% 5 if-none-match
+% 7 uri-port
+% 8 location-path
+-define(COAP_OPTION_URI_PATH, 11).
+-define(COAP_OPTION_CONTENT_FORMAT, 12).
+% 14 max-age
+-define(COAP_OPTION_URI_QUERY, 15).
+% 17 accept
+% 20 location-query
+% 35 proxy-uri
+% 39 proxy-scheme
+% 60 size1
+%128 (Reserved)
+%132 (Reserved)
+%136 (Reserved)
+%140 (Reserved)
+
+% draft-ietf-core-block-17
+-define(COAP_OPTION_BLOCK2, 23).
+-define(COAP_OPTION_BLOCK1, 27).
+-define(COAP_OPTION_SIZE2, 28).
+
+-define(COAP_PAYLOAD_MARKER, 16#FF).
+
+-record(coap_request, {
+ method,
+ path,
+ query,
+ mid,
+ ct,
+ payload
+ }).
+
+-record(coap_response, {
+ class, % response class
+ detail, % repsonse detail
+ mid, % the meassage id
+ ct, % the content type
+ block2, % block2 option
+ options, % all coap options
+ payload}).
+% 2.01 Location-Path, Location-Query
+% 2.03 ETag, Max-Age
+% 4.13 Size1
+
+-record(coap_empty_message, {mid}).
diff --git a/include/corerl.hrl b/include/corerl.hrl
new file mode 100644
index 0000000..80b93ba
--- /dev/null
+++ b/include/corerl.hrl
@@ -0,0 +1,8 @@
+
+-record(core_link, {uri,
+ title,
+ sz, % size
+ rt, % resouce type
+ ct, % content type
+ 'if' % interface
+ }).