Hello everyone,
I'm trying to use the new SDK 15.0.0 and the S140 soft device V6.0.0. I would like to use the LE CODED physical layer and set my TX output power, but when I try to setup my advertisment like this :
static void advertising_init(void) { uint32_t err_code; ble_advdata_t advdata; ble_advdata_manuf_data_t manuf_specific_data; ble_gap_conn_sec_mode_t sec_mode; int8_t tx_power = 0; uint8_t flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED; //err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV,m_adv_handle, tx_power); //APP_ERROR_CHECK(err_code); //sd_power_dcdc_mode_set(1); memset(&manuf_specific_data, 0, sizeof(manuf_specific_data)); manuf_specific_data.data.p_data = (uint8_t *)BLE_data; manuf_specific_data.data.size = sizeof(BLE_data); manuf_specific_data.company_identifier = Compagny_identifier; BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode); err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *) DEVICE_NAME, strlen(DEVICE_NAME)); // Build and set advertising data. memset(&advdata, 0, sizeof(advdata)); advdata.name_type = BLE_ADVDATA_SHORT_NAME; advdata.short_name_len = strlen(DEVICE_NAME); advdata.flags = flags; advdata.p_manuf_specific_data = &manuf_specific_data; // Initialize advertising parameters (used when starting advertising). memset(&m_adv_params, 0, sizeof(m_adv_params)); m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; m_adv_params.p_peer_addr = NULL; // Undirected advertisement. m_adv_params.filter_policy = BLE_GAP_ADV_FP_ANY; m_adv_params.interval = NON_CONNECTABLE_ADV_INTERVAL; m_adv_params.duration = 0; // Never time out. m_adv_params.primary_phy = BLE_GAP_PHY_CODED; //Long Range m_adv_params.secondary_phy = BLE_GAP_PHY_CODED; //Long Range err_code = ble_advdata_encode(&advdata, m_adv_data.adv_data.p_data, &m_adv_data.adv_data.len); APP_ERROR_CHECK(err_code); err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params); APP_ERROR_CHECK(err_code); }
I get an app_error_fault_handler . I don't understand why ... The LE CODED isn't yet supported for broadcasting ? and why the TX POWER set doesn't work as I implemented it?
Sincerely,
Sylvain.