Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cvik/ecoap
Simple CoAP encode/decode library for Erlang.
https://github.com/cvik/ecoap
coap erlang
Last synced: 18 days ago
JSON representation
Simple CoAP encode/decode library for Erlang.
- Host: GitHub
- URL: https://github.com/cvik/ecoap
- Owner: cvik
- Created: 2020-07-12T09:16:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T20:03:59.000Z (over 3 years ago)
- Last Synced: 2024-11-29T09:08:17.497Z (about 1 month ago)
- Topics: coap, erlang
- Language: Erlang
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ecoap - simple coap encode/decode library
CoAP stands for Constrained Application Protocol, which is a Request/Response oriented
binary protocol meant to be used with embedded devices with limited memory (usually KiloBytes,
not Gigabytes).See [RFC7252](https://datatracker.ietf.org/doc/html/rfc7252) for further details.
## example usage
```erlang
1> {ok, Packet} = ecoap:decode(<<68,2,62,111,119,104,82,128,177,49,1,50,1,51,255,100,97,116,97>>).
{ok,#{code => post,msg_id => 15983,
options =>
[{uri_path,<<"1">>},{uri_path,<<"2">>},{uri_path,<<"3">>}], % full path /1/2/3
payload => <<"data">>,
token => <<119,104,82,128>>,
type => confirmable}}2> ecoap:encode(Packet).
{ok,<<68,2,62,111,119,104,82,128,177,49,1,50,1,51,255,
100,97,116,97>>}```