Partial CoAP porting to Erlang