Skip to content

Latest commit

 

History

History
190 lines (130 loc) · 6.39 KB

39.md

File metadata and controls

190 lines (130 loc) · 6.39 KB

0x39 CDC Status

CDC 0x18 → Radio 0x68

CDC as introduced- not MP3!

This command is one half of the CD changer playback control- the other being CDC Request 0x38. It is used by the CDC changer to report it's status to the radio.

Related Commands

  • 0x38 CDC Request

Examples

# CD Changer (1997), Radio: BM C23
18 0A 68 39 02 09 00 01 00 01 09 41
18 0A 68 39 02 09 00 21 00 07 63 0D
18 0A 68 39 03 02 00 21 00 07 64 00
18 0A 68 39 03 09 00 01 00 01 05 4C
18 0A 68 39 05 09 00 01 00 01 02 4D
18 0A 68 39 05 09 00 01 00 01 03 4C
18 0A 68 39 05 09 00 01 00 01 04 4B
18 0A 68 39 05 09 00 01 00 01 05 4A
18 0A 68 39 02 09 00 3F 00 01 01 77

The CDC in my 2001 540i introduced four additional bytes to this command. However, in my testing, the values of said four bytes never changed; as such, I've not covered it.

# CD Changer (2001), Radio: BM53
18 0E 68 39 00 82 00 01 00 01 03 00 01 01 01 C7
18 0E 68 39 02 89 00 01 00 01 09 00 01 01 01 C4
18 0E 68 39 01 8C 00 01 00 01 01 00 01 01 01 CA
18 0E 68 39 04 89 00 01 00 01 13 00 01 01 01 D8

Parameters

Fixed length. 7 data bytes.

Parameter Index Length Type
Status 0 1 Bitfield
Audio? 1 1 Bitfield
Error 2 1 Bitfield
Magazine 3 1 Bitfield
Unknown 4 1 Unknown
Disc 5 1 Integer (BCD)
Track 6 1 Integer (BCD)

Status

0x00: Stopped
0x01: Paused
0x02: Playing
0x03: FFW
0x04: RWD
0x05: Next Track
0x06: Previous Track
0x07: Pending/Acknowledge
0x08: Magazine Ready
0x09: Magazine Checking
0x0a: Magazine Ejected

Audio?

The apparent partial duplication of the Status byte suggests this has a different use. Possibly to do with flagging when CD changer is outputting audio?

# CD Changer (1997)
0x02: Stopped
0x09: Playing
0x0c: Ready?

For reference, the later CDC does distinguish itself here.

# CD Changer (2001)
# Ostensibly as per CDC (1997) but with an additional flag 0x80 (0b1000_0000) set.
0x82: Stopped
0x89: Playing
0x8c: Ready?

Error

Based on the incontiguous (sic) values, I presume there's other errors I've not seen in testing.

I'd guess this is a basic bitfield (i.e. 8 flags), rather than combination bitfield.

0x02: High Temp
0x08: No Disc
0x10: No Magazine

Magazine

This denotes which slots in the CD changer magazine are loaded with a disc.

MAGAZINE_SLOT_1 = 0b0010_0000
MAGAZINE_SLOT_2 = 0b0001_0000
MAGAZINE_SLOT_3 = 0b0000_1000
MAGAZINE_SLOT_4 = 0b0000_0100
MAGAZINE_SLOT_5 = 0b0000_0010
MAGAZINE_SLOT_6 = 0b0000_0001

Unknown

I've only ever seen this with a value of 0x00.

Disc

Integer.

I've not confirmed the encoding here. The MK1 GT applies a mask to the CD changer display which only allows a single digit for CD number, so it's somewhat moot.

# Example: CDC Disc No. 9
18 .. 68 39 00 09 00 00 00 09 05 ..         # Disc: 0x09
68 .. 3b 23 cb 20 43 44 20 35 2D 30 39 ..   # "CD 9-05"

Track

Integer. Binary coded decimal.

# Example: CDC Track No. 12
18 .. 68 39 02 09 00 01 00 01 12 ..         # Track 0x12
68 .. 3b 23 c4 20 43 44 20 31 2D 31 32 ..   # "CD 1-12"

# Example: CDC Track No. 16
18 .. 68 39 00 02 00 01 00 01 16 ..         # Track 0x16
68 .. 3b 23 c4 20 43 44 20 31 2D 31 36 ..   # "CD 1-16"

Use Cases

I haven't been exhaustive here as the behaviour can be a little inconsistent between radios/CD changers. I've attempted to highlight a few 'gotchas'.

Acknowledge

The radio and CD changer have a tumultuous relationship...

When the radio issues a CDC Request 0x38, it expects a specific response. Not only that, the radio expects a prompt response.

If the radio does not receive a timely, correct reply, it will effectively berate the CD changer until it receives it. As such, in the event that the CD changer can't immediately perform the requested action, i.e. the disc needs to spin up, the CD changer issues an acknowledgement of sorts, thus satisfying the radio's need for a timely response.

When able, the CD changer replies again with a status that reflects the radio request.

68 05 18 38 03 00 4E                    # Oi, CDC, start playing!
18 0A 68 39 07 09 00 01 00 01 02 4F     # Yes, sir, I'm on it, stand by!

# Time passes...

18 0A 68 39 02 09 00 01 00 01 02 4A     # Playing, sir!

Similarly, if the CDC speaks out of turn, i.e. when the radio is supposed to be off, and the CDC says anything other than "Stopped", the radio will repeatedly yell at the CDC to stop.

No Disc

# Based on last 0x39 update, the radio is aware that
# the magazine does not have discs in slots 3 and 4
18 .. 68 39 02 09 00 33 00 02 01 ..

# Thus, when user presses "3" on BMBT (to load disc 3)...
f0 .. 68 48 12 ..

# The radio can display "NO DISC" on display
68 .. 3b 23 c2 20 4E 4F 20 44 49 53 43 .. # "NO DISC"

No Magazine/CD Check

# Ejecting magazine while CD playing
18 .. 68 39 0A 02 00 3F 00 00 00 ..                   # CDC: Magazine Eject(ing)
68 .. 3b 23 c1 20 4E 4F 20 4D 41 47 41 5A 49 4E 45 .. # "NO MAGAZINE"

# Let's turn radio off while magazine out for shits and giggles
f0 .. 68 4b 06 30 ..                                  # [Power] Press
68 .. f0 4a 00 ..                                     # Radio LED off

# Let's turn it back on with magazine still out
f0 .. 68 4b 06 30 ..                                  # [Power] Press
68 .. f0 4a ff ..                                     # Radio LED on

# Radio remembers last CDC state
68 .. 3b 23 c1 20 4E 4F 20 4D 41 47 41 5A 49 4E 45 .. # "NO MAGAZINE"

# Radio checking in to see what's up, but still no magazine
68 .. 18 38 00 00 ..                                  # Radio: Get CDC status
18 .. 68 39 0A 02 00 3F 00 00 00 ..                   # CDC: Magazine Eject(ed)

# Let's load the magazine back in
18 .. 68 39 09 02 00 3F 00 00 00 ..                   # CDC: Magazine Checking
68 .. 3b 23 c3 20 43 44 20 43 48 45 43 4B ..          # "CD CHECK"

# Magazine loaded. go time!
18 .. 68 39 08 02 00 3F 00 00 00                      # CDC: Magazine Ready
68 .. gt 23 c4 20 43 44 20 20 2D 20 20                # "CD  -  "
68 .. 18 38 03 00                                     # Play!