Setting BLE Advertising Address using Tiny-Go Bluetooth

129 Views Asked by At

I'm using Tiny-Go's bluetooth to generate Bluetooth Low Energy (BLE) messages on a Raspberry Pi 4 (Raspbian, Linux 6.1.21, Bluez 5.55) like this:

    adv := constants.Adapter.DefaultAdvertisement()
    if err = adv.Configure(bluetooth.AdvertisementOptions{
        LocalName:        "Go BLE",
    }); err != nil {
        log.Fatalf("Error configuring advertisement: %v\n", err)
    }


    if err = adv.Start(); err != nil {
        log.Fatalf("Error starting advertisements: %v\n", err)
    }

This works fine. But, I'm trying to change the Bluetooth address my device is using to send the advertisements. I've tried using the Set() function to change the MAC address of the adapter, which does not throw an error but also does not appear to affect the BLE MAC address used in the advertisements.

Is there a way to change the advertising MAC address using Tiny-Go's bluetooth library? If not, is there a way I can change it using bluetoothctl or btmgmt?

0

There are 0 best solutions below