aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2012-06-12 14:18:35 -0300
committerJoão Paulo Rechi Vita <jprvita@openbossa.org>2012-06-19 14:06:38 -0300
commitf917a038ec3fb5b91625e9119f6e98cefd6190e5 (patch)
treedc00e032832482e40c70f3843a981980da789d73
parente15aceb86c8563f90319f31d690ebbb849fd7020 (diff)
downloadbluez-f917a038ec3fb5b91625e9119f6e98cefd6190e5.tar.gz
bluez-f917a038ec3fb5b91625e9119f6e98cefd6190e5.tar.xz
bluez-f917a038ec3fb5b91625e9119f6e98cefd6190e5.zip
generic attribute: Use GAttrib buffer
This patch replaces the static local buffer by the GAttrib internal buffer to temporarily store the output ATT PDU.
-rw-r--r--attrib/client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/attrib/client.c b/attrib/client.c
index 8d119df0..a90f22b0 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: