Hi,
I am using the following tools and resources,
1. Segger embedded studio
2. SDK 16.
3. SD version 7.
4. nrf52 Development kit PC410040.
5. nrf Connect app in iPhone
I am trying to develop a simple non connectable simple advertisement sequence , with no scan response data. the following is the Advertisement initialization function.
static void advertising_init(void) { ret_code_t err_code; ble_advertising_init_t init; memset(&init, 0, sizeof(init)); init.advdata.name_type = BLE_ADVDATA_FULL_NAME; init.advdata.include_appearance = true; init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE; init.config.ble_adv_fast_enabled = true; init.config.ble_adv_fast_interval = APP_ADV_INTERVAL; init.config.ble_adv_fast_timeout = 0; //init.evt_handler = adv_event; m_advertising.initialized = 0; //m_advertising.evt_handler = adv_event; m_advertising.adv_params .properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED; m_advertising.adv_params .p_peer_addr = NULL; m_advertising.adv_params .interval = APP_ADV_INTERVAL; m_advertising.adv_params .duration = 0; err_code = ble_advertising_init(&m_advertising, &init); APP_ERROR_CHECK(err_code); ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG); }
1. my understanding of this function "ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);" is just a tag created for a particular advertisement configuration, and unique tag ID can be created for multiple configuration. The problem is, if i dont use this function, my app runs into some kind of run time error, which i can see it in RTT viewer, please find the below screenshot from the RTT viewer. But ideally even without the function the program should work fine, shouldnt it?
2. when I use configuration tag function, the app is working fine, I am able to see the device listed on nrf connect app, but RTT viewer is just blank, I am not able to see any NRF_LOG / APP_ERROR outputs, is that supposed to happen?
3. In the examples I have there is a function to initialize GAP parameters directly using the SD API instead of SDK APIs. And certain parameters such as structures like device name couldnt be found in the SDK data structures, so is it correct that we have use to SD API to set some critical parameters such as device name? or Have I missed something?
4. "init.evt_handler = adv_event;" if i try to assign a event handler for advertisement module, i am getting a linker error, I am not sure whats the problem. Please find the error statement below.
"'adv_event' undeclared (first use in this function)"