Bluetooth Low Energy host stack in pure OCaml
0

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 87.8%
C 4.8%
Python 3.4%
C++ 0.6%
Dune 0.5%
Shell 0.2%
Roff 0.1%
Other 2.6%
69 1 0

Clone this repository

https://git.vm.fail/gazagnaire.org/ocaml-bluetooth https://git.vm.fail/did:plc:b57bjsuf7ru4ot5vc4pu6urg
ssh://git@git.recoil.org:2222/gazagnaire.org/ocaml-bluetooth ssh://git@git.recoil.org:2222/did:plc:b57bjsuf7ru4ot5vc4pu6urg

For self-hosted knots, clone URLs may differ based on your setup.


README.md

bluetooth#

A Bluetooth Low Energy (BLE) host stack in pure OCaml.

The radio is a separate controller (an external chip) reached over HCI. This package implements everything above the HCI wire, as a set of I/O-free sublibraries built on the wire codec DSL:

  • bluetooth.types -- shared value types: 16/32/128-bit UUIDs, 48-bit device addresses (BD_ADDR), and the AD/EIR advertising-data codec.

The HCI, L2CAP, ATT, GATT, SMP, and GAP layers land as further sublibraries; a separate bluetooth-eio package binds the stack to a transport.

Example#

$ opam install bluetooth

A 16-bit UUID expands to a full 128-bit value through the Bluetooth Base UUID:

# let u = Bluetooth_types.Uuid.of_uuid16 0x180F in
  String.length (Bluetooth_types.Uuid.to_uuid128 u)
- : int = 16

Scope#

BLE only, both roles (Central and Peripheral). Classic Bluetooth (SDP, RFCOMM, audio profiles) is out of scope.