static void advertising_start(bool erase_bonds) { if (erase_bonds == true) { delete_bonds(); // Advertising is started by PM_EVT_PEERS_DELETE_SUCCEEDED event. } else { ret_code_t err_code; err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST); APP_ERROR_CHECK(err_code); } }
I think this method is different from the example of the ble_app_uart, is it okay to use the same code? or is there another way?
static void advertising_start(void) //bluetooth scanning start { ret_code_t err_code; err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG); APP_ERROR_CHECK(err_code); bsp_board_led_on(ADVERTISING_LED); //led1 } static void advertising_stop() { ret_code_t err_code; err_code = sd_ble_gap_adv_stop(m_adv_handle); APP_ERROR_CHECK(err_code); bsp_board_led_off(ADVERTISING_LED); //led1 }