• Thank you @Gordon.

    Just to make sure I understand - you're connecting to the Puck from a device like a PC or phone?

    That is correct I am using the Puck as a Ble HID Keyboard, I want to connect it to my phone, use it to pass a string of characters to the phone (based on an event), then (based on another event) I want to disconnect the Puck from the phone (without touching the phone) and have it not auto-reconnect to the phone.

    I had looked at changing the MAC address using each of the 3 variations as I wasn't sure from reading the documentation what each type of address was. It seemed a little confusing to me have a static address that is random?

    NRF.setAddress("xx:xx:xx:xx:xx:xx");
    NRF.setAddress("xx:xx:xx:xx:xx:xx public");
    NRF.setAddress("xx:xx:xx:xx:xx:xx random");
    
    

    But none of them seemed to have any effect on the device's mac address. I including the line in my onInit() function, I tried having it outside of the function, uploading my code and using the save() command. I have also tried entering it into the command line directly. When entering into the command line on the web IDE, it returns "undefined", then when I check for the change by entering NRF.getAddress(), it just returns the original default MAC address of the Puck. I have tried save(), on the device, then power cycling the puck, but the changes are still not working.

    If I can get the MAC address to successfully change with the NRF.setAddress, then this should work as a solution, because I can create a random string on init of the Puck, which will hopefully prevent reconnection to the phone as it will not appear to be a previously paired/bonded device.

    On another note, (although this wasn't a solution for me) I was able to change the advertised name with:

    NRF.setAdvertising({},{name:"Hello"});
    

    But I couldn't find a way of resetting this back to the default "puck.js xxxx" where I think the xxxx was the last few characters of the MAC address. Is there a command to reset this back to factory default?

About

Avatar for tronic98776 @tronic98776 started