• Ok, well, this bit is what you need then I think: https://github.com/espruino/EspruinoHub#­connections

    So...

    • When you get presence detect on the bangle, start sending /ble/notify/MAC_ADDRESS/nus/nus_rx once a second
    • Start listening for /ble/data/MAC_ADDRESS/nus/nus_rx topics
    • Now send JS code to /ble/write/MAC_ADDRESS/nus/nus_tx - maybe something like require("Storage").list("recorder.",{sf:­true}) that'll output the list of available Recorder files
    • You might want to tag it so you can easily separate the response from other messages, for example by sending the actual string: '\x10Bluetooth.println("FILES="+require(­"Storage").list("recorder.",{sf:true}))'­
    • Once you want a file, you just need to send the JS code to output it. So for example maybe:

      (fn=>{
      Bluetooth.println("==== START FILE "+fn+"====");
      var l, f = require("Storage").open(fn,"r");
      do Bluetooth.print(l=f.readLine()); while (l);
      Bluetooth.println("==== END FILE  ====");
      })("recorder.log0.csv");
      

    Then hopefully you can receive all those responses via the /ble/data/MAC_ADDRESS/nus/nus_rx topic and you're good :)

About

Avatar for Gordon @Gordon started