You just need to define a function called GB:
GB
global.GB = (event) => { switch (event.t) { case "musicinfo": ... break; case "musicstate": ... break; } };
More info on what form the data takes is at http://www.espruino.com/Gadgetbridge
This would override the GB function if it's already defined, correct? What if multiple apps want to receive events?
@NebbishHacker started
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.
You just need to define a function called
GB
:More info on what form the data takes is at http://www.espruino.com/Gadgetbridge