Long range data transfer from central to peripheral

Hi,

 In my application i am trying out to transfer data in Long range BLE_GAP_PHY_CODED mode , i have set my peripheral has to advertise in PHY coded mode below is the advertising init function which changed to phy coded. i am using ble_app_blinky_c  for central and ble_app_blinky  example in peripheral

static void advertising_init_phycoded(uint16_t adv_timeout)
{
ret_code_t err_code;
ble_advdata_t advdata;
ble_advdata_t srdata;
ble_advdata_manuf_data_t manuf_specific_data;

manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;
manuf_specific_data.data.p_data = (uint8_t *) NORMAL_BEACON;
manuf_specific_data.data.size = APP_BEACON_INFO_LENGTH;

// ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, m_lbs.uuid_type}};

// Build and set advertising data.
memset(&advdata, 0, sizeof(advdata));

// advdata.name_type = BLE_ADVDATA_NO_NAME;
advdata.include_appearance = false;
advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
advdata.p_manuf_specific_data = &manuf_specific_data;
memset(&srdata, 0, sizeof(srdata));
// srdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
// srdata.uuids_complete.p_uuids = adv_uuids;

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 = ble_advdata_encode(&srdata, m_adv_data.scan_rsp_data.p_data, &m_adv_data.scan_rsp_data.len);
APP_ERROR_CHECK(err_code);

ble_gap_adv_params_t adv_params;

// Set advertising parameters.
memset(&adv_params, 0, sizeof(adv_params));

adv_params.primary_phy = BLE_GAP_PHY_CODED;
adv_params.secondary_phy = BLE_GAP_PHY_CODED;
adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
// }
// else{
// adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED;
// }
adv_params.p_peer_addr = NULL;
adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
adv_params.scan_req_notification = 1;
if(battery_level == 0 || battery_level >= BATTERY_VOLTAGE_MIN_FOR_DISPLAY){
adv_params.interval = COASTER_ADV_INTERVAL;
}
else{
adv_params.interval = LOW_LEVEL_BATTERY_INTERVAL;
}
adv_params.duration = adv_timeout; // Never time out.

err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &adv_params);
APP_ERROR_CHECK(err_code);
sd_ble_gap_adv_set_configure(&m_adv_handle,&m_adv_data,&adv_params);
NRF_LOG_INFO("m_adv_data.adv_data.p_data address %p", m_adv_data.adv_data.p_data);
}

same as my central is in scannng the beacon which is in phy coded and gets connected also but no data transfrer happens after MTU request gets disconnecting from the peripheral .

#define SCAN_INTERVAL (2*0x00A0) /**< Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW 0x00A0 /**< Determines scan window in units of 0.625 millisecond. */
#define SCAN_DURATION 0x0000


static ble_gap_scan_params_t m_scan_param = /**< Scan parameters requested for scanning and connection. */
{
.active = 0x01,
.interval = SCAN_INTERVAL,
.window = SCAN_WINDOW,
.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
.timeout = SCAN_DURATION,
.scan_phys = BLE_GAP_PHY_1MBPS|BLE_GAP_PHY_CODED,
.extended = 1,
};

please advise what i have missed here for PHY coded data transfer .

Thanks in advance.

best regards.

Related