Skip to content

Commit 950dc66

Browse files
committed
Add HTTP and CoAP mapping draft
1 parent 6112e67 commit 950dc66

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

docs/.vuepress/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ module.exports = {
5555
'3b_can',
5656
'3c_lora'
5757
]
58+
},{
59+
title: 'Protocol Mapping',
60+
collapsable: false,
61+
children: [
62+
'4a_http',
63+
'4b_coap'
64+
]
5865
}],
5966
'/v0.2/': [{
6067
title: 'Why ThingSet?',

docs/4a_http.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: "HTTP"
3+
---
4+
5+
# ThingSet to HTTP mapping
6+
7+
::: warning
8+
This part of the protocol specification is still work in progress.
9+
:::
10+
11+
## Key concepts
12+
13+
ThingSet is developed for point-to-point connections or small local networks, but the protocol functions were developed such that they can be easily integrated into larger networks or the internet using an HTTP gateway.
14+
15+
Many web applications interact using JSON APIs (sometimes in a RESTful way), so the compatibility with JSON web APIs is an important feature of the ThingSet protocol.
16+
17+
In order to reduce the complexity of the protocol, the features offered by HTTP were reduced:
18+
19+
- Convention over configuration
20+
- Only two content-types JSON and CBOR are supported. They are detected automatically and no content-type header is needed.
21+
- Predefined URI layout matching the data structure.
22+
- Unit of data objects stored in the name (key) of a map, so the required amount of nesting in the JSON data structure is limited to categories only.
23+
24+
The response codes of ThingSet are aligned with CoAP and thus also allow a simple translation to HTTP. The main difference is that HTTP doesn't allow to indicate successful requests as fine-grained as CoAP, so the status will be mostly 200 OK or 204 No Content.

docs/4b_coap.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: "CoAP"
3+
---
4+
5+
# ThingSet to CoAP mapping
6+
7+
::: warning
8+
This part of the protocol specification is still work in progress.
9+
:::
10+
11+
## Key concepts
12+
13+
ThingSet uses only a subset of CoAPs features in order to make it more simple and compact:
14+
15+
- Mapping to CoAP message types:
16+
- ThingSet requests are always CON
17+
- Only publication messages are NON
18+
- No dedicated ACK, the response must also contain data (only piggybacked responses)
19+
- RST needed? probably not...
20+
- No message IDs: Synchronous communication necessary
21+
- PUT request is not supported. Use POST to create a resource and iPATCH to update it.
22+
- PATCH requests are always idempotent, i.e. only iPATCH is supported
23+
24+
The binary function codes of ThingSet are the same as CoAP method codes. The status codes are also aligned, but contain an offset as explained before.

0 commit comments

Comments
 (0)