- 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 08:52 AM
I am trying to extract the board address from a BGM111. I do it in BGScript as follows:
and I get 5F541D570B00 which appears to make sense.
I really need to do it in C and found a piece of code that compiles but results in all zeros. The code:
struct gecko_msg_system_get_bt_address_rsp_t *btAddrRsp;
// Extract unique ID from BT Address
btAddrRsp = gecko_cmd_system_get_bt_address();
memcpy(btAddr, btAddrRsp->address.addr, 6);
uniqueId = 0xFFFFFF & *((uint32*) btAddr);
I admit I am not sure I follow this code exactly but when debugging I get all zeros for btAddr and for uniqueId.
Any thoughts or a clearer example of the use of the gecko_cmd_system_get_bt_address function?
Solved! Go to Solution.
03-20-2017 09:25 AM
>> and I get 5F541D570B00 which appears to make sense.
Try reversing the byte order and you get:
Makes more sense now?
The C code snippet that you attached: this will not work if you call it before the system_boot event has been raised. Could it be possible that you are calling it too early in your program ? (before system_boot) ?