Wiki » Historie » Version 12
Maximilian Seesslen, 20.08.2024 14:18
1 | 9 | Maximilian Seesslen | h1. CANHub |
---|---|---|---|
2 | 3 | Maximilian Seesslen | h2. Intro |
3 | |||
4 | CANServer is an Server-Client library that provides multiple applications access to an CAN-Bus via TCP/IP. |
||
5 | Every message received via CAN gets send to all clients. When an client sends an message, it is send |
||
6 | via CAN-Bus and also to the other clients. |
||
7 | The physical CAN-Bus is optional. |
||
8 | |||
9 | 8 | Maximilian Seesslen | h3. Usecases |
10 | 3 | Maximilian Seesslen | |
11 | 8 | Maximilian Seesslen | * CAN over ethernet |
12 | * Graphical user interface for home automatisation |
||
13 | An laptop/tablet can be connected to an server via WLAN |
||
14 | * Recording/Replay |
||
15 | An PC-Application could record CAN messages and replay them. |
||
16 | * Debugging |
||
17 | Show CAN traffic while interacting with the bus with other devices. |
||
18 | * WLAN CAN-Bridge |
||
19 | Two CAN segments can be connected via WLAN |
||
20 | 3 | Maximilian Seesslen | |
21 | 8 | Maximilian Seesslen | h3. Architecture |
22 | 1 | Maximilian Seesslen | |
23 | <pre> |
||
24 | 9 | Maximilian Seesslen | Server TCP Client |
25 | 12 | Maximilian Seesslen | List |
26 | { /-----> connectionTcpClient |
||
27 | 9 | Maximilian Seesslen | connectionCan | |
28 | connectionTcpServer | |
||
29 | 1 | Maximilian Seesslen | connectionTcpServer <-----/ |
30 | 9 | Maximilian Seesslen | connectionTcpServer |
31 | 12 | Maximilian Seesslen | } |
32 | 9 | Maximilian Seesslen | </pre> |
33 | |||
34 | <pre> |
||
35 | class CConnector { |
||
36 | signal dataIn(SMsg); |
||
37 | slot dataOut(SMsg); |
||
38 | } |
||
39 | 7 | Maximilian Seesslen | </pre> |
40 | |||
41 | 10 | Maximilian Seesslen | <pre> |
42 | 1 | Maximilian Seesslen | Server |
43 | 10 | Maximilian Seesslen | List |
44 | 12 | Maximilian Seesslen | { |
45 | 10 | Maximilian Seesslen | connectionCan <-----\ |
46 | 1 | Maximilian Seesslen | /---- connectionTcpServer <-----| |
47 | 10 | Maximilian Seesslen | | connectionTcpServer <-----| |
48 | | connectionTcpServer <-----| |
||
49 | 12 | Maximilian Seesslen | | } | |
50 | 11 | Maximilian Seesslen | \--> serverDataInSlot-----------/ |
51 | 10 | Maximilian Seesslen | </pre> |
52 | |||
53 | 3 | Maximilian Seesslen | Each connection has an id which is an ongoing number handled by the server. |
54 | ## Terminal Output |
||
55 | The server prints a dynamic list with the connections and traffic statistics. |
||
56 | 1 | Maximilian Seesslen | - ID/Type |
57 | - Connection uptime |
||
58 | 3 | Maximilian Seesslen | * in/out messag count |
59 | 1 | Maximilian Seesslen | * in msg/s |
60 | |||
61 | Example: |
||
62 | |||
63 | <pre> |
||
64 | 3 | Maximilian Seesslen | Id Target Uptime In Out In/s |
65 | 7 | Maximilian Seesslen | ----------------------------------------- |
66 | 3 | Maximilian Seesslen | 0: CAN 0:10s 12 55 0 |
67 | 7 | Maximilian Seesslen | 1: Server 0:10s 3 51 0 |
68 | 2: Client 0:05s 43 52 0 |
||
69 | 3 | Maximilian Seesslen | 3: Client 0:01s 1 57 0 |
70 | </pre> |
||
71 | 8 | Maximilian Seesslen | |
72 | h3. Loop detection |
||
73 | |||
74 | An Heartbeat is send/routed to every tcp connection. |
||
75 | When server sends heartbeat, it must not receive it back. Otherwise there is a loop. How to generate uuid? |
||
76 | |||
77 | 3 | Maximilian Seesslen | |
78 | 4 | Maximilian Seesslen | h1. Ansi |
79 | |||
80 | box(x1,y1,x2,y2) |
||
81 | hLine(x1,y1,x2) |
||
82 | vLine(x1,y1,y2) |
||
83 | |||
84 | 6 | Maximilian Seesslen | <pre> |
85 | 5 | Maximilian Seesslen | ┬ |
86 | │ |
||
87 | ┴ |
||
88 | ├──┤ |
||
89 | ┌─┐ |
||
90 | │ │ |
||
91 | └─┘ |
||
92 | 6 | Maximilian Seesslen | </pre> |
93 | 5 | Maximilian Seesslen | |
94 | QLoggingCategory::setFilterRules("*.debug=false"); |
||
95 | qSetMessagePattern("[%{time process}] %{function}: %{message}"); |
||
96 | qDebug("Happy debugging"); |
||
97 | |||
98 | 3 | Maximilian Seesslen | h1. Links |
99 | 2 | Maximilian Seesslen | |
100 | https://www.sciencebuddies.org/science-fair-projects/references/ascii-table |