Avatar for rigrig

rigrig

Member since Apr 2020 • Last active Mar 2024
  • 11 conversations
  • 217 comments

Most recent activity

    • 53 comments
    • 3,709 views
  • in Bangle.js
    Avatar for rigrig

    You can log GadgetBridge messages using the Messages Debug app.

    Music state is tricky as there is quite some variety in what info various media players report (and even when). That is e.g. why the watch updates the current music info when it gets a new message, instead of completely throwing away old info. I can definitely see that messing things up when there are multiple player notifications.

    I haven't looked at the Gadgedbridge music code, but I'm thinking maybe it could be changed to include the name of the media player.

  • in Bangle.js
    Avatar for rigrig

    That should automatically have installed the Message UI app ("Messages"), which contains music controls.

    (I'm assuming you already installed Gadgetbridge on your phone and connected it to your watch)

  • in Bangle.js
    Avatar for rigrig

    gbmusic should work if you only want to control media, but maybe have a look at Android Integration first, for more extensive Android support (including music).

  • in Bangle.js
    Avatar for rigrig

    Maybe AntennaPod supports notification channels? That way you could just disable e.g. "download" notifications

  • in Bangle.js
    Avatar for rigrig

    I think you're looking for the lock event

  • in Bangle.js
    Avatar for rigrig

    I haven't found a way to have the console up when connected to GB.

    Instead of connecting to GB, you could send fake messages manually in the console:

    GB({"t":"musicinfo","artist":"Some Artist Name","album":"The Album Name","track":"The Track Title Goes Here","dur":241,"c":2,"n":2})
    GB({"t":"musicstate","state":"play","pos­ition":0,"shuffle":1,"repeat":1})
    
  • in Bangle.js
    Avatar for rigrig

    var getData = require('Storage').read('rawData.csv\1')­;

    This only reads chunk 1 of the Storage file, see here for an explanation about those.

    You probably want something like this:

    var dataFile = require('Storage').readopen('rawData.csv­', 'r');
    var line = dataFile.readLine();
    while (line != undefined) {
            Bluetooth.println(`<data>\n${line}\n</da­ta>`);
            line = dataFile.readLine();
    }
    dataFile.erase();
    

    Also:

    var memory = require("Storage").getStats();

    Shouldn't this be var memory = require("Storage").getFree(); ?

  • in Bangle.js
    Avatar for rigrig

    Actually, we might get away with just making it an attribute, and only calling Volley.newRequestQueue for the very first request (and cleaning it up in dispose). That way there is no need to sprinkle stop over all response/error handler code, and we don't need a full-blown singleton class either.

    Looking at 400-line switch statements makes me itchy though, so I'll try to submit a PR with some refactoring Soon, and include a fix for this.

    edit: PR

  • in Bangle.js
    Avatar for rigrig

    I wonder if it's related to Volley.newRequestQueue - maybe that should just be called once?

    I think that's it: looking at this, we should either call stop() on the queue once we have a response, or set up a singleton. Otherwise every request leaves a new "thread pool" lying about.

    If you just need to make a one-time request and don’t want to leave
    the thread pool around, you can create the RequestQueuewherever you
    need it and call stop() on the RequestQueue once your response or
    error has come back, using the Volley.newRequestQueue() method
    described in Sending a Simple Request. But the more common use case is
    to create the RequestQueue as a singleton to keep it running for the
    lifetime of your app, as described in the next section.

    (Calling stop() seems by far the easiest solution.)

Actions