Diff between bc60ca0c5a56b9bedb7baca021e21be1b8ee8849 and 0986ba25f3e2b92697ef6e99871fbf39c3bd1c6f

Changed Files

File Additions Deletions Status
src/shared/gatt-helpers.c +6 -7 modified
src/shared/gatt-helpers.h +1 -1 modified

Full Patch

diff --git a/src/shared/gatt-helpers.c b/src/shared/gatt-helpers.c
index 2d07a83..bad20d9 100644
--- a/src/shared/gatt-helpers.c
+++ b/src/shared/gatt-helpers.c
@@ -535,13 +535,14 @@ done:
 		op->callback(success, att_ecode, op->user_data);
 }
 
-bool bt_gatt_exchange_mtu(struct bt_att *att, uint16_t client_rx_mtu,
+unsigned int bt_gatt_exchange_mtu(struct bt_att *att, uint16_t client_rx_mtu,
 					bt_gatt_result_callback_t callback,
 					void *user_data,
 					bt_gatt_destroy_func_t destroy)
 {
 	struct mtu_op *op;
 	uint8_t pdu[2];
+	unsigned int id;
 
 	if (!att || !client_rx_mtu)
 		return false;
@@ -558,14 +559,12 @@ bool bt_gatt_exchange_mtu(struct bt_att *att, uint16_t client_rx_mtu,
 
 	put_le16(client_rx_mtu, pdu);
 
-	if (!bt_att_send(att, BT_ATT_OP_MTU_REQ, pdu, sizeof(pdu),
-							mtu_cb, op,
-							destroy_mtu_op)) {
+	id = bt_att_send(att, BT_ATT_OP_MTU_REQ, pdu, sizeof(pdu), mtu_cb, op,
+								destroy_mtu_op);
+	if (!id)
 		free(op);
-		return false;
-	}
 
-	return true;
+	return id;
 }
 
 static inline int get_uuid_len(const bt_uuid_t *uuid)
diff --git a/src/shared/gatt-helpers.h b/src/shared/gatt-helpers.h
index 0217e82..cf92075 100644
--- a/src/shared/gatt-helpers.h
+++ b/src/shared/gatt-helpers.h
@@ -65,7 +65,7 @@ typedef void (*bt_gatt_discovery_callback_t)(bool success, uint8_t att_ecode,
 						struct bt_gatt_result *result,
 						void *user_data);
 
-bool bt_gatt_exchange_mtu(struct bt_att *att, uint16_t client_rx_mtu,
+unsigned int bt_gatt_exchange_mtu(struct bt_att *att, uint16_t client_rx_mtu,
 					bt_gatt_result_callback_t callback,
 					void *user_data,
 					bt_gatt_destroy_func_t destroy);