# Secondary Display (LSG 0x2B) Overview
The Secondary Display service allows external devices (typically the Bluetooth module) to display information on the instrument cluster's secondary display area. This includes phone status, call lists, messages, and media information.
## Components
- **ASG** (Anwendungs-Steuergerät): Application control unit (Bluetooth module)
- **FSG** (Funktions-Steuergerät): Function control unit (instrument cluster)
- **LSG** (Logische Steuergeräte Gruppe): Logical control unit group (Secondary Display)
## CAN Communication
### CAN IDs
| CAN ID | Name | Direction | Description |
| ------ | -------------- | ---------- | -------------------- |
| 0x66F | BAP_Telefon_04 | FSG → ASG | Display to BT module |
| 0x67C | BAP_ASG_07 | ASG → FSG | BT module to display |
## Function Definitions
Secondary Display uses the standard BAP functions (0x01-0x17). See [[core/Opcodes and Function IDs|Opcode & Function Reference]] for standard definitions.
### SD-Specific Function Details
#### 0x10 - ASG_Capabilities
Declares the display's physical capabilities to the FSG.
```
[Display_Size(1)][Visible_Elements(1)]
```
**Display Sizes:**
- `0x00`: Small (3 lines)
- `0x01`: Medium (5 lines)
- `0x02`: Large (8+ lines)
**Example:** `00 03` = Small display with 3 visible elements
#### 0x11 - ASG_Config
Configuration parameters for the ASG.
```
[Menu_Type(1)][Config_Flags(1)]
```
#### 0x12 - MFL_BlockDefinition
Maps multi-function steering wheel buttons to functions.
```
[KB0(1)][KB1(1)][KB2(1)][KB3(1)][KB4(1)][KB5(1)][KB6(1)][KB7(1)]
```
Each byte defines a key block assignment for steering wheel controls.
#### 0x13 - FrameStatus
Reports the status of display frames/screens.
```
[Frame_ID(1)][Priority(1)][MFL_Assigned(1)][ASG_Response(1)][FSG_Request(1)]
```
**Frame IDs:**
- `0x00`: Invalid
- `0x01-0x07`: Frame 1-7
- `0xFE`: Any frame
- `0xFF`: Not available
#### 0x14 - FrameData
The main function for sending display content.
```
[Screen_ID(1)][Line_Entry_1][Line_Entry_2]...[Line_Entry_N]
```
**Line Entry Structure:**
```
[Line_Number(1)][Flags_High(1)][Flags_Low(1)][Length(1)][Text_with_Icons(N)]
```
**Extended Length Format** (for lines >127 characters):
```
[Line_Number(1)][Flags_High(1)][Flags_Low(1)][0x80+][Actual_Length(1)][Text(N)]
```
#### 0x15 - FrameDataAck
Acknowledges receipt of frame data.
```
[Screen_ID(1)]
```
#### 0x16 - ScrollBar/CurrentScreen
Controls screen selection and scrollbar position.
```
[Current_Frame(1)][Scroll_Position_High(1)][Scroll_Position_Low(1)][Total_Items(1)]
```
#### 0x17 - LsgStatus
Reports operational status of the LSG.
```
[Status(1)]
```
- `0x00`: Inactive
- `0x01`: Active
## Data Types
### Line Flags (16-bit, big-endian)
| Bit | Mask | Description |
|-----|------|-------------|
| 15 | 0x8000 | Visible |
| 9 | 0x0200 | Arrow/Selected indicator |
| 8 | 0x0100 | Left-aligned (vs centered) |
| 7 | 0x0080 | Visible (alternative flag) |
| 6-0 | Various | Reserved/Unknown |
Common flag combinations:
- `0x0080`: Simple visible line
- `0x8000`: Alternative visible flag
- `0x0280`: Visible with arrow indicator
- `0x0180`: Visible and left-aligned
### Cell Attributes
| Bit | Mask | Description |
|-----|------|-------------|
| 7 | 0x80 | VISIBLE - Item is visible |
| 3 | 0x08 | ACTIVATED - Checkbox/radio selected |
| 2 | 0x04 | SELECTED - Button OK pressed |
| 1 | 0x02 | FOCUSED - Item is highlighted |
| 0 | 0x01 | SELECTABLE - Item can be selected |
## Communication Flow
### Initialization Sequence
```mermaid
sequenceDiagram
participant BT as Bluetooth Module (ASG)
participant IC as Instrument Cluster (FSG)
Note over BT, IC: System Initialization
BT->>IC: GetAll (0x01) - Request all functions
IC->>BT: BAP_Config (0x02) - Version & capabilities
IC->>BT: FunctionList (0x03) - Supported functions
IC->>BT: FSG_OperationState (0x0F) - Normal (0x00)
BT->>IC: ASG_Capabilities (0x10) - Display size/elements
BT->>IC: ASG_Config (0x11) - Configuration
BT->>IC: MFL_BlockDefinition (0x12) - Button mapping
```
### Display Update Flow
```mermaid
sequenceDiagram
participant BT as Bluetooth Module (ASG)
participant IC as Instrument Cluster (FSG)
Note over BT, IC: Phone Status Update
BT->>IC: ScrollBar (0x16) - Select screen 1
BT->>IC: FrameData (0x14) - Send display content
IC->>BT: FrameDataAck (0x15) - Confirm receipt
BT->>IC: FrameStatus (0x13) - Update status
IC->>BT: FrameStatus (0x13) - Confirm status
loop Heartbeat every ~5 seconds
BT->>IC: HeartBeat (0x04)
IC->>BT: HeartBeat (0x04)
end
```
## Implementation Examples
### Phone Status Display (Screen 1)
```python
# Screen layout:
# Line 1: "iPhone"
# Line 2: "Wi-Fi Call"
# Line 3: [Battery] [Signal]
screen_data = [
0x01, # Screen ID
# Line 1
0x01, 0x00, 0x80, 0x06, # Line 1, visible, 6 bytes
0x69, 0x50, 0x68, 0x6F, 0x6E, 0x65, # "iPhone"
# Line 2
0x02, 0x00, 0x80, 0x0A, # Line 2, visible, 10 bytes
0x57, 0x69, 0x2D, 0x46, 0x69, 0x20, 0x43, 0x61, 0x6C, 0x6C, # "Wi-Fi Call"
# Line 3
0x03, 0x00, 0x80, 0x04, # Line 3, visible, 4 bytes
0xEF, 0xB0, 0x80, 0x20, 0xEF, 0x9F, 0xBE # Battery + Signal icons
]
```
### Call List Display (Screen 2)
```python
# Screen layout:
# Header: "<Calls>"
# Entry 1: [Phone] "Contact Name 1"
# Entry 2: [Phone] "Contact Name 2"
screen_data = [
0x02, # Screen ID
# Header
0x00, 0x00, 0x80, 0x07, # Line 0, visible, 7 bytes
0x3C, 0x43, 0x61, 0x6C, 0x6C, 0x73, 0x3E, # "<Calls>"
# Entry 1
0x01, 0x02, 0x80, 0x15, # Line 1, visible+arrow, 21 bytes
0xEF, 0x93, 0x9E, 0x20, # Phone icon + space
# Contact name bytes...
]
```
### Icon Reference
Common UTF-8 icon sequences used in Secondary Display:
| Icon | UTF-8 Bytes | Description |
|------|-------------|-------------|
| 📞 | `EF 93 9E` | Phone/Call |
| 🔋 | `EF B0 80` | Battery |
| 📶 | `EF 9F BE` | Signal strength |
| ▶️ | `EF A0 84` | Play |
| ⏸️ | `EF A0 85` | Pause |
| ⏹️ | `EF A0 86` | Stop |
## BAP Message Examples
### Initialize Display
```
# GetAll request
CAN ID: 0x67C
Header: (0 << 12) | (0x2B << 6) | 0x01 = 0x0AC1
Data: [0A C1]
```
### Update Screen Content
```
# FrameData with phone status
CAN ID: 0x67C
Header: (4 << 12) | (0x2B << 6) | 0x14 = 0x4AD4
Data: [4A D4] + screen_data (multi-frame)
```
### Heartbeat
```
CAN ID: 0x67C
Header: (3 << 12) | (0x2B << 6) | 0x04 = 0x3AC4
Data: [3A C4 0A]
```
## Important Notes
1. **Text Encoding**: Always use UTF-8 encoding
2. **Icon Usage**: Use only the documented UTF-8 sequences for icons
3. **Screen Persistence**: Screen IDs should be consistent across sessions
4. **Acknowledgment**: Always wait for FrameDataAck before next update
5. **Heartbeat**: Maintain regular heartbeat to prevent timeout (~5 second interval)
6. **Multi-frame**: Large display updates require [[core/Header and Multi-frame|multi-frame handling]]
7. **Line Limits**: Respect display size capabilities (3/5/8 lines)
## Error Handling
### Common Issues
1. **No FrameDataAck**: Retry after timeout or abort update
2. **Frame Unavailable** (0xFF): Wait and retry or select different frame
3. **Lost Heartbeat**: FSG may clear display after ~10 seconds
4. **Invalid Screen ID**: FSG ignores update, no acknowledgment
## Related Documentation
- [[core/Opcodes and Function IDs|Standard BAP Functions]]
- [[core/Header and Multi-frame|Multi-frame Message Handling]]
- [[FCT Definitions|Secondary Display Function Details]]
- [[Icon Mappings|Complete Icon Reference]]
# - [[FCT Definitions|Secondary Display Function Details]]
- [[Constants and Definitions|Secondary Display Constants & Definitions]]