This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Implicit declaration of function sd_ble_gap_address_get in invalid in C99

First of all, how do I know which version of the SD I'm working with when I'm flashing an example app from an SDK? I know I'm flashing SD 132, but I need to know the exact variant If I'm going to feel comfortable looking up the SD api call sd_ble_gap_address_get in the docs.

I'm currently flashing SDK_14.1.0\examples\ble_central\ble_app_uart_c v1\pca10040\s132\arm5_no_packs

Now my central question: why is the call to sd_ble_gap_address_get in main resulting the warning Implicit declaration of function sd_ble_gap_address_get in invalid in C99

Here is main

int main(void)
{
    log_init();
    timer_init();
    power_init();
    uart_init();
    buttons_leds_init();
    db_discovery_init();
    ble_stack_init();
    gatt_init();
    nus_c_init();
	
	  uint32_t  * p_addr;
	  sd_ble_gap_address_get(p_addr);
	
    // Start scanning for peripherals and initiate connection
    // with devices that advertise NUS UUID.
    printf("BLE UART central example started.\r\n");
    NRF_LOG_INFO("BLE UART central example started.");
    scan_start();

    for (;;)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            nrf_pwr_mgmt_run();
        }
    }
}
Parents
  • Well, let's address the implicit definition first. I believe that particular soft device API has been changed to sd_ble_gap_addr_get(p_addr); in the more recent SDK's.

    I don't really have an answer for your first question, so rather than being flip I'll just leave it alone.

  • the documentation seems pretty clear here

    Note
    This will always return the identity address irrespective of the privacy settings, i.e. the address type will always be either BLE_GAP_ADDR_TYPE_PUBLIC or BLE_GAP_ADDR_TYPE_RANDOM_STATIC.
    

    so it returns one of those two types and no that's not necessarily the unique hardware address of the chip, it's whatever was set with sd_ble_gap_address_set()

Reply
  • the documentation seems pretty clear here

    Note
    This will always return the identity address irrespective of the privacy settings, i.e. the address type will always be either BLE_GAP_ADDR_TYPE_PUBLIC or BLE_GAP_ADDR_TYPE_RANDOM_STATIC.
    

    so it returns one of those two types and no that's not necessarily the unique hardware address of the chip, it's whatever was set with sd_ble_gap_address_set()

Children
No Data
Related