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?


    Gap::AddressType_t addr_type;          // mbed v5?

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

        ble::own_address_type_t addr_type;
        ble::address_t address;, 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 *' ...


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

v6 -
v5 -

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, 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.