Re: Bluesaab software 5.1beta
Posted by
Karlis on
Jul 18, 2017; 6:01pm
URL: http://bluesaab-forum.90.s1.nabble.com/Bluesaab-software-5-1beta-tp1140p1143.html
Currently we read track metadata on RN52 status change event (GPIO2 pin goes low for 100ms). Per spec, when this happens, micro controller has to push the RN52 in CMD mode and request it's status via "Q" command. Then, once that's done, we determine that there has been a track change event and issue "AD" command to read track/artist metadata info in two different buffers. If we don't get anything in the buffers, the SID text defaults to "BlueSaab". Or if there's only "artist" or "track" we will display only that.
I guess there are two problems here: "slow" baudrate (9600) and the fact that SoftwareSerial is half-duplex. To simplify, if there's some gibberish seen on the wire, we will ignore that. And there's a lot of ambiguity, especially with longer artist/track names. This might be worked around somehow but I haven't looked into this yet and not sure if I will.
As for the second issue: yes, BlueSaab keeps info in both buffers upon switching off. Hence the next time BlueSaab is engaged, it takes a while for RN52 to realize that there's another track being played, engage the GPIO2 and signal 328 to come and fetch new track metadata. This could be worked around by flushing the buffers upon exiting CDC mode on IHU. Should be an easy fix (famous last words...).
2001 9-5 SE V6; 2006 9-5 Wagon; iOS; BlueSaab version = "latest and greatest" :)