matter#
Matter protocol implementation for OCaml.
Overview#
This library provides an implementation of the Matter smart home protocol as specified in the Matter Core Specification.
Features#
- TLV (Tag-Length-Value) encoding and decoding
- Support for all Matter TLV types: integers, booleans, floats, strings, bytes, null
- Nested containers: structures, arrays, lists
- All tag forms: anonymous, context-specific, common/implicit profile, fully-qualified
Installation#
opam install matter
Usage#
open Matter.Tlv
(* Create elements *)
let elem = structure [
ctx_int 1 42;
ctx_string 2 "hello";
ctx_bool 3 true;
]
(* Encode to binary *)
let binary = encode_one elem
(* Decode from binary *)
match decode binary with
| Ok elements -> (* process elements *)
| Error msg -> (* handle error *)
API#
TLV Module#
Matter.Tlv.encode- Encode elements to binary TLVMatter.Tlv.decode- Decode binary TLV to elementsMatter.Tlv.int,uint,bool,string,bytes,null- Value constructorsMatter.Tlv.structure,array,list- Container constructorsMatter.Tlv.ctx_int,ctx_uint, etc. - Context-tagged constructors
Related Work#
Licence#
MIT License. See LICENSE.md for details.