InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.64k stars 902 forks source link

Fixes #1895: use just 2 bytes header according to GATT specification #1938

Closed jmlich closed 5 months ago

jmlich commented 6 months ago

In my opinion the implementation should be fixed to comply with specification. The extra byte is just skipped

github-actions[bot] commented 6 months ago
Build size and comparison to main: Section Size Difference
text 369544B -16B
data 940B 0B
bss 63516B 0B
FintasticMan commented 5 months ago

I don't think the 3rd byte is ignored though? It'll still be copied into the notification string, and thus the max message size is practically 1 char smaller when using a header of 3 bytes.

jmlich commented 5 months ago

You are right. It seems the 3rd byte should be send only in case when Category CustomHuami is used:

https://github.com/Freeyourgadget/Gadgetbridge/blob/275deb4d06de6b64c0d7e73d13f6f2ad2879fe25/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/profiles/alertnotification/AlertNotificationProfile.java#L106

https://github.com/piggz/harbour-amazfish/blob/1462454cbc9489fead578ccad2ce030c35e0b329/daemon/src/services/alertnotificationservice.cpp#L20

I will update my pull request according to that.