Diff between e5e9af0cca9cf5d5521f186f5726f75ae84433f7 and b7b73fcfa6ef1787acbe753b1402aa2d795d1725

Changed Files

File Additions Deletions Status
android/gatt.c +3 -3 modified

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index 1a6de64..13f4dfa 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -6169,6 +6169,9 @@ static uint8_t mtu_att_handle(const uint8_t *cmd, uint16_t cmd_len,
 	if (!get_local_mtu(dev, &mtu))
 		return ATT_ECODE_UNLIKELY;
 
+	if (!update_mtu(dev, rmtu))
+		return ATT_ECODE_UNLIKELY;
+
 	rsp = g_attrib_get_buffer(dev->attrib, &length);
 
 	/* Respond with our MTU */
@@ -6176,9 +6179,6 @@ static uint8_t mtu_att_handle(const uint8_t *cmd, uint16_t cmd_len,
 	if (!len)
 		return ATT_ECODE_UNLIKELY;
 
-	if (!update_mtu(dev, rmtu))
-		return ATT_ECODE_UNLIKELY;
-
 	g_attrib_send(dev->attrib, 0, rsp, len, NULL, NULL, NULL);
 
 	return 0;