After taking a closer look to latest changes in lib for bluetooth I have some questions.
I will start with setScan. As far as I can see, I have to create an event with a JsVar for adv. This is taken in callback and converted to a BluetothDevice object.
BluetoothDevice is ifdef with nrf, how would I bypass this, or should I return a simple object ?
first an object is created, which is next converted to a BluetoothDevice, why not create a BluetoothDevice directly ?
setScan is defined as nrf.setScan. This is the way how all the descriptions are done. IMHO it would be a kind of confusing for users of other boards to use a nrf command. I could imagine to add one more wrapper which connects the same function to Bluetooth Object. Same for setServices etc.
would this option add too much overhead
is there any other reason not to do it ?
BluetoothUtils holds a lot of helpful functions, which could be used for other boards as well. As far as I understand, there are also some nrf only functions in.
could we split this into 2 files, BluetoothUtil and nrfUtil for example ?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
After taking a closer look to latest changes in lib for bluetooth I have some questions.
I will start with setScan. As far as I can see, I have to create an event with a JsVar for adv. This is taken in callback and converted to a BluetothDevice object.
setScan is defined as nrf.setScan. This is the way how all the descriptions are done. IMHO it would be a kind of confusing for users of other boards to use a nrf command. I could imagine to add one more wrapper which connects the same function to Bluetooth Object. Same for setServices etc.
BluetoothUtils holds a lot of helpful functions, which could be used for other boards as well. As far as I understand, there are also some nrf only functions in.