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