InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

AlertNotification Service/Client are not compliant to the spec

Open JF002 opened this issue 1 year ago • 4 comments

Verification

  • [X] I searched for similar bug reports (including closed issues) and found none was relevant.

What happened?

AlertNotification Service/Client use a 3 bytes header, the spec defines a 2 bytes header

What should happen instead?

AlertNotification Service/Client should comply to the BLE spec.

Reproduction steps

N/A

More details?

This issue was reported by the Amazfish community : InfiniTime expects the header of all notifications is a 3 bytes header (here and here).

However, the GATT spec specifies a header of 2 bytes.

Now, even if InfiniTime is not 100% compliant, all companion apps have currently implemented this 3 bytes header, and changing this might break the compatibility with those companion apps so I'm not sure if we should fix this. If we do want to change the header size, we'll have to communicate with companion app developers to ensure smooth transition.

It might be possible to support both 2 and 3 bytes header by checking the value of the 3rd byte of the buffer : it can be ignored if it's equal to 0x00 or lower than 0x20.

The documentation should however be completed to mention that this is not completely compliant to the spec of the AlertNotificationService.

Version

<=1.13.0

Companion app

All

JF002 avatar Oct 23 '23 19:10 JF002

It might be possible to support both 2 and 3 bytes header by checking the value of the 3rd byte of the buffer : it can be ignored if it's equal to 0x00 or lower than 0x20.

This might be a good temporary solution. Support both while transitioning all the companion apps, then the support for the 3 byte header can be removed once all the apps have moved over to comply with the new header size

KaffeinatedKat avatar Oct 24 '23 14:10 KaffeinatedKat

For Amazfish is it one line to change. Line https://github.com/piggz/harbour-amazfish/blob/master/daemon/src/devices/pinetimejfdevice.cpp#L103 to

        alert->incomingCall(QByteArray::fromHex("0301"), caller);

jmlich avatar Oct 27 '23 07:10 jmlich

I vote to change it, because not being standard compliant only gets worse with time, right?

minacode avatar Nov 05 '23 11:11 minacode

I vote to change it, because not being standard compliant only gets worse with time, right?

agreed 🤝

Nobody2303 avatar Nov 07 '23 12:11 Nobody2303