Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,50 @@ PRODUCT_PACKAGES += \
libvsomeip_sd \
libvsomeip_e2e \
```

##### Build Instructions for Windows

###### Setup

- Visual Studio Code
- Visual Studio Build Tools with:
- Desktop development with C++
- MSVC v143 - VS 2022 C++ x64/x86 build tools
- Windows 10/11 SDK
- CMake for Windows
- vSomeIP uses CMake as buildsystem.
- vSomeIP uses Boost >= 1.71.0:
- GIT

For the tests Google's test framework https://code.google.com/p/googletest/[gtest] is needed.
-- URL: https://googletest.googlecode.com/files/gtest-<version>.zip
or
-- git clone https://github.com/google/googletest.git

###### Compilation

For compilation call:

```bash
rmdir /s /q build
cd build
cmake .. -A x64 -DCMAKE_INSTALL_PREFIX:PATH=$YOUR_PATH
cmake --build . --config [Release|Debug]
cmake --build . --config [Release|Debug] --target install
```

For compilation outside vsomeip-lib folder call:

```bash
rmdir /s /q build
cmake -B "buildlib" -DCMAKE_BUILD_TYPE=[Release|Debug] -DCMAKE_INSTALL_PREFIX=$YOUR_PATH -A x64 vsomeip-lib
#vsomeip-lib compilation
cmake --build build --config [Release|Debug] --parallel 16 --target install
#examples compilation
cmake --build build --config [Release|Debug] --parallel 16 --parallel 16 --target examples
cmake --build build --config [Release|Debug] --parallel 16 --target install
#unit-tests compilation
cmake --build build/test --config [Release|Debug] --parallel 16 --parallel 16 --target build_unit_tests
#all tests compilation
cmake --build build/test --config [Release|Debug] --parallel 16 --parallel 16 --target all build_tests
```
79 changes: 75 additions & 4 deletions examples/hello_world/readme → examples/hello_world/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,114 @@
Build instructions for Hello World example
------------------------------------------

## Linux Build Instructions

1. Build whole project at first:
________________________________
cd <root directory of vSomeIP-Lib>$:

```batch
cd <root directory of vSomeIP-Lib>$:
mkdir build
cd build
cmake ..
make
sudo make install
```

2. Build hello_world target
___________________________
```batch
cd <root directory of vSomeIP-Lib>/examples/hello_world$:

