aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/sllin/files/start_lin_demo.sh
blob: c97f0a2c57871293911513e35c19bc9396f223fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh

# Attach serial LIN->CAN bridge and set up LIN polling
if [ -c /dev/ttyUSB0 ]; then
    sleep 1
    /usr/bin/lin_config -m -c /etc/lin_config.conf -a sllin:/dev/ttyUSB0
    mkdir -p /run/lin_config/
    pidof lin_config > /run/lin_config/lin_config.pid
    sleep 1
else
    ip link add dev sllin0 type vcan
fi
ip link set sllin0 up

# Initialize HVAC controller
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 02A#
usleep 100000
cansend sllin0 02B#
usleep 100000
cansend sllin0 032#F0F8FFFFFFFFFFFF
usleep 100000
cansend sllin0 032#F0F8FFFFFFFFFFFF
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 030#
usleep 100000
cansend sllin0 02D#
usleep 100000
cansend sllin0 02C#
usleep 100000
cansend sllin0 02D#
usleep 100000
cansend sllin0 02C#
usleep 100000