Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 2 months ago.
How to change BLE MAC Address on mbed nrf51822
Hi,
I am trying to change the mac address on my mbed NRF51822.
I am trying to use this line:
const uint8_t address1[] = {0xAA,0xAA,0xAA,0xAA,0xAA,0xAA}; ble.setAddress(Gap.ADDR_TYPE_PUBLIC, address1);
but I get this error:
Error: Type name is not allowed in "main.cpp", Line: 112, Col: 32
Can someone please help me?
Thank you!
Question relating to:
3 Answers
10 years, 1 month ago.
Here's a patch to add getAddress() API. This will be a part of the next release, but it doesn't justify making a new release. Thanks.
10 years, 1 month ago.
Hi, I have a question about this topic - how can I read default mac ?
Hi,
Thanks for bringing this up. I should add an API for fetching the default MAC address. While this doesn't take much time, I would still like to wait a little while before pushing out the change as a part of a larger release. I will collect the diff and attach it here so that you can make use of it.
thanks again, rohit.
posted by 06 Oct 2014
Solved!
const uint8_t address1[] = {0xe7,0xAA,0xAA,0xAA,0xAA,0xAA}; ble.setAddress(Gap::ADDR_TYPE_PUBLIC, address1);
posted by Naum N 28 Aug 2014Hi, did this actually change the advertised mac address?
posted by arie matsliah 08 Jan 2015Thank you!! It works on my ST Nucleo IDB04A1
posted by Josué Olmeda 15 Apr 2015So far, I had to use ble.gap().setAddress(BLEProtocol::AddressType::PUBLIC, address1); to make this work (STNucleo F072 + IDB04A1)
posted by Filippo Montano 13 Apr 2016