Wiki » Historie » Version 9
Maximilian Seesslen, 15.08.2024 16:14
| 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 | List< /-----> connectionTcpClient |
||
| 26 | connectionCan | |
||
| 27 | connectionTcpServer | |
||
| 28 | connectionTcpServer <-----/ |
||
| 29 | connectionTcpServer |
||
| 30 | 7 | Maximilian Seesslen | > |
| 31 | 9 | Maximilian Seesslen | </pre> |
| 32 | |||
| 33 | <pre> |
||
| 34 | class CConnector { |
||
| 35 | signal dataIn(SMsg); |
||
| 36 | slot dataOut(SMsg); |
||
| 37 | } |
||
| 38 | 7 | Maximilian Seesslen | </pre> |
| 39 | |||
| 40 | 3 | Maximilian Seesslen | Each connection has an id which is an ongoing number handled by the server. |
| 41 | ## Terminal Output |
||
| 42 | The server prints a dynamic list with the connections and traffic statistics. |
||
| 43 | 1 | Maximilian Seesslen | - ID/Type |
| 44 | - Connection uptime |
||
| 45 | 3 | Maximilian Seesslen | * in/out messag count |
| 46 | 1 | Maximilian Seesslen | * in msg/s |
| 47 | |||
| 48 | Example: |
||
| 49 | |||
| 50 | <pre> |
||
| 51 | 3 | Maximilian Seesslen | Id Target Uptime In Out In/s |
| 52 | 7 | Maximilian Seesslen | ----------------------------------------- |
| 53 | 3 | Maximilian Seesslen | 0: CAN 0:10s 12 55 0 |
| 54 | 7 | Maximilian Seesslen | 1: Server 0:10s 3 51 0 |
| 55 | 2: Client 0:05s 43 52 0 |
||
| 56 | 3 | Maximilian Seesslen | 3: Client 0:01s 1 57 0 |
| 57 | </pre> |
||
| 58 | 8 | Maximilian Seesslen | |
| 59 | h3. Loop detection |
||
| 60 | |||
| 61 | An Heartbeat is send/routed to every tcp connection. |
||
| 62 | When server sends heartbeat, it must not receive it back. Otherwise there is a loop. How to generate uuid? |
||
| 63 | |||
| 64 | 3 | Maximilian Seesslen | |
| 65 | 4 | Maximilian Seesslen | h1. Ansi |
| 66 | |||
| 67 | box(x1,y1,x2,y2) |
||
| 68 | hLine(x1,y1,x2) |
||
| 69 | vLine(x1,y1,y2) |
||
| 70 | |||
| 71 | 6 | Maximilian Seesslen | <pre> |
| 72 | 5 | Maximilian Seesslen | ┬ |
| 73 | │ |
||
| 74 | ┴ |
||
| 75 | ├──┤ |
||
| 76 | ┌─┐ |
||
| 77 | │ │ |
||
| 78 | └─┘ |
||
| 79 | 6 | Maximilian Seesslen | </pre> |
| 80 | 5 | Maximilian Seesslen | |
| 81 | QLoggingCategory::setFilterRules("*.debug=false"); |
||
| 82 | qSetMessagePattern("[%{time process}] %{function}: %{message}"); |
||
| 83 | qDebug("Happy debugging"); |
||
| 84 | |||
| 85 | 3 | Maximilian Seesslen | h1. Links |
| 86 | 2 | Maximilian Seesslen | |
| 87 | https://www.sciencebuddies.org/science-fair-projects/references/ascii-table |