• Nice - thanks! I'm not sure if there is a pexpect thing for C, but I imagine it wouldn't be too painful to code something up.

    However (this is a bit off-topic) I just looked at Bluetooth HCI in a bit more depth and it seems there's a standard protocol for implementing Bluetooth LE USB devices, and it's really not that painful. For example this for scanning: https://github.com/noble/node-bluetooth-­hci-socket/blob/master/examples/le-scan-­test.js

    It gives you super low level control, and would be multiplatform too (once the platform specific USB stuff was handled). I can imagine that actually the effort required to hack a BLE implementation with gatttool may not be that different to just talking direct to the BLE device.

    With legacy DFU on https://github.com/thegecko/web-bluetoot­h-dfu/, it was in there and got taken out in an earlier commit (you can find it in the commit history). I've got a super-hacky version of it that I'm using - and it really is super hacky, because again I'm doing the 'send 8 and wait for response' thing to speed up transfers.


Avatar for Gordon @Gordon started