Basic Hardware and OS Abstraction Layer.
More...
- Author:
- Marius Zwicker / ERB
- Date:
- 30.01.2011
Introduction
bcsdatasim is an executable that needs to be run on all systems you want to simulate the interfaces on as well as the actual hardware when you need to trace the interface traffic.
It provides this backend by using two possible runmodes.
-
When run in normal mode, it will generate some data on one of the can ports only. All other ports cannot be accessed. The generated data can easily be adapted by editing the file datagenerator.c within the folder of bcsdatasim.
-
The optional server mode will make bcsdatasim listen on port 3490 for incoming tcp connections following a protocol defined in the next section. When operating in this mode you have full control over the simulated interfaces and can monitor as well as modify them.
The bcsdatasim executable has the following options by default:
-h, --help | | Print a help dialog |
-v, --version | | Give version information |
-s, --server | | Run as TCP server. Data will not be generated internally, but accepted via Network and passed into the system. |
-r, --real | | Use real can ports as output instead of simulated onces. This is especially usefull when you have looped the can ports. Hint: This has no effect except on the netdcu platform! |
TCP Protocol
Our tcp protocol was implemented using the low level protocol defined in bcs_tcp.h. Messages following the protocol can be sent as well as received. The following package types were currently defined:
-
Package ID 0: Data for the first can port (in libHartwer this is called BCS_CAN_ECU). The data part consists of an int describing the can message id, followed by another int for setting the used can message length. According to this length the needed number of data fields encoded as char follow.
-
Package ID 1: Data for the second can port (in libHartwer this is the BCS_CAN_BOARD). The data part is equal to messages for the first can port.
-
Package ID 2: IO Simulation. This is a simple package consisting of chars only. Each char represents a port bitmask. As libHartwer currently supports three IO ports, the data block consists of three chars.
-
Package IDs 3 and 4: These package ids were reserved for internal use of Elefant Racing and should not be used otherwise.
-
Higher Package IDs can be used and defined by individual needs