Posted by
Da Bear on
Jun 06, 2016; 10:48pm
URL: http://bluesaab-forum.90.s1.nabble.com/Custom-CDC-to-SID-text-tp90p422.html
My observations so far. A little bit different than Karlis. (WALL OF TEXT

)
IHU NODE ID = 19
348 is IHU TEXT CONTROL ID
IHU sends (To SID) 348 -> 11 2 3 19 0 0 0 0
Byte 0, is always 11
Byte 1, can be either 02 or 82. 02 = text not changed. 82 = new text
Byte 2, NODE ID (19 for IHU)
SID response with a grop of three 368 (Or does it? It might be sending 368 regardless, need to check this)
368 -> 0 FF 0 0 0 0 0 0
368 -> 1 FF 0 0 0 0 0 0
368 -> 2 19 0 0 0 0 0 0
368 is like a gatekeeper and decides what NODE is allowed to write is't text
Byte 0; SID ROW. 0 = Both rows. 1 = ROW 1. 2 = ROW 2.
In the above, both rows are free and NODE 19 (IHU) is granted write access.
IHU then sends a group of three 328:
328 -> 42 96 2 43 44 31 20 50
328 -> 1 96 2 4C 41 59 20 20
328 -> 0 96 2 20 20 0 0 0
328 is IHU TEXT to SID
Byte 0 in the first group, is always 42 when only writing to SID ROW 2. (If it was 45, it would start writing at SID ROW 1 (And counting down; 04 - row 1 col 2, 03 - row 1 col 3 etc...))
Byte 1 is the NODE ID (should be) of the SID.
Byte 2 can be either 02 or 82. 02 = text not changed. 82 = new text
Since I have OpenSID activated in my car I could sniff what that send to the SID.
This is what I have now
OpenSID NODE ID = 32
OpenSID TEXT CONTROL ID = 358
OpenSID TEXT TO SID = 33F
But since NODE 32 is very high priority it takes over the SID and any NODE with lower ID don't stand a chance to get write access to the SID, especially SID ROW 2, when something wants access to both rows.
As of now I monitor 368 and stores byte 1 from all three 368 messages in an array.
(Why? Because I need to know the state of ALL rows before I can make a decision to give write access or not, since the code now loops and don't care if its row 0, 1 or 2 that has values in them
).arr[0] -> byte 1 from 368 00 FF ...
arr[1] -> byte 1 from 368 01 FF ...
arr[2] -> byte 1 from 368 01 FF ...
Then I can take actions from that and allow the bt module to write or not.
So if arr[0] is anything else than FF, the bt module is not allowed to write.
If arr[2] is 19 or 32, but nothing else, the module is allowed to write.
Nothing of the above, the module can write.
Example:
I get this in my 368 array
0: 0xFF <-- Both rows free
1: 0xFF <-- Row 1 is free
2: 0x32 <-- Row 2 is available for node 32
- Module is allowed to write
I send a TEXT CONTROL to SID to tell it that text is on the way to ROW 2
358 -> 21 2 3 32 0 0 0 0 (Byte 0 must be 21)
delay 5-10 ms
I then send my text in a group of three with a delay between so the SID can keep up.
33Fh 42 96 82 xx xx xx xx xx
delay 5-10 ms
33Fh 1 96 82 xx xx xx xx xx
delay 5-10 ms
33Fh 0 96 82 xx xx xx xx xx
33F byte 2 is then changed to 02 when I send the same text again.
If the text changes, byte 2 changes to 82 again.
Second example:
I get this in my 368 array
0: 0x23 <-- Both rows are occupied by ACC
1: 0xFF
2: 0x32
- Module is NOT allowed to write
Third example:
I get this in my 368 array
0: 0xFF <-- Both rows free
1: 0x0F
2: 0x32
- Module is allowed to write.
ROW 1, byte 1, 0x0F is the text "CHECKING" / "CHECK OK" displayed in SID when turning on the ignition.
It's not 100% perfect, but my text "BLUETOOTH" is there 95% (some flickering is still there, timing issues?) of the time without f-ing up SID ( like my previous attempt just grabbing a node id out of my a$$

).
I have not fully tested forcing other NODEs to send messages, but ACC gets through without any problems.
NODE IDs I have found so far:
Lower ID = lower priority to send text to SID, ie ACC overrides IHU. OpenSID overrrides everything.
0x12 = SPA
0x19 = IHU
0x21 = TRIONIC
0x23 = ACC
0x2D = TWICE
0x32 = OpenSID
0xFF = Nothing
0x348 = IHU_SID_TEXT_CONTROL
0x328 = IHU_SID_TEXT
0x358 = OPEN_SID_TEXT_CONTROL
0x33F = OPEN_SID_TEXT
0x357 = SPA_SID_TEXT_CONTROL
0x337 = SPA_SID_TEXT
0x356 = T7_SID_TEXT_CONTROL
0x338 = T7_SID_TEXT
Work in progress...
TODO:
Check that every NODE except IHU can take over the SID when needed.
Sort out timing so the text doesn't flicker.
Take control over both rows in SID to display Title/Artist etc.
Saab 9-5 Aero MY01 AS3 - 270hp/240hp Biopower
Saab 9-5 SE MY00 AS1 - 210hp+