• When puck is advertising it is not possible to connect it via bluetooth.

    I use the npm espruino package on linux to connect to the puck and to upload code.

    After uploading this file

    const keys = {
      temperature: 0x1809,
      battery: 0x180f,
      someData: 0xfffe
    };
    
    function a() {
      digitalPulse(LED3, 1, 1000);
    
      const adData = {};
      adData[keys.battery] = [Puck.getBatteryPercentage()];
      adData[keys.temperature] = [Math.round(E.getTemperature())];
    //  adData[keys.someData] = [1, 2, 3, 4, 5];
      NRF.setAdvertising(adData);
    }
    
    setWatch((e) => a(), BTN, { repeat: true, edge: 'rising', debounce: 40 });
    

    it is possible to connect to the puck. Pressing the button to start advertisement does not change that.

    When slightly modifying the code to

    const keys = {
      temperature: 0x1809,
      battery: 0x180f,
      someData: 0xfffe
    };
    
    function a() {
      digitalPulse(LED3, 1, 1000);
    
      const adData = {};
      adData[keys.battery] = [Puck.getBatteryPercentage()];
      adData[keys.temperature] = [Math.round(E.getTemperature())];
      adData[keys.someData] = [1, 2, 3, 4, 5];
      NRF.setAdvertising(adData);
    }
    
    setWatch((e) => a(), BTN, { repeat: true, edge: 'rising', debounce: 40 });
    

    to advertise on an additional service id will change that. Once the advertisement is started by pressing the button I am not able to connect to the puck until it is reset.
    The behavior is not specific to this service ID.

About

Avatar for palortoff @palortoff started