BLE getAddress() in Mbed 6 - valid samples?

Hi everyone!

I’m new to the forum, but I’ve been a programmer for more than a couple decades.

I am however having a difficult time getting many of the samples working since things seem to change so drastically between major (and sometimes minor) versions.

Most recently, I have discovered that none of the samples for getAddress() will work on Mbed 6. The samples available seem to only support v2 or v5. I’ve searched both the Mbed site and the internet to no avail.

What does NOT work…

    BLEProtocol::AddressType_t addr_type;  // mbed v2?

nor

    Gap::AddressType_t addr_type;          // mbed v5?

However…
This sort of worked (i.e. declarations didn’t immediately choke compiler):

        ble::own_address_type_t addr_type;
        ble::address_t address;
        _ble.gap().getAddress(&addr_type, address);

But getAddress() resulted in the following error:

Error: Non-const lvalue reference to type 'ble::own_address_type_t' cannot bind to a temporary of type 'ble::own_address_type_t *' ...

So…

Does anyone have code that works on v6 you’d be willing to share? Any help would be much appreciated!

references:
v6 - https://os.mbed.com/docs/mbed-os/v6.15/mbed-os-api-doxy/_gap_8h_source.html
v5 - https://os.mbed.com/docs/mbed-os/v5.15/mbed-os-api-doxy/_b_l_e_8h_source.html

I haven’t used bluetooth, but I believe that that compiler error is telling you that you passed a pointer to ble::own_address_type_t when it expected a reference. So I think you want

_ble.gap().getAddress(addr_type, address);

Thanks, I guess my point is that each version should have clearly labeled samples and each sample should be clear about which version it works with.