Hi TI,
Does this function extern hciStatus_t HCI_ReadBDADDRCmd( void ); in hci.h returns me the BLE MAC address??
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi TI,
Does this function extern hciStatus_t HCI_ReadBDADDRCmd( void ); in hci.h returns me the BLE MAC address??
Hi,
HCI_ReadBDADDRCmd will return the device's Bluetooth public by passing the event hciEvt_CmdComplete_t with cmdOpcode HCI_READ_BDADDR
Best regards,
No, HCI_ReadBDADDRCmd doesn't return BLE MAC address directly and you would need to add "case HCI_READ_BDADDR:..." in SimplePeripheral_processCmdCompleteEvt to get MAC address if you use simple_peripheral example. It will be easier to use the following code to get BLE MAC address directly.
#include <inc/hw_fcfg1.h> uint64_t bleAddress; bleAddress = *((uint64_t *)(FCFG1_BASE + FCFG1_O_MAC_BLE_0)) & 0xFFFFFFFFFFFF;
Thankyou for the details. Is there any SDK example to see the working of this.
As I know, TI doesn't have example code for using HCI_ReadBDADDRCmd. You can try to refer to Markel's implementation in this discussion thread.
Hi
I'm getting an error like
#138 expression must be a modifiable lvalue
for this expression bleAddress = *((uint64_t *)(FCFG1_BASE + FCFG1_O_MAC_BLE_0)) & 0xFFFFFFFFFFFF;
static uint64_t BLEMAC(uint64_t *bleAddress) {
uint64_t bleAddress;
bleAddress = *((uint64_t *)(FCFG1_BASE + FCFG1_O_MAC_BLE_0)) & 0xFFFFFFFFFFFF;
return bleAddress;
}
What I have done is I have created a function and returned the value of MAC Address by calling the function BLEMAC in another program.
If my implementation is wrong please correct and suggest me a better way.
I suppose you should revise your BLEMAC function implementation to
static uint64_t BLEMAC(void) { uint64_t bleAddress; bleAddress = *((uint64_t *)(FCFG1_BASE + FCFG1_O_MAC_BLE_0)) & 0xFFFFFFFFFFFF; return bleAddress; }
#define B_ADDR_LEN 6 //global
uint16_t u16_macAddress[B_ADDR_LEN]; //global
u16_macAddress = BLEMAC(); //assigned in a local function
This things I have included in certain fucntion to assign MAC address to the variable u16_macAddress.
It finally ended me up in the error .
#138 expression must be a modifiable lvalue
Please show me a way to solve it.
I don't think you can return BLEMAC to an uint16_t array pointer. You should use the following codes.
uint64_t ble_Address ble_Address=BLEMAC();