Thanks, I'll try that. I do want to get disconnect working in some way, as I want it to actively disconnect from the iPad so the iPad doesn't keep thinking it's got an external keyboard; unless I can figure out how to get it to realise that it's not really a keyboard, which I imagine will be nasty -- it's nasty to do in Bluetooth Classic, IIRC.
So, do you think keeping track of the HID connection (the BluetoothRemoteGATTServer via the Promise, presumably?) and issuing a server.disconnect() is the way to go?
(EDIT: Oh, hang on... that won't work... these connections are initiated by the iPad; there's no connect call going on, and we're the server, so there's no BluetoothRemoteGATTServer object. Hmm. If acting as a server rather than a client, is there a way to selectively disconnect a connection, or is it just a case of NRF.disconnect() and let the UART service and anything else be damned? )
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.
Thanks, I'll try that. I do want to get
disconnect
working in some way, as I want it to actively disconnect from the iPad so the iPad doesn't keep thinking it's got an external keyboard; unless I can figure out how to get it to realise that it's not really a keyboard, which I imagine will be nasty -- it's nasty to do in Bluetooth Classic, IIRC.So, do you think keeping track of the HID connection (the
BluetoothRemoteGATTServer
via the Promise, presumably?) and issuing aserver.disconnect()
is the way to go?(EDIT: Oh, hang on... that won't work... these connections are initiated by the iPad; there's no
connect
call going on, and we're the server, so there's noBluetoothRemoteGATTServer
object. Hmm. If acting as a server rather than a client, is there a way to selectively disconnect a connection, or is it just a case ofNRF.disconnect()
and let the UART service and anything else be damned? )