You are reading a single comment by @voodooless and its replies. Click here to read the full conversation.
  • That's very cool.

    Some more questions: is there a way to actually detect that there is a BLE uart connection present at all? Are there any events for connect or disconnect?

    Furthermore, it all seems to be based on string data? How does it work with binary data? can I safely convert the string data to binary and the other way around?

  • There is an event for connect and disconnect that's fired when you connect / disconnect.

    For binary, you can either convert binary to text, and send that. For example Bluetooth.write(uint16array.buffer) just sends the raw bytes from an uint16 array.
    Or you can define you own characteristic, and that way it doesn't collide with normal Nordic UART operation.

    I have a project using the Nordic Uart that transfers data (power measurements from INA226) from Espruino to a page with web bluetooth. Actual sending is this line Sends x + timestamp + voltage, current, power read from the INA + y in each line.
    Parsing part is a bit contrived. Parses the bytes back to numbers.

    I have a version that uses a custom characteristic, but that's not yet up on Github.

About

Avatar for voodooless @voodooless started