piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 51 forks source link

There was missing first letter in notification #286

Closed jmlich closed 10 months ago

jmlich commented 10 months ago

I am not sure if this works properly also on other smartwatches, but on PineTime this definitely helps.

It seems generic alert message is used for phone call, but it is composed in different way. The alert is category (one byte ) + alert_type=1 ( one byte ) + icon(one byte) + sender (32 bytes) + separator (one byte) +subject (128bytes) + separator=\n (two bytes) + message (128bytes)

PineTime doesn't counts lenght sender+subject+message, together and clips it to 100 bytes

The incommingCall() composes message like this 03 01 + caller_id I believe that header should be 3 bytes (I have added 0x01 for icon) 03 01 01 + caller_id

And finally proof with picture:

image20231017_181829517 image20231017_181836912

The notification was send from debug dialog.

piggz commented 10 months ago

Ive tested the original code with an Amazfit GTS, and it works as expected ... need to find the ANS spec!

jmlich commented 10 months ago

Related documentation of InfiniTime can be found here https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/ble.md#notifications

and I can see that I was actually wrong. It should be 03 01 00 ,

<03 is for call> <01 number of notifications> <00 separator>
piggz commented 10 months ago

Yeah, i found that ... JF reminded me that the protocol hasnt changed since it was first committed ... and the person that wrote it was me! :laughing:

Technically its -wrong- ... the spec is 2 bytes ... however ... its already implemented, so, im torn!

piggz commented 10 months ago

In any case .. we cant send this 3 byte header for calls to the Amazfit devices, so, need some flag to specify this.

jmlich commented 10 months ago

I hope, that provided patch makes it compatible with Amazfit