Hi, I want to turn peripheral device from application mode to bootloader mode from a central device(not app), so I am trying to write value 0x01 to dfu service. Following is the parameters I set for sending message:
uint8_t value = 1; uint32_t dfu_conn_handle; ble_gattc_write_params_t dfu_params;
if (p_evt->evt_type == BLE_DB_DISCOVERY_COMPLETE)// &&
{
dfu_params.write_op = BLE_GATT_OP_WRITE_CMD;
dfu_params.flags = BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE;
dfu_params.handle = 0x0001;
dfu_params.offset = 0;
dfu_params.len = sizeof(value);
dfu_params.p_value = &value;
}
dfu_conn_handle = p_gap_evt->conn_handle;
err_code = sd_ble_gattc_write(dfu_conn_handle,&dfu_params);
Peripheral device turns to bootloader mode by nRF connect app. sd_ble_gattc_write() returning NRF_SUCCESS.
Please help me to understand where i am going wrong.