bbangert

bbangert

I’ve been working on some Elixir based projects for awhile now, slowly spinning out libraries from the project as they stabilize some and thought this one might be useful for the community. My project is Nerves based and needed bluetooth support, so I originally tried blue_heron, then evaluated whether Bluex had the support I needed, but eventually ended up building this out with claude.

Features

  • One supervisor that brings up dbus-daemon, bluetoothd -E, and (optionally) bluealsad, with crash-isolation and restart ordering (:rest_for_one) already worked out — an audio fault never restarts scanning, a bus restart rebuilds everything above it.
  • Passive and active BLE scanning, runtime-switchable. Passive mode uses BlueZ’s AdvertisementMonitor1 (no scan requests — peripherals don’t burn battery answering); active mode collects SCAN_RSP data.
  • Advertisement reconstruction — BlueZ only exposes parsed properties; they’re re-serialized into AD byte structures, emit-gated (first sighting / payload change / RSSI heartbeat) and LRU-capped, then fanned out through your on_advertisement: fun.
  • Handle-keyed GATT client — connect / service discovery / read / write / notify / pair / unpair / clear-cache, with a documented, host-agnostic event contract delivered through your on_gatt_event: function. Generation-stamped so late replies can’t corrupt replaced connections.
  • Pairing agent that authorizes exactly the pairings your code initiated.
  • bluez-alsa integration (optional) — enumerates ready-to-open A2DP playback PCMs and signals your app when the set changes.
  • No host coupling — configuration flows exclusively through start_link/1 opts (functions, a PubSub, child specs); no Application.get_env, no callbacks into named host modules.

While this library is built for Nerves, it should work on a normal linux host. The passive scanning required some additional changes to the rebus library that I’ve opened a PR to upstream, the current 0.1 release of bluez vendors it in. This passive scanning mode is extremely efficient which was the primary reason I went with this approach.

I’ve been using this in deployed code for weeks now where its been very stable, the early version is mainly to reflect that it might still need changes.

For this project I’ve mainly been building out features with the Elixir Phoenix plugin for claude code, with manual and AI reviews as well as frequent audits to try and prevent any AI sloppiness from manifesting. :crossed_fingers:

Showing Posts 1 to 1

quatermain

quatermain

Hi, creator of that plugin for Elixir/Phoenix development with Agents here. Thanks for using it and mentioning it here. Happy to see users of it. Fyi if you want help to contribute to plugin and even improve experience with Nerves and others, there is way how you (we) can retrospectively analyze your sessions and generate improvements for plugin or new skills at all. Whole framework is (hidden) inside the plugin.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews