nrf5/drivers/bluetooth: Moving stop condition initialization before call to bluetooth stack write function is done, to make sure that its not overwritten after reception of the write event in case of with_response writes.

This commit is contained in:
Glenn Ruben Bakke 2017-05-30 23:23:31 +02:00
parent b17665b8ad
commit a81de242c5
1 changed files with 2 additions and 2 deletions

View File

@ -696,10 +696,10 @@ void ble_drv_attr_c_write(uint16_t conn_handle, uint16_t handle, uint16_t len, u
write_params.len = len;
write_params.p_value = p_data;
uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params);
m_write_done = !w_response;
uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params);
if (err_code != 0) {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError,
"Can not write attribute value. status: 0x" HEX2_FMT, (uint16_t)err_code));