Bluetooth for ESP32, nrf or not ? #6786
Replies: 1 comment
-
Posted at 2017-11-03 by @gfwilliams
I'd maybe change the ifdef to be
You mean here: https://github.com/espruino/Espruino/blob/master/targets/nrf5x/bluetooth.c#L615 and then: It's just because I'm trying to do the bare minimum inside the IRQ. So the IRQ (first one) only allocates the data it needs - then outside of an IRQ it does more allocation. In your case it works well, because you should be able to use the existing code in jswrap_bluetooth as-is?
Yes, I know. I think eventually I'd change
Not if done right - I wouldn't add 'shadow' functions though - that would use up a bit more memory for no real reason.
Not really - but for the moment I'd leave it as If it really irks you, perhaps you could just execute the code
Are you up to date with GitHub? I have now moved BluetoothUtils outside of the nrf5x directory: https://github.com/espruino/Espruino/tree/master/libs/bluetooth
Currently |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-11-03 by JumJum
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.
Beta Was this translation helpful? Give feedback.
All reactions