aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/sllin/files/start_lin_demo.sh
blob: 26f64c0a14f06d1781cc2ced3a4415cc1c47df97 (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
#!/bin/sh

# Attach serial LIN->CAN bridge and set up LIN polling
if [ -c /dev/ttyUSB0 ]; then
    sleep 1
    /usr/bin/lin_config -c /etc/lin_config.conf -a sllin:/dev/ttyUSB0
    pidof lin_config > /var/run/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