I am trying to change after 10 seconds into non-connectable mode. I am using the below code for initializing:
static void advertising_init(void) { ret_code_t err_code; ble_advertising_init_t init; uint8_t flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE; ble_advdata_manuf_data_t manu_data; memset(&init, 0, sizeof(init)); uint8_t data[23]; data[0] = 0x02; data[1] = 0x15; // memcpy(&data[2],ib_uuid,16); // memcpy(&data[18],ib_major,2); // memcpy(&data[20],ib_minor,2); // memcpy(&data[2],ib_uuid,16); // memcpy(&data[18],major_value_global,2); // memcpy(&data[20],minor_value_global,2); memcpy(&data[2],UUID_global,16); data[19] = major_value_global & 0x00FF; data[18] = (major_value_global & 0xFF00) >> 8; data[21] = minor_value_global & 0x00FF; data[20] = (minor_value_global & 0xFF00) >> 8; data[22] = 0xCE; manu_data.company_identifier = 0X004C; manu_data.data.p_data = data; manu_data.data.size = sizeof(data); //ibeacon init.advdata.flags = flags; init.advdata.p_manuf_specific_data = &manu_data; uint32_t adv_interval_temp = (adv_interval_time_global * 100) / 0.625; //Since the adv_interval_time_global is now a value of multiplier. init.config.ble_adv_fast_enabled = true; init.config.ble_adv_fast_interval = adv_interval_temp; init.evt_handler = on_adv_evt; 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); }
I want to change mode into non-connectable using this type of advertisement method only atm.