You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • You're not really supposed to re-use UUIDs for different things, so the Bluetooth SIG suggests you should use a totally random 128 bit UUID (the chances of duplicates and then basically nothing).

    So, go to a site like this and get a random UUID - for instance:

    123fd926-40c3-4cf3-9797-9a8703e32795
    

    Then just change the second group of 4 for all your services and characteristics, eg:

    123f0001-40c3-4cf3-9797-9a8703e32795
    123f0002-40c3-4cf3-9797-9a8703e32795
    123f0003-40c3-4cf3-9797-9a8703e32795
    123f0004-40c3-4cf3-9797-9a8703e32795
    

    So then you have:

    NRF.setServices({
      "123f0001-40c3-4cf3-9797-9a8703e32795": {
        "123f0002-40c3-4cf3-9797-9a8703e32795": {
          notify: true,
          value : [Math.round(E.getTemperature())],
        }
      }
    });
    setInterval(function () {
      NRF.updateServices({
        "123f0001-40c3-4cf3-9797-9a8703e32795": {
          "123f0002-40c3-4cf3-9797-9a8703e32795": {
            value : [Math.round(E.getTemperature())],
            notify: true
          }
        }
      });
    }, 1000);
    

    And you're sorted.

    The only gotcha is advertising 128bit UUIDs is hard since they use up a lot of your available space for advertising - so honestly I'd avoid that and would instead try to find your device based on its name (which you can easily change).

About

Avatar for Gordon @Gordon started