The changes of above lines of code for 256KB device are fine.
> Does device address changes if we assign node address or it just gets stored in SuperVisory Flash?
Ans: Device address won't changes if you assign the node address. Device address and node address are different, node ddress allows the data to be sent to a particular node of the network or broadcast it to all nodes in the network. Please refer to the page 13 in this datasheet for more information.
> Is Node address and BLE physical address(address while advertising) same?
Ans: No. BLE physical address and Node address are different. The two bytes of the node address will refer to a particular kit(Node) where data can be sent over mesh network. Please refer to the page 13 (Point20) in this datasheet for more information.
> Can we change BLE physical address through application?
Ans: Yes, you can change the BLE physical address through application using CyBle_SetDeviceAddress() API. This function sets the Bluetooth device address into BLE Stack's memory. User should call 'CyBle_GapSetIdAddress' API function to set identity address if 'CyBle_SetDeviceAddress'API function is used to set public or random static address.
SFlash in PSoC 4 BLE and PRoC BLE devices contains 4 user configurable rows that the application can use for storing Bluetooth device address. Ble Device Address can be changed by writing non-zero values of first 6 bytes of Row0 in SFlash using CySysSFlashWriteUserRow(0,row) API. Byte 7 will define the address type of the address. Please refer to the Day029_BLE_SFlash_Write for reference.
Thanks for solving my querries.
I have few more querries.
1. What is the difference between "Public Device Address" and "Random Device Address"?
2. What is the Identity address?
3. Which address will change if execute CySysSFlashWriteUserRow(0,row)?
Public Device Addresses are comprised of a 24-bit company ID and a 24-bit company-assigned number (unique for each device). Public Device Addresses do not change over time.
Random Device Address is a randomly generated address which is classified into two types, Static Random Address and Private Random Address. Please refer to the section 7.2.1 Bluetooth Address Types in the datasheet for more information.
Every Privacy-enabled BLE device has a unique address called the Identity Address. The Identity Address is the Public Address or Static Address of the BLE device. This Identity address is used for resolving the private address of a device.
If you write the first 6 bytes(non-zero values) of ROW0 in SFLASH (with 0x00 as byte 7 in ROW0) using CySysSFlashWriteUserRow() API, then the device will take the BLE address as public address.
Please refer to the KBA Setting Bluetooth Device Address – KBA211407 for more information.