You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • setInterval is the last thing I do in the program. The error I get is

    in function called from system
    Uncaught Error: Can't update services until BLE restart

    Last lines of code:

    function bolidRdUpdate(){
    NRF.updateServices({
      0xBCDE : {
        0xABCE : {
          value : [FuelLevel]
        }
      }
    });
    }
    setInterval( bolidRdUpdate, 1000);
    

    After I disconnect WebIDE and connect WebBluetooth app it works fine. The errors pop up while connected to IDE on every interval.
    I suppose the error explains it. BLE needs to be restarted so maybe thats how it should behave.

  • After I disconnect WebIDE and connect WebBluetooth app it works fine.

    And then after you disconnect app and connect IDE again the error reappears?
    Maybe it needs restart only first time after you call setServices while you are still connected via IDE - as it probably cannot change service definition while still connected(?).

About

Avatar for fanoush @fanoush started