@@ -582,7 +582,7 @@ BLEDevice ATTClass::central()
582582 return BLEDevice ();
583583}
584584
585- bool ATTClass::handleNotify (uint16_t handle, const uint8_t * value, int length)
585+ bool ATTClass::handleNotify (uint16_t handle, const uint8_t * value, uint16_t * length)
586586{
587587 int numNotifications = 0 ;
588588
@@ -600,9 +600,9 @@ bool ATTClass::handleNotify(uint16_t handle, const uint8_t* value, int length)
600600 memcpy (¬ification[1 ], &handle, sizeof (handle));
601601 notificationLength += sizeof (handle);
602602
603- length = min ((uint16_t )(_peers[i].mtu - notificationLength), ( uint16_t ) length);
604- memcpy (¬ification[notificationLength], value, length);
605- notificationLength += length;
603+ * length = min ((uint16_t )(_peers[i].mtu - notificationLength), * length);
604+ memcpy (¬ification[notificationLength], value, * length);
605+ notificationLength += * length;
606606
607607 // / TODO: Set encryption requirement on notify.
608608 HCI.sendAclPkt (_peers[i].connectionHandle , ATT_CID, notificationLength, notification);
@@ -613,7 +613,7 @@ bool ATTClass::handleNotify(uint16_t handle, const uint8_t* value, int length)
613613 return (numNotifications > 0 );
614614}
615615
616- bool ATTClass::handleInd (uint16_t handle, const uint8_t * value, int length)
616+ bool ATTClass::handleInd (uint16_t handle, const uint8_t * value, uint16_t * length)
617617{
618618 int numIndications = 0 ;
619619
@@ -631,9 +631,10 @@ bool ATTClass::handleInd(uint16_t handle, const uint8_t* value, int length)
631631 memcpy (&indication[1 ], &handle, sizeof (handle));
632632 indicationLength += sizeof (handle);
633633
634- length = min ((uint16_t )(_peers[i].mtu - indicationLength), (uint16_t )length);
635- memcpy (&indication[indicationLength], value, length);
636- indicationLength += length;
634+ *length = min ((uint16_t )(_peers[i].mtu - indicationLength), *length);
635+
636+ memcpy (&indication[indicationLength], value, *length);
637+ indicationLength += *length;
637638
638639 _cnf = false ;
639640
0 commit comments