-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
131 lines (113 loc) · 5.51 KB
/
README.txt
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
【For Build】
Yoctoに組み込まず(提供meta先未定)
caniviをcmake する場合、MAKE_TOOL_CHAIN_FILEにて クロス環境を指定する。
$ PATH=/home/Devel/AGL/RCarGen3-agl/build/tmp/sysroots/x86_64-linux/usr/bin/aarch64-agl-linux:$PATH
$ mkdir build
$ cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../RcarGen3.cmake ..
$ make
# make install ※ <wgt化は、installで作成する予定>
【For run】
1) ambd が起動している場合、ambdを停止する。
If ambd running, Please stop ambd
systemctl stop ambd
2) canivi-Config設定
# can I/Fデバイスの設定。
set up CAN IF name
${AFB_ROOTDIR}/canivi.json
3) Start the binder
$ cd af_binder
$ afb-daemon --token=3210 --ldpaths=. --port=5555 --rootdir=. --verbose [--verbose [ --verbose]]
※ token,portは、システムで一意な設定とする事。
※ --verbose 指定は、ログ出力レベル に合わせ増やす(--verbose指定数によりログレベルが上る)
4) local Test from demo-client
$ afb-client-demo ws://localhost:5555/api?token=3210
<以下標準入力から入力>
canivi subscribe { "event" : "VehicleSpeed" }
or
canivi subscribe { "event" : "*" }
#This software include simple CAN(EngineSpeed and VehicleSpeed) json file
-sample EngineSpeed CAN information
CAN ID 010
data 2byte
Data thinning cycle 200ms
-sample VehicleSpeed CAN information
CAN ID 011
data 2byte
Data thinning cycle 200ms
simple.json
{
"RECEPTION" :
{
"STANDARD": {
"010" : {
"DLC" : 2 ,
"MODE" : "CAN_THINOUT_CHG",
"CYCLE" : 200,
"DATA" : [
{
"POS" : 2 ,
"OFFS" : 0 ,
"LEN" : 16 ,
"CUSTOM" : false,
"PROPERTY" : "EngineSpeed",
"ZONE" : ["Zone::None"],
"TYPE" : "uint16_t",
"MULTI-PARAM" : 0,
"ADD-PARAM" : 0
}
]
},
"011" : {
"DLC" : 2 ,
"MODE" : "CAN_THINOUT_CHG",
"CYCLE" : 200,
"DATA" : [
{
"POS" : 2 ,
"OFFS" : 0 ,
"LEN" : 16 ,
"CUSTOM" : false,
"PROPERTY" : "VehicleSpeed",
"ZONE" : ["Zone::None"],
"TYPE" : "uint16_t",
"MULTI-PARAM" : 0,
"ADD-PARAM" : 0
}
]
},
},
"EXTENDED" : {
}
}
,
"TRANSMISSION" :
{
"STANDARD": {
},
"EXTENDED" : {
}
}
}
-test VehicleSpeed
root@m3ulcb:~# cansend vcan0 011#0000
root@m3ulcb:~# cansend vcan0 011#0010
root@m3ulcb:~# cansend vcan0 011#0100
root@m3ulcb:~# cansend vcan0 011#0110
root@m3ulcb:~# cansend vcan0 011#0111
ON-EVENT canivi/VehicleSpeed({"event":"canivi\/VehicleSpeed","data":{"value":0},"jtype":"afb-event"})
ON-EVENT canivi/VehicleSpeed({"event":"canivi\/VehicleSpeed","data":{"value":16},"jtype":"afb-event"})
ON-EVENT canivi/VehicleSpeed({"event":"canivi\/VehicleSpeed","data":{"value":256},"jtype":"afb-event"})
ON-EVENT canivi/VehicleSpeed({"event":"canivi\/VehicleSpeed","data":{"value":272},"jtype":"afb-event"})
ON-EVENT canivi/VehicleSpeed({"event":"canivi\/VehicleSpeed","data":{"value":273},"jtype":"afb-event"})
-test EngineSpeed
root@m3ulcb:~# cansend vcan0 010#0000
root@m3ulcb:~# cansend vcan0 010#0001
root@m3ulcb:~# cansend vcan0 010#0010
root@m3ulcb:~# cansend vcan0 010#0100
root@m3ulcb:~# cansend vcan0 010#1000
ON-EVENT canivi/EngineSpeed({"event":"canivi\/EngineSpeed","data":{"value":0},"jtype":"afb-event"})
ON-EVENT canivi/EngineSpeed({"event":"canivi\/EngineSpeed","data":{"value":1},"jtype":"afb-event"})
ON-EVENT canivi/EngineSpeed({"event":"canivi\/EngineSpeed","data":{"value":16},"jtype":"afb-event"})
ON-EVENT canivi/EngineSpeed({"event":"canivi\/EngineSpeed","data":{"value":256},"jtype":"afb-event"})
ON-EVENT canivi/EngineSpeed({"event":"canivi\/EngineSpeed","data":{"value":4096},"jtype":"afb-event"})