- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I try to get a never changing and unique device identifier for the CYBLE-212006-01 BLE module in PSoC Creator 4.2. I think, the silicon generated device address is the right property here.
So I need to get this device address in my program. Where should I call the function "CyBle_GetDeviceAddress()"? I tried it in main.c without any success, but in StackEventHandler() it works. Are there any pre conditions to call this function?
I tried it like this:
void StackEventHandler(uint32 eventCode, void *eventParam) {
...
test.type = 0;
CyBle_GetDeviceAddress(&test);
...
}
I set test.type to 0, to get the silicon generated device address. Is that right?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The address which we are configuring in the BLE component is Public device address only. This address is never changed and unique for each device. If we change the Bluetooth device address type to Random then only the address values are changed.
Please refer the section 7.2.1 Bluetooth Address Types for more information on different address types.
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
We have to call CyBle_GetDeviceAddress() API only after BLE stack is ON so we need to actually wait for the CYBLE_EVT_STACK_ON event and then use the GetDeviceAddress API.
Bluetooth address type(test.type) will give whether the address is Public device address or Random device address.
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
ok, but where is the difference between the "Public device address" and "Random device address"? It is not explained in the datasheet. And can I be sure, that this address is never changed and unique?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found this article about Random and Public device addresses:
Public Device Address: The Public Device Address is a combination of a company ID and a company-assigned ID per device following the IEEE 802-2001 standard. Company ID and company-assigned ID values are 24 bits each, constituting the total 48 bits of address as shown in Figure 1.
Random Device Address: As the name suggests, the Random Device Address is a randomly generated address. The Random Device Address is classified in two types, Static Random Address and Private Random Address.
The Static Random Address (Fig. 2) is either preprogrammed on a device before it’s shipped, or may change to a new value after each power cycle. However, a device isn’t supposed to change this address until the device goes through a power cycle. If this address is changed during runtime, the address stored in the peer device will not remain valid and the reconnection using the older address will fail.
So is the Random address programmed before shipped or may it chage?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The address which we are configuring in the BLE component is Public device address only. This address is never changed and unique for each device. If we change the Bluetooth device address type to Random then only the address values are changed.
Please refer the section 7.2.1 Bluetooth Address Types for more information on different address types.
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perfect thanks!