Skip to content

Commit

Permalink
SKA-585: update vCAN naming to vcan (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
VKyllianAubry authored and GitHub Enterprise committed Jul 30, 2024
1 parent 8ec551f commit fbbe9d2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 26 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ install(

install(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/SocketCAN/demos/shell_scripts/setup_vCAN_device.sh
${CMAKE_CURRENT_SOURCE_DIR}/SocketCAN/demos/shell_scripts/setup_vcan_device.sh
${CMAKE_CURRENT_SOURCE_DIR}/SocketCAN/demos/shell_scripts/send_CAN_frames.sh
${CMAKE_CURRENT_SOURCE_DIR}/SocketCAN/demos/shell_scripts/setup_vCAN_start_adapter_send_CAN_frames.sh
${CMAKE_CURRENT_SOURCE_DIR}/SocketCAN/demos/shell_scripts/setup_vcan_start_adapter_send_CAN_frames.sh
DESTINATION SocketCAN/demos/shell_scripts
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
Expand Down
4 changes: 2 additions & 2 deletions SocketCAN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ participants in order to exchange CAN frames. The `sil-kit-demo-can-echo-device`
## SocketCAN interface setup and CAN traffic generation in Linux
First, run the following command in the Terminal to load the necessary Linux kernel modules and setup a virtual CAN interface named `can0`.

sudo ./SocketCAN/demos/shell_scripts/setup_vCAN_device.sh can0
sudo ./SocketCAN/demos/shell_scripts/setup_vcan_device.sh can0

You should see this output that indicates that the `can0` virtual CAN device has been successfully launched:

Expand Down Expand Up @@ -162,7 +162,7 @@ Before you can connect CANoe to the SIL Kit network you should adapt the `Regist
The configuration file is referenced by both following CANoe use cases (Desktop Edition and Server Edition).

#### CANoe Desktop Edition
Load the `CANoe_vCAN_configuration.cfg` from the `demos/CANoe` directory and start the measurement. Optionally you can also start the test unit execution of the `CAN_and_CAN_FD` test configuration.
Load the `CANoe_vcan_configuration.cfg` from the `demos/CANoe` directory and start the measurement. Optionally you can also start the test unit execution of the `CAN_and_CAN_FD` test configuration.

While the demo is running these tests should be successful.

Expand Down
4 changes: 2 additions & 2 deletions SocketCAN/adapter/AdapterConnections.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class CanConnection : public std::enable_shared_from_this<CanConnection>
SilKit::Services::Logging::ILogger* _logger;
ICanController* _silkitCtrl;

struct VCANDevice
struct CanDevice
{
int fileDescriptor;
vCANDeviceType deviceType;
CanDeviceType deviceType;
} _vcanDevice;
};
6 changes: 3 additions & 3 deletions SocketCAN/adapter/ConnectionsImplementations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

using namespace SilKit::Services::Can;

enum vCANDeviceType
enum CanDeviceType
{
CLASSICAL_CAN_DEVICE,
CAN_FD_DEVICE,
INVALID_DEVICE
};

enum canFrameType
enum CanFrameType
{
PURE_FD_FRAME,
FD_CLASSIC_FRAME,
Expand All @@ -47,7 +47,7 @@ struct ICanConnectionImpl
void HandleReceivedCanFrameFromVirtualCanDevice(ICanController* canController, SilKit::Services::Logging::ILogger* logger);

protected:
canFrameType _frameType;
CanFrameType _frameType;
};

struct ClassicalCanConnectionImpl : public ICanConnectionImpl
Expand Down
20 changes: 4 additions & 16 deletions SocketCAN/demos/CANoe4SW_SE/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ sleep 1 # wait 1 second for the creation of the .out file
timeout 30s grep -q 'Press CTRL + C to stop the process...' <(tail -f $logDir/sil-kit-demo-can-echo-device.out -n +1) || { echo "[error] Timeout reached while waiting for sil-kit-demo-can-echo-device to start"; exit 1; }

# Run and test adapter with vcan device of MTU 72
$scriptDir/../shell_scripts/setup_vCAN_start_adapter_send_CAN_frames.sh &> $logDir/setup_vCAN_start_adapter_send_CAN_frames.out &
$scriptDir/../shell_scripts/setup_vcan_start_adapter_send_CAN_frames.sh &> $logDir/setup_vcan_start_adapter_send_CAN_frames.out &
script_pid=$!
sleep 1 # wait 1 second for the creation of the .out file
timeout 90s grep -q 'Adapter has been launched and CAN payload is being generated...' <(tail -f $logDir/setup_vCAN_start_adapter_send_CAN_frames.out -n +1) || { echo "[error] Timeout reached while waiting for (setup_vCAN_start_adapter_send_CAN_frames.sh) to start"; exit 1; }
timeout 90s grep -q 'Adapter has been launched and CAN payload is being generated...' <(tail -f $logDir/setup_vcan_start_adapter_send_CAN_frames.out -n +1) || { echo "[error] Timeout reached while waiting for (setup_vcan_start_adapter_send_CAN_frames.sh) to start"; exit 1; }

$scriptDir/run.sh
exit_status=$?
Expand All @@ -50,9 +50,9 @@ fi
kill $script_pid

# Run and test adapter with vcan device of MTU 16
$scriptDir/../shell_scripts/setup_vCAN_start_adapter_send_CAN_frames.sh -mtu16 &> $logDir/setup_vCAN_start_adapter_send_CAN_frames-mtu16.out &
$scriptDir/../shell_scripts/setup_vcan_start_adapter_send_CAN_frames.sh -mtu16 &> $logDir/setup_vcan_start_adapter_send_CAN_frames-mtu16.out &
sleep 1 # wait 1 second for the creation of the .out file
timeout 60s grep -q 'Adapter has been launched and CAN payload is being generated...' <(tail -f $logDir/setup_vCAN_start_adapter_send_CAN_frames-mtu16.out -n +1) || { echo "[error] Timeout reached while waiting for (setup_vCAN_start_adapter_send_CAN_frames.sh -mtu16) to start"; exit 1; }
timeout 60s grep -q 'Adapter has been launched and CAN payload is being generated...' <(tail -f $logDir/setup_vcan_start_adapter_send_CAN_frames-mtu16.out -n +1) || { echo "[error] Timeout reached while waiting for (setup_vcan_start_adapter_send_CAN_frames.sh -mtu16) to start"; exit 1; }

$scriptDir/run.sh -mtu16
exit_status=$?
Expand All @@ -61,18 +61,6 @@ if [[ exit_status -ne 0 ]]; then
exit $exit_status
fi

echo "sil-kit-registry.out:--------------------------------------------------------------------------------------"
cat $logDir/sil-kit-registry.out
echo "-----------------------------------------------------------------------------------------------------------"

echo "setup_vCAN_start_adapter_send_CAN_frames.out:--------------------------------------------------------------"
cat $logDir/setup_vCAN_start_adapter_send_CAN_frames.out
echo "-----------------------------------------------------------------------------------------------------------"

echo "setup_vCAN_start_adapter_send_CAN_frames-mtu16.out:--------------------------------------------------------"
cat $logDir/setup_vCAN_start_adapter_send_CAN_frames-mtu16.out
echo "-----------------------------------------------------------------------------------------------------------"

#exit run_all.sh with same exit_status
exit $exit_status

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi

# Setup an FD-capable vcan device (default case)
echo "[info] Setting up [can0]..."
$scriptDir/setup_vCAN_device.sh can0 $arg &> $logDir/setup_vCAN_device_can0$arg.out
$scriptDir/setup_vcan_device.sh can0 $arg &> $logDir/setup_vcan_device_can0$arg.out

# Start adapter
echo "[info] Starting sil-kit-adapter-vcan..."
Expand Down

0 comments on commit fbbe9d2

Please sign in to comment.