Open maelp opened 1 month ago
Since switching to SimpleBLE, we are reliant on what that exposes, so that needs cheking.
I'm not sure where we would expose it, I can't see the Webbluetooth specification mentions exposing it
Hmmm... but if you don't expose MTU, how do I know how many bytes can fit in a packet?
BTW when using your library in a browser environment, does your library automatically switch to the underlying Webbluetooth backend? Or does the user have to do something like
const ble = env.NODE ? import "webbluetooth" : new window.WebBluetooth()
or equivalent? And would that be complicated to implement other third-party backends (I'm thinking about https://github.com/capacitor-community/bluetooth-le)
(if this was done "transparently" it would allow me to use your lib in a third-party lib that could be used both in Node and in the browser, and in a Capacitor iOS / Android app, which would be really convenient)
This library requires native modules, so would never work in a browser. Ideally you should be creating different builds for web and desktop and depending on your packaging environment you should be able to trivially swap this in when building on desktop. It aims to follow the webbluetooth spec so the API is the same as the native web one.
Is there a way to get the peripheral MTU?