Skip to content

Commit a81de24

Browse files
committed
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.
1 parent b17665b commit a81de24

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nrf5/drivers/bluetooth/ble_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,10 @@ void ble_drv_attr_c_write(uint16_t conn_handle, uint16_t handle, uint16_t len, u
696696
write_params.len = len;
697697
write_params.p_value = p_data;
698698

699-
uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params);
700-
701699
m_write_done = !w_response;
702700

701+
uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params);
702+
703703
if (err_code != 0) {
704704
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError,
705705
"Can not write attribute value. status: 0x" HEX2_FMT, (uint16_t)err_code));

0 commit comments

Comments
 (0)