Skip to content

devage/coaper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

coaper

CoAP implementation in erlang. Currently CoAP packet parser/generater is only available.

How to Use

First clone this repository.

$ git clone https://github.com/devage/coaper.git

Then run erl and test this code.

$ cd src
$ erl
  ...
1> c(coap).
2> rr(coap).
3> coap:parse(iolist_to_binary(coap:packit(
3> #coap_msg{ type=con, tkl=1, code=get, mid=16#1234, token=[16#01],
3> options=[#coap_opt{type='uri-path', value="test"}] }))).

The content inside #coap_msg{} record means CON GET /test [0x1234] and its token is 0x01. And the following is the result.

#coap_msg{uri = undefined,delta = 11,ver = 1,type = con,
          tkl = 1,code = get,mid = 4660,
          token = [1],
          options = [#coap_opt{type = 'uri-path',value = "test"}],
          payload = undefined}

To Do

About

CoAP implementation in Erlang.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages