@@ -2042,3 +2042,29 @@ bool bt_att_has_crypto(struct bt_att *att)
return att->crypto ? true : false;
}
+
+bool bt_att_set_retry(struct bt_att *att, unsigned int id, bool retry)
+{
+ struct att_send_op *op;
+
+ if (!id)
+ return false;
+
+ op = queue_find(att->req_queue, match_op_id, UINT_TO_PTR(id));
+ if (op)
+ goto done;
+
+ op = queue_find(att->ind_queue, match_op_id, UINT_TO_PTR(id));
+ if (op)
+ goto done;
+
+ op = queue_find(att->write_queue, match_op_id, UINT_TO_PTR(id));
+
+done:
+ if (!op)
+ return false;
+
+ op->retry = !retry;
+
+ return true;
+}
@@ -110,3 +110,4 @@ bool bt_att_set_local_key(struct bt_att *att, uint8_t sign_key[16],
bool bt_att_set_remote_key(struct bt_att *att, uint8_t sign_key[16],
bt_att_counter_func_t func, void *user_data);
bool bt_att_has_crypto(struct bt_att *att);
+bool bt_att_set_retry(struct bt_att *att, unsigned int id, bool retry);
@@ -3818,3 +3818,22 @@ bool bt_gatt_client_idle_unregister(struct bt_gatt_client *client,
return false;
}
+
+bool bt_gatt_client_set_retry(struct bt_gatt_client *client,
+ unsigned int id,
+ bool retry)
+{
+ struct request *req;
+
+ if (!client || !id)
+ return false;
+
+ req = queue_find(client->pending_requests, match_req_id,
+ UINT_TO_PTR(id));
+ if (!req)
+ return false;
+
+ bt_att_set_retry(client->att, req->att_id, retry);
+
+ return true;
+}
@@ -134,3 +134,6 @@ unsigned int bt_gatt_client_idle_register(struct bt_gatt_client *client,
bt_gatt_client_destroy_func_t destroy);
bool bt_gatt_client_idle_unregister(struct bt_gatt_client *client,
unsigned int id);
+bool bt_gatt_client_set_retry(struct bt_gatt_client *client,
+ unsigned int id,
+ bool retry);