The default native configuration defines two virtual can ifaces to be used.
Before running this test on native, you should create those:
```
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link add dev vcan1 type vcan
sudo ip link set vcan0 up
sudo ip link set vcan1 up
```
## Usage
### Sending
Messages can be sent over the CAN-bus through the `send` command. Optionally, up to 8 bytes can be passed as arguments (in decimal form). If no arguments are passed it will default to sending AB CD EF (hex).
```
send <bytes>
```
When running the app native on linux, the sent bytes can be seen by scanning the CANbus with candump:
```
$ candump vcan0
```
### Receiving
The test-app is always listening for incoming CAN messages. They will be stored asynchronously in a buffer and can be requested by means of the `receive` command. Optionally, an argument n can be passed to receive n messages in a row.
```
receive <n>
```
If more messages are requested than are available in the buffer, the receive function will block until new data is available.
When running the app native on linux, data can be sent with `cansend`:
```
$ cansend <interface><can_id>:<hexbytes>
```
e.g.:
```
$ cansend vcan0 001:1234ABCD
```
An alternative is to use `cangen` to generate a number of random can messages:
```
$ cangen <interface> -v -n <n>
```
e.g.:
```
$ cangen vcan0 -v -n 5
```
will send 5 can messages to vcan0 with verbose output.