Introduction #
Depending on your car, steering wheel controls are emitted through the CAN-Bus or the LIN-Bus. In V-Link we have a centralized module that takes care of both but needs to be configured correctly, depending on which interface you are using.
The file responsible for setting this up is swc.json
.
SWC via CAN #
Below you find a preconfigured JSON file to use the CAN-Bus as source for the steering wheel controls.
{
"type": "interface",
"name": "swc",
"controls": {
"enabled": true,
"interface": {
"name": "can1",
"bustype": "socketcan",
"channel": "can1",
"is_extended": true,
"bitrate": 125000,
"rep_id": "0x0131726C",
"zero_message": ["0x00", "0x00", "0x3F"],
"control_byte_count": 2
},
"config": {
"long_press_duration": 1500,
"click_timeout": 300,
"mouse_speed": 6
},
"button": {
"BTN_NEXT": [["0x00", "0x3D"], ["0x80", "0x3D"], ["0x40", "0x3D"]],
"BTN_PREV": [["0x00", "0x3E"], ["0x80", "0x3E"], ["0x40", "0x3E"]],
"BTN_VOL_UP": null,
"BTN_VOL_DOWN": null,
"BTN_BACK": [["0x10", "0x3F"], ["0x90", "0x3F"], ["0x50", "0x3F"]],
"BTN_ENTER": [["0x20", "0x3F"], ["0xA0", "0x3F"], ["0x60", "0x3F"]],
"BTN_YES": [["0x00", "0x2F"], ["0x80", "0x2F"], ["0x40", "0x2F"]],
"BTN_NO": [["0x00", "0x1F"], ["0x80", "0x1F"], ["0x40", "0x1F"]]
},
"joystick": {
"BTN_UP": [["0x08", "0x3F"], ["0x88", "0x3F"], ["0x48", "0x3F"]],
"BTN_DOWN": [["0x04", "0x3F"], ["0x84", "0x3F"], ["0x44", "0x3F"]],
"BTN_LEFT": [["0x01", "0x3F"], ["0x81", "0x3F"], ["0x41", "0x3F"]],
"BTN_RIGHT": [["0x02", "0x3F"], ["0x82", "0x3F"], ["0x42", "0x3F"]]
}
}
}
SWC via LIN #
Below you find a preconfigured JSON file to use the LIN-Bus as source for the steering wheel controls.
{
"type": "interface",
"name": "swc",
"controls": {
"enabled": true,
"interface": {
"name": "lin",
"bitrate": 0,
"timing": {
"timeout": 0.1
},
"swm_id": "0x20",
"sync_id": "0x55",
"zero_code": "0xFF",
"ign_on": ["0x50", "0x0E", "0x00", "0xF1"]
},
"config": {
"long_press_duration": 1500,
"click_timeout": 300,
"mouse_speed": 6
},
"button": {
"BTN_NEXT": ["0x20", "0x00", "0x10", "0x00", "0x00"],
"BTN_PREV": ["0x20", "0x00", "0x02", "0x00", "0x00"],
"BTN_VOL_UP": ["0x20", "0x00", "0x00", "0x01", "0x00"],
"BTN_VOL_DOWN": ["0x20", "0x00", "0x80", "0x00", "0x00"],
"BTN_BACK": ["0x20", "0x00", "0x01", "0x00", "0x00"],
"BTN_ENTER": ["0x20", "0x00", "0x08", "0x00", "0x00"],
"BTN_YES": null,
"BTN_NO": null
},
"joystick": {
"BTN_UP": ["0x20", "0x01", "0x00", "0x00", "0x00"],
"BTN_DOWN": ["0x20", "0x02", "0x00", "0x00", "0x00"],
"BTN_LEFT": ["0x20", "0x04", "0x00", "0x00", "0x00"],
"BTN_RIGHT": ["0x20", "0x08", "0x00", "0x00", "0x00"]
}
}
}