mkdir build
cd build
cmake ..
make
```

## Windows Build Instructions

1. Build whole project at first:
```batch
cd <root directory of vSomeIP-Lib>
rmdir /s /q build
mkdir build
cd build
cmake .. -A x64 -DCMAKE_INSTALL_PREFIX="$YOUR_PATH"
cmake --build . --config Release
cmake --build . --config Release --target install
```

2. Build hello_world target:
```batch
cd <root directory of vSomeIP-Lib>/examples/hello_world
rmdir /s /q build
mkdir build
cd build
cmake .. -A x64 -DCMAKE_PREFIX_PATH="$YOUR_PATH"
cmake --build . --config Release
```

Note: Replace "Release" with "Debug" for debug builds.

Running Hello World Example
---------------------------

## Linux

The Hello World Example should be run on the same host.
The network addresses within the configuration files need to be adapted to match
the devices addresses.

To start the hello world client and service from their build-directory do:

HOST1:
```bash
VSOMEIP_CONFIGURATION=../helloworld-local.json \
VSOMEIP_APPLICATION_NAME=hello_world_service \
./hello_world_service
```

HOST1:
```bash
VSOMEIP_CONFIGURATION=../helloworld-local.json \
VSOMEIP_APPLICATION_NAME=hello_world_client \
./hello_world_client
```

## Windows

The Hello World Example should be run on the same host.
The network addresses within the configuration files need to be adapted to match
the devices addresses.

HOST1:
Note: You may need to define the path of the DLLs to run the examples
```batch
set "PATH=<root directory of vSomeIP-Lib>\build\Release;<root directory of vSomeIP-Lib>\build\test\common;<root directory of boost instalation>\lib64-msvc-14.2;%PATH%"
```
```batch
set "VSOMEIP_CONFIGURATION=<root directory of vSomeIP-Lib>\examples\hello_world\helloworld-local.json"
set "VSOMEIP_APPLICATION_NAME=hello_world_service"
cd /d <root directory of vSomeIP-Lib>\examples\hello_world\build\Release
hello_world_service.exe
```

HOST1:
Note: You may need to define the path of the DLLs to run the examples
```batch
set "PATH=<root directory of vSomeIP-Lib>\build\Release;<root directory of vSomeIP-Lib>\build\test\common;<root directory of boost instalation>\lib64-msvc-14.2;%PATH%"
```
```batch
set "VSOMEIP_CONFIGURATION=<root directory of vSomeIP-Lib>\examples\hello_world\helloworld-local.json"
set "VSOMEIP_APPLICATION_NAME=hello_world_client"
cd /d <root directory of vSomeIP-Lib>\examples\hello_world\build\Release
hello_world_client.exe
```

### Notes for Windows:
- Replace `<root directory of vSomeIP-Lib>` with your actual vsomeip-lib path
- Replace `$YOUR_PATH` with your actual installation path
- Replace "Release" with "Debug" for debug builds
- Both applications need to be running simultaneously for communication to work
- Ensure all paths match your actual installation directories

Expected output service
-----------------------
Expand Down
70 changes: 70 additions & 0 deletions examples/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#### Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#### This Source Code Form is subject to the terms of the Mozilla Public
#### License, v. 2.0. If a copy of the MPL was not distributed with this
#### file, You can obtain one at http://mozilla.org/MPL/2.0/.

# vSomeIP Examples

To use the example applications you need two devices on the same network. The network addresses within
the configuration files need to be adapted to match the devices addresses.

## Linux

### Request/Response Example

To start the request/response-example from the build-directory do:
```bash
# HOST1:
env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./request-sample
# HOST1:
env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./response-sample
```

To start the subscribe/notify-example from the build-directory do:
```bash
# HOST1:
env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./subscribe-sample
# HOST1:
env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./notify-sample
```

## Windows

Note: You may need to define the path of the DLLs in each terminal to run the examples
```bash
set "PATH=<root directory of vSomeIP-Lib build>\Release;<root directory of vSomeIP-Lib build>\test\common;<root directory of boost instalation>\lib64-msvc-14.2;%PATH%"
```

To start the request/response-example from the build-directory do:
```bash
#HOST1:
set "VSOMEIP_CONFIGURATION=<root directory of vSomeIP-Lib>\config\vsomeip-local.json"
set "VSOMEIP_APPLICATION_NAME=service-sample"
cd /d "<root directory of vSomeIP-Lib>\buildlib\examples\Release"
response-sample.exe
#HOST1:
set "VSOMEIP_CONFIGURATION=<root directory of vSomeIP-Lib>\config\vsomeip-local.json"
set "VSOMEIP_APPLICATION_NAME=client-sample"
cd /d "<root directory of vSomeIP-Lib build>\examples\Release"
request-sample.exe
```

To start the subscribe/notify-example from the build-directory do:
```bash
#HOST1:
set "VSOMEIP_CONFIGURATION=<root directory of vSomeIP-Lib>\config\vsomeip-local.json"
set "VSOMEIP_APPLICATION_NAME=service-sample"
cd /d "<root directory of vSomeIP-Lib>\buildlib\examples\Release"
notify-sample.exe
#HOST1:
set "VSOMEIP_CONFIGURATION=<root directory of vSomeIP-Lib>\config\vsomeip-local.json"
set "VSOMEIP_APPLICATION_NAME=client-sample"
cd /d "<root directory of vSomeIP-Lib build>\examples\Release"
subscribe-sample.exe
```

Note:
- Replace `<root directory of vSomeIP-Lib>` with your actual vsomeip-lib path
- Replace `<root directory of vSomeIP-Lib build>` with your actual vsomeip-lib build path
- Replace `$YOUR_PATH` with your actual installation path
- Replace "Release" with "Debug" for debug builds
17 changes: 0 additions & 17 deletions examples/readme.txt

This file was deleted.

1 change: 1 addition & 0 deletions implementation/configuration/include/internal.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#define VSOMEIP_MAX_TCP_CONNECT_TIME 5000
#define VSOMEIP_MAX_TCP_RESTART_ABORTS 5
#define VSOMEIP_MAX_TCP_SENT_WAIT_TIME 10000
#define VSOMEIP_TCP_USER_TIMEOUT 3000

#define VSOMEIP_MAX_NETLINK_RETRIES 3

Expand Down
1 change: 1 addition & 0 deletions implementation/configuration/include/internal_android.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#define VSOMEIP_MAX_TCP_CONNECT_TIME 5000
#define VSOMEIP_MAX_TCP_RESTART_ABORTS 5
#define VSOMEIP_MAX_TCP_SENT_WAIT_TIME 10000
#define VSOMEIP_TCP_USER_TIMEOUT 3000

#define VSOMEIP_MAX_NETLINK_RETRIES 3

Expand Down
10 changes: 5 additions & 5 deletions implementation/configuration/src/configuration_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ configuration_impl::configuration_impl(const std::string& _path) :

policy_manager_ = std::make_shared<policy_manager_impl>();
security_ = std::make_shared<security>(policy_manager_);
unicast_ = unicast_.from_string(VSOMEIP_UNICAST_ADDRESS);
netmask_ = netmask_.from_string(VSOMEIP_NETMASK);
unicast_ = boost::asio::ip::make_address(VSOMEIP_UNICAST_ADDRESS);
netmask_ = boost::asio::ip::make_address(VSOMEIP_NETMASK);
for (auto i = 0; i < ET_MAX; i++)
is_configured_[i] = false;

Expand Down Expand Up @@ -1555,7 +1555,7 @@ void configuration_impl::load_unicast_address(const configuration_element &_elem
VSOMEIP_WARNING << "Multiple definitions for unicast."
"Ignoring definition from " << _element.name_;
} else {
unicast_ = unicast_.from_string(its_value);
unicast_ = boost::asio::ip::make_address(its_value);
is_configured_[ET_UNICAST] = true;
}
} catch (...) {
Expand All @@ -1571,7 +1571,7 @@ void configuration_impl::load_netmask(const configuration_element &_element) {
VSOMEIP_WARNING << "Multiple definitions for netmask/prefix."
"Ignoring netmask definition from " << _element.name_;
} else {
netmask_ = netmask_.from_string(*its_value);
netmask_ = boost::asio::ip::make_address(*its_value);
is_configured_[ET_NETMASK] = true;
}
}
Expand Down Expand Up @@ -4379,7 +4379,7 @@ void configuration_impl::load_acceptance_data(const boost::property_tree::ptree&
std::string its_value(i->second.data());

if (its_key == "address") {
its_address = boost::asio::ip::address::from_string(its_value);
its_address = boost::asio::ip::make_address(its_value);
} else if (its_key == "path") {
load_activation_file_path(its_paths, i->second);
} else if (its_key == "reliable" || its_key == "unreliable") {
Expand Down
Loading
Loading