@@ -582,7 +582,7 @@ BLEDevice ATTClass::central()
582
582
return BLEDevice ();
583
583
}
584
584
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)
586
586
{
587
587
int numNotifications = 0 ;
588
588
@@ -600,9 +600,9 @@ bool ATTClass::handleNotify(uint16_t handle, const uint8_t* value, int length)
600
600
memcpy (¬ification[1 ], &handle, sizeof (handle));
601
601
notificationLength += sizeof (handle);
602
602
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;
606
606
607
607
// / TODO: Set encryption requirement on notify.
608
608
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)
613
613
return (numNotifications > 0 );
614
614
}
615
615
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)
617
617
{
618
618
int numIndications = 0 ;
619
619
@@ -631,9 +631,10 @@ bool ATTClass::handleInd(uint16_t handle, const uint8_t* value, int length)
631
631
memcpy (&indication[1 ], &handle, sizeof (handle));
632
632
indicationLength += sizeof (handle);
633
633
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;
637
638
638
639
_cnf = false ;
639
640
0 commit comments