Setting Static Device Address in hci_uart

Hi,

I would like to set the FICR-Address as Static Device Address in hci_uart. I know how to set this address as Public Address but can't find any suitable API to set it as Static Device Address. All functions I found are needing the host implementation, which is not there in my this case. I also know there is a HCI command HCI_LE_Set_Random_Address but I want the address to be set on controller side because the FICR-Address is (obviously) not accessible on the host side.

Regards,
Oliver

Parents Reply
  • Hi Oliver,

    Here are possible steps
    1. read static address from FICR (sdc_hci_cmd_vs_zephyr_read_static_addresses)
    read_static_address
    2. returned static address can be set via sdc_hci_cmd_le_set_random_address
    set_random_address

    Here is an example

    #include <sdc_hci_vs.h>
    #include <sdc_hci_cmd_le.h>
    
    //static address stored in FICR
    uint8_t addr[6] = {0x56, 0xFF, 0X99, 0X00, 0XCD, 0X29}
    sdc_hci_cmd_le_set_random_address_t params;
    memcpy(&params.random_address[0], addr, sizeof(addr));
    sdc_hci_cmd_le_set_random_address(&params);


    Alternatively, you could use hcitool for setting random address over HCI UART.

    sudo btattach -B /dev/ttyACM0 -S 1000000
    sudo hcitool cmd 0x08 0x05 29 CD 00 99 FF 56


    Best regards,
    Dejan

Children
Related