It’s been a while but I’m back!
I made huge changes to the overall layout of the library, and decided that…
-
Brushobjects are the devices themselves, and will allow you to connect, disconnect, view its state, send/receive BLE commands, etc. -
OralBClientwill only act as a “discovery layer”, which lets you search for newBrushobjects and keep track of your connections (like a “management” layer I guess you could call it???)
I finished building the connect/disconnect commands with an optional timeout option for connections, and I moved rssi and macAddress into getters so they’re read directly from the peripheral and update automatically. Had to switch to the @stoprocent/noble fork because the previous one caused issues with discovery in Fedora.
In OralBClient, I added a way to track the brushes and store the connected ones in a Map (so users don’t have to keep track of the Brush objects elsewhere). I also added the option to stop discovery early, and an adapter state check before it starts discovering (so it waits for the Bluetooth adapter to power on first!)
).