tedsalmon / BlueBus

A Bluetooth module for vehicles equipped with I-Bus
Other
169 stars 41 forks source link

Add Unicode Extended-latin characters transformation into ASCII for CallerID & Audio Metadata, do buffer overrun checks. #82

Closed nabucho closed 3 years ago

nabucho commented 3 years ago

Based on https://www.ucas.com/sites/default/files/extended-character-sets-substitutions.pdf and https://stackoverflow.com/a/10831704 I adapted the code into BlueBus, to provide a better display of Extended Latin characters in metadata.

Still more room for playing around, e.g. for things that can be interpreted with multiple characters - like 1/4, 1/2, ss, and others, where the framework is there already but that would need more constants and code writing.

nabucho commented 3 years ago

Looks like Apple is not sending the chars in CLIP event, following the ( https://www.silabs.com/documents/public/application-notes/AN992.pdf ) and ( https://www.etsi.org/deliver/etsi_ts/127000_127099/127007/10.03.00_60/ts_127007v100300p.pdf ) The charset used in CLIP by default is IRA ( 7 bit international reference alphabet ). We need to issue additional AT command after connection initialization on the HFP link:

AT+CSCS="UTF-8"

This should let iPhone to return UTF8 CLIP names, that then will be properly displayed by Navi.

However - need to recompile and flash to test, unless wh have a way to issue raw commands to BC127 from terminal ( which could be handy in fact ).

nabucho commented 3 years ago

The mapping to characters without accents is really only needed for CD53 - so this whole Pull-request is bad and should not be considered as is at all.