diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index c70b1d6..1f23522 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
static void events_handler(const uint8_t *pdu, uint16_t len, gpointer user_data)
{
GAttrib *attrib = user_data;
- uint8_t opdu[ATT_MAX_MTU];
+ uint8_t *opdu;
uint16_t handle, i, olen = 0;
+ int plen;
handle = att_get_u16(&pdu[1]);
if (pdu[0] == ATT_OP_HANDLE_NOTIFY)
return;
- olen = enc_confirmation(opdu, sizeof(opdu));
+ opdu = g_attrib_get_buffer(attrib, &plen);
+ olen = enc_confirmation(opdu, plen);
if (olen > 0)
g_attrib_send(attrib, 0, opdu[0], opdu, olen, NULL, NULL, NULL);
diff --git a/attrib/interactive.c b/attrib/interactive.c
index 1cdbfef..3657798 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
static void events_handler(const uint8_t *pdu, uint16_t len, gpointer user_data)
{
- uint8_t opdu[ATT_MAX_MTU];
+ uint8_t *opdu;
uint16_t handle, i, olen;
+ int plen;
handle = att_get_u16(&pdu[1]);
if (pdu[0] == ATT_OP_HANDLE_NOTIFY)
return;
- olen = enc_confirmation(opdu, sizeof(opdu));
+ opdu = g_attrib_get_buffer(attrib, &plen);
+ olen = enc_confirmation(opdu, plen);
if (olen > 0)
g_attrib_send(attrib, 0, opdu[0], opdu, olen, NULL, NULL, NULL);