You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • 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.

    1. BluetoothDevice is ifdef with nrf, how would I bypass this, or should I return a simple object ?
    2. 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.
    3. would this option add too much overhead
    4. 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.
    5. could we split this into 2 files, BluetoothUtil and nrfUtil for example ?
    6. or ifdef the nrf relevant function ?
About

Avatar for JumJum @JumJum started