• I realized I didn't use much of the pebbleKit things, so once I saw your intent broadcast receiver I just used that instead, but with \u0010 so it would execute a javascript line. So I didn't change anything at the Gadgetbridge side.

            val jsonData = JSONObject(data)
            logger.info(jsonData.toString())
            jsonData.put("t", "bangleOSM")
            sendDataIntent.putExtra("line", "\u0010GB($jsonData)\n")
            sendBroadcast(sendDataIntent)
    

    and indeed the app loading also works (created an android app to load the tasks from OpenTasks into the todolist watch app and open it)

     sendDataIntent = new Intent("com.banglejs.uart.tx");
     sendDataIntent.putExtra("line", "\u0010load(\"todolist.app.js\");\n");
     sendBroadcast(sendDataIntent);
    
  • I've added the global.GB function to handle my type in the lcars app js:

    global.GB = (_GB => e => {
      switch (e.t) {
        case "bangleOSM":
          if(e.turnIn || e.turnNow){
            turnAlert(e);
          } else if (e.turnType) {
            turn = e;
            drawNavInfo(turn);
          } else {
            turn = null;
            drawPosition0();
          }
          break;
        default:
          // pass on other events
          if (_GB) setTimeout(_GB, 0, e);
      }
    })(global.GB);
    
About

Avatar for user148837 @user148837 started