- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
03-20-2017 06:25 AM
I want to allow only particular BT-MAC addresses to be connectable to the BGM121. There is a possiblity to get an address of a connected device (bd_addr activeAddress = evt->data.evt_le_connection_opened.address
I have two questions:
The returned address is not the MAC address, but its an unique value which identifies a phone clearly. Has the returned value somehow to be encoded to get the real MAC?
How can I use this "MAC" to refuse connections of unwanted phones? I could not find any function of kind gecko_cmd ... close_connection
03-20-2017 09:21 AM
I don't see how the title of the post (reset the connection of BGM121) has anything to do with the actual question that you asked?
Phones use random Bluetooth address that changes frequently. It is not possible to do access control based on this random address. There is no API call to get the "real MAC".
Is there some reason why you don't use bonding (either Just Works or MITM)? A BGScript based bonding example is available here:
03-20-2017 10:32 AM
I thought that I explained it well, but it doesn't seem so.
I want the MAC of a phone for the decision, if that particular phone is allowed to connect to the phone or not. if not, I want to "reset the connection" or in other words, refuse the connection to the phone.
Bonding is just one of all possibilities to get the behavior I want. But bonding lacks also of some "features": neither the function gecko_cmd_sm_set_bondable_mode(0) nor the function gecko_cmd_sm_store_bonding_configuration(1,0) behaves as expected (and explained in the API), so I tried another way to allow just one phone to connect (and bond).
03-20-2017 10:35 AM
OK now I see what you mean by the "reset connection" in the title.
In any case, using the phone's random Bluetooth address is not a working solution because the address changes frequently.
03-20-2017 10:44 AM
Where do you got this information? The MAC is the hardcoded address of the chip, what sense should it have to change the MAC permanently?
btw, my mobile doesn't change it's bluetooth MAC... It's the same every day and also after a reboot.
03-20-2017 12:28 PM
This is perhaps not the most reliable source of information, but the explanation seems quite good to me:
Your phone does have a static Bluetooth address that is probably hard-coded into the Bluetooth chipset. But have you tested what is the Bluetooth event displayed on the BGM121 when you connect with your phone? At least in all the tests I have done with Android or iPhone the random address is used when connecting to a peripheral.
Here's another reference, this is from Bluetooth SIG website:
03-20-2017 12:34 PM
If you want to drop a connection, for whatever reason (e.g. based on the Bluetooth address) then the correct API call for this is gecko_cmd_endpoint_close. The connection handle is passed as parameter. This is probably what you were originally looking for, right?