Diff between db25f7c6fa1a6b5bb470e4c74fbe404c571a4f84 and c902816cc2cef9e063cd9ff0717ad059b1d3b214

Changed Files

File Additions Deletions Status
attrib/client.c +4 -2 modified

Full Patch

diff --git a/attrib/client.c b/attrib/client.c
index b3e3abe..d9c1a2a 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -269,9 +269,10 @@ static void events_handler(const uint8_t *pdu, uint16_t len,
 	struct gatt_service *gatt = user_data;
 	struct characteristic *chr;
 	GSList *l;
-	uint8_t opdu[ATT_MAX_MTU];
+	uint8_t *opdu;
 	guint handle;
 	uint16_t olen;
+	int plen;
 
 	if (len < 3) {
 		DBG("Malformed notification/indication packet (opcode 0x%02x)",
@@ -295,7 +296,8 @@ static void events_handler(const uint8_t *pdu, uint16_t len,
 
 	switch (pdu[0]) {
 	case ATT_OP_HANDLE_IND:
-		olen = enc_confirmation(opdu, sizeof(opdu));
+		opdu = g_attrib_get_buffer(gatt->attrib, &plen);
+		olen = enc_confirmation(opdu, plen);
 		g_attrib_send(gatt->attrib, 0, opdu[0], opdu, olen,
 						NULL, NULL, NULL);
 	case ATT_OP_HANDLE_NOTIFY: