anyone managed to set the appearance (0x1800:0x2A01)

Posted on
  • anyone managed to set the appearance – service: 0x1800 characteristic: 0x2A01 ?
    it gets overridden by default Puck.JS (name and appearance in 0x1800).

    NRF.setServices({
      0x1800: {
        0x2A00: {
          value: 'Appearance Test',
          readable: true,
          writable: true,
        },
        0x2A01: {
          readable: true,
          value: [961], // BLE_APPEARANCE_HID_KEYBOARD 
        },
      }
    }, { advertise: ['1800']});
    
    NRF.on('connect', function(addr) {
      digitalPulse(LED1, 1, 50); 
    });
    
    setWatch(function() {
      digitalPulse(LED3, 1, 50);
    }, BTN, { repeat:true, edge:"rising", debounce:50 });
    
  • Do you mean specifying the name itself? You can do that with NRF.setAdvertising({},{name:"foo"})

    I'm not sure if that's actually how you'd go about changing the appearance? Either way it looks like you need a 16 bit value, so instead of [961] you'll need [0x03,0xC1] (I think - the endianness could be different).

  • How are you checking it? Using the nRF connect app?

    Even though Puck.js doesn't include the appearance, it shouldn't overwrite it if you put it in explicitly.

    The other option you have is to manually specify the entire advertising data payload - if you figure out what you need to send you can just do NRF.setAdvertising([.......]) with the binary data.

  • nRF connect/iOS & Android and OS X. will try to send raw bytes to see if it works ;)

    ps. cool nodeconfeu badge !

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

anyone managed to set the appearance (0x1800:0x2A01)

Posted by Avatar for tbd @tbd

Actions