• I'm less convinced about Go just because it's another layer. I just checked and it looks like none of the existing BLE libs support Windows, and it looks like the ones that exist use 'CGo' anyway - so now instead of just having a C toolchain you have to have the tools (eg Xcode, Visual Studio) to build C and Go.

    Do you have a link to that Docker build that'll compile Mac OS images? (edit: I found https://github.com/multiarch/crossbuild)

    There doesn't actually seem to be a C/C++ library to handle Bluetooth LE in a multiplatform way (there's https://github.com/mbientlab/Warble which doesn't do MacOS, and which seems to only be allowed to be used with mbientlabs devices). All the various language implementations (in Chrome itself, Node's Noble, Python's bluepy, Go's various implementations) seem to have their own implementations for each platform. Also only Noble seems to do Bluetooth HCI which is a really good fallback for any platform, and is the only option on Windows 7 and earlier.

    I don't want to be this guy: https://xkcd.com/927/

    But... rather than do the same with Espruino (or with a new tool) one option might be to start a new project that was a multiplatform C(or C++?) library for accessing Bluetooth LE and Serial, and then to use that library to add BLE/etc support to Espruino. Bonus if it could be compiled to a command-line tool as @opichals suggests so it could be a swiss-army knife for accessing any IO device on any platform.

    A library like that is likely to get an awful lot of use/contributions from all kinds of people, so should get to be pretty solid pretty quickly.

  • Also only Noble seems to do Bluetooth HCI which is a really good

    So do you think Noble js code could run on top of espruino with the native noble C stuff moved to espruino linux target? Or is it too heavy? Actually the only native part seems to be https://github.com/noble/node-bluetooth-­hci-socket/tree/master/src and the rest is pure js (?), can't find anything else.

    BTW just recently I used noble as part of https://github.com/DigitalSecurity/btlej­uice to reverse engineer communication between android app and fitness trackers and it worked for most of them (well, except the DS-D6 one I wanted the most - perhaps it uses some security features unlike the rest of cheap fitness trackers I got). bltejuice needs two bluetooth devices so I used raspberry pi 3b+ for btlejuice and Zero W for btlejuice-proxy and it worked. Node startup is a bit slow on the Zero but then it run just fine.

About

Avatar for fanoush @fanoush started