Wiki » Historie » Revision 13
Revision 12 (Maximilian Seesslen, 20.08.2024 14:18) → Revision 13/17 (Maximilian Seesslen, 20.08.2024 14:19)
h1. CANHub
h2. Intro
CANServer is an Server-Client library that provides multiple applications access to an CAN-Bus via TCP/IP.
Every message received via CAN gets send to all clients. When an client sends an message, it is send
via CAN-Bus and also to the other clients.
The physical CAN-Bus is optional.
h3. Usecases
* CAN over ethernet
* Graphical user interface for home automatisation
An laptop/tablet can be connected to an server via WLAN
* Recording/Replay
An PC-Application could record CAN messages and replay them.
* Debugging
Show CAN traffic while interacting with the bus with other devices.
* WLAN CAN-Bridge
Two CAN segments can be connected via WLAN
h3. Architecture
<pre>
Server TCP Client
List
{ /-----> connectionTcpClient
connectionCan |
connectionTcpServer |
connectionTcpServer <-----/
connectionTcpServer
}
</pre>
<pre>
class CConnector {
signal dataIn(SMsg);
slot dataOut(SMsg);
}
</pre>
<pre>
Server
List
{
connectionCan <-----\
/---- connectionTcpServer <-----|
| connectionTcpServer <-----|
| connectionTcpServer <-----|
| } |
| |
\--> serverDataInSlot-----------/
</pre>
Each connection has an id which is an ongoing number handled by the server.
## Terminal Output
The server prints a dynamic list with the connections and traffic statistics.
- ID/Type
- Connection uptime
* in/out messag count
* in msg/s
Example:
<pre>
Id Target Uptime In Out In/s
-----------------------------------------
0: CAN 0:10s 12 55 0
1: Server 0:10s 3 51 0
2: Client 0:05s 43 52 0
3: Client 0:01s 1 57 0
</pre>
h3. Loop detection
An Heartbeat is send/routed to every tcp connection.
When server sends heartbeat, it must not receive it back. Otherwise there is a loop. How to generate uuid?
h1. Ansi
box(x1,y1,x2,y2)
hLine(x1,y1,x2)
vLine(x1,y1,y2)
<pre>
┬
│
┴
├──┤
┌─┐
│ │
└─┘
</pre>
QLoggingCategory::setFilterRules("*.debug=false");
qSetMessagePattern("[%{time process}] %{function}: %{message}");
qDebug("Happy debugging");
h1. Links
https://www.sciencebuddies.org/science-fair-projects/references/ascii-table
h2. Intro
CANServer is an Server-Client library that provides multiple applications access to an CAN-Bus via TCP/IP.
Every message received via CAN gets send to all clients. When an client sends an message, it is send
via CAN-Bus and also to the other clients.
The physical CAN-Bus is optional.
h3. Usecases
* CAN over ethernet
* Graphical user interface for home automatisation
An laptop/tablet can be connected to an server via WLAN
* Recording/Replay
An PC-Application could record CAN messages and replay them.
* Debugging
Show CAN traffic while interacting with the bus with other devices.
* WLAN CAN-Bridge
Two CAN segments can be connected via WLAN
h3. Architecture
<pre>
Server TCP Client
List
{ /-----> connectionTcpClient
connectionCan |
connectionTcpServer |
connectionTcpServer <-----/
connectionTcpServer
}
</pre>
<pre>
class CConnector {
signal dataIn(SMsg);
slot dataOut(SMsg);
}
</pre>
<pre>
Server
List
{
connectionCan <-----\
/---- connectionTcpServer <-----|
| connectionTcpServer <-----|
| connectionTcpServer <-----|
| } |
| |
\--> serverDataInSlot-----------/
</pre>
Each connection has an id which is an ongoing number handled by the server.
## Terminal Output
The server prints a dynamic list with the connections and traffic statistics.
- ID/Type
- Connection uptime
* in/out messag count
* in msg/s
Example:
<pre>
Id Target Uptime In Out In/s
-----------------------------------------
0: CAN 0:10s 12 55 0
1: Server 0:10s 3 51 0
2: Client 0:05s 43 52 0
3: Client 0:01s 1 57 0
</pre>
h3. Loop detection
An Heartbeat is send/routed to every tcp connection.
When server sends heartbeat, it must not receive it back. Otherwise there is a loop. How to generate uuid?
h1. Ansi
box(x1,y1,x2,y2)
hLine(x1,y1,x2)
vLine(x1,y1,y2)
<pre>
┬
│
┴
├──┤
┌─┐
│ │
└─┘
</pre>
QLoggingCategory::setFilterRules("*.debug=false");
qSetMessagePattern("[%{time process}] %{function}: %{message}");
qDebug("Happy debugging");
h1. Links
https://www.sciencebuddies.org/science-fair-projects/references/ascii-table