diff --git a/pom.xml b/pom.xml
index 4ec7d4f05075e5ff7569ffffbb1fb28d5b4e3b16..aee55c1f3dc985b4b8434a4e563dfe9c25232b4b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
de.monticore.lang.monticar
embedded-montiarc-math-emam2someip-generator
- 1.2-SNAPSHOT
+ 1.3-SNAPSHOT
emam2someip
diff --git a/src/main/resources/de/monticore/lang/monticar/generator/someip/template/Adapter.cpp.ftl b/src/main/resources/de/monticore/lang/monticar/generator/someip/template/Adapter.cpp.ftl
index b2fa089452f541b2afc5d344856b86a3f59ce4af..68ed0cfeb79fdad813414f644959a00cefa9767d 100644
--- a/src/main/resources/de/monticore/lang/monticar/generator/someip/template/Adapter.cpp.ftl
+++ b/src/main/resources/de/monticore/lang/monticar/generator/someip/template/Adapter.cpp.ftl
@@ -2,7 +2,7 @@
<#import "SomeIPMacros.ftl" as m>
#include "<@m.mwIdent/>Adapter_${model.getEscapedCompName()}.h"
-<@m.mwIdent/>Adapter_${model.getEscapedCompName()}::<@m.mwIdent/>Adapter_${model.getEscapedCompName()}() : public IAdapter_${model.getEscapedCompName()} {
+<@m.mwIdent/>Adapter_${model.getEscapedCompName()}::<@m.mwIdent/>Adapter_${model.getEscapedCompName()}() {
}
diff --git a/src/main/resources/de/monticore/lang/monticar/generator/someip/template/CMakeLists.ftl b/src/main/resources/de/monticore/lang/monticar/generator/someip/template/CMakeLists.ftl
index caf8770936ca205aa2b0e6b54b4c103130ea45f6..678707b3e49772c43a48fd5512ea7f8d457b1bef 100644
--- a/src/main/resources/de/monticore/lang/monticar/generator/someip/template/CMakeLists.ftl
+++ b/src/main/resources/de/monticore/lang/monticar/generator/someip/template/CMakeLists.ftl
@@ -6,6 +6,9 @@ cmake_minimum_required (VERSION 2.8)
# Using C++ with flags
set (CMAKE_CXX_FLAGS "-g -std=c++0x")
+# Setting project name and description
+project(${model.getCompName()})
+
# Find vsomeip and boost packages
find_package (vsomeip 2.10.0 REQUIRED)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
@@ -17,19 +20,19 @@ include_directories (
)
# Linking libraries to target
-add_library(SomeIPAdapter_${model.getEscapedCompName()} SomeIPAdapter_${model.getEscapedCompName()}.cpp
+add_library(SomeIPAdapter_${model.getEscapedCompName()}
SomeIPAdapter_${model.getEscapedCompName()}.cpp
SomeIPAdapter_${model.getEscapedCompName()}.h
-${model.getEscapedCompName()}.cpp
-${model.getEscapedCompName()}.h
)
list(APPEND LIBRARIES ${model.getEscapedCompName()})
list(APPEND LIBRARIES IAdapter_${model.getEscapedCompName()})
-target_link_libraries(SomeIPAdapter_${model.getEscapedCompName()} vsomeip <#noparse>${Boost_LIBRARIES}#noparse> <#noparse>${LIBRARIES}#noparse>)
+# Adding include directory to a target
+target_include_directories(SomeIPAdapter_${model.getEscapedCompName()} PUBLIC <#noparse>${LIBRARIES}#noparse> <#noparse>${INCLUDE_DIRS}#noparse> <#noparse>${CMAKE_CURRENT_SOURCE_DIR}#noparse>)
-target_include_directories(SomeIPAdapter_${model.getEscapedCompName()} PUBLIC <#noparse>${INCLUDE_DIRS}#noparse>)
+# Linking libraries to target
+target_link_libraries(SomeIPAdapter_${model.getEscapedCompName()} PUBLIC vsomeip <#noparse>${Boost_LIBRARIES}#noparse> <#noparse>${LIBRARIES}#noparse>)
# Export target to a cmake module file for outside usage
export(TARGETS SomeIPAdapter_${model.getEscapedCompName()} FILE SomeIPAdapter_${model.getEscapedCompName()}.cmake)
diff --git a/src/test/java/de/monticore/lang/monticar/generator/someip/AdapterGenerationTest.java b/src/test/java/de/monticore/lang/monticar/generator/someip/AdapterGenerationTest.java
index 22d4dc3824fe1398b7a8f78d91288f85ce14bbd4..571908c6c65057e0a80dfc12b185055a7691e62e 100644
--- a/src/test/java/de/monticore/lang/monticar/generator/someip/AdapterGenerationTest.java
+++ b/src/test/java/de/monticore/lang/monticar/generator/someip/AdapterGenerationTest.java
@@ -36,8 +36,14 @@ public class AdapterGenerationTest extends AbstractSymtabTest {
// Connect component's ports to topics
componentInstanceSymbol.getPortInstance("in1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(11,12,13/*,14,15*/));
componentInstanceSymbol.getPortInstance("in2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(21,22,23/*,24,25*/));
+ componentInstanceSymbol.getPortInstance("in3").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(31,32,33/*,34,35*/));
+ componentInstanceSymbol.getPortInstance("in4").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(41,42,43/*,44,45*/));
+ componentInstanceSymbol.getPortInstance("in5").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(51,52,53/*,54,55*/));
componentInstanceSymbol.getPortInstance("out1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(111,112,113/*,114,115*/));
componentInstanceSymbol.getPortInstance("out2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(121,122,123/*,124,125*/));
+ componentInstanceSymbol.getPortInstance("out3").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(131,132,133/*,134,135*/));
+ componentInstanceSymbol.getPortInstance("out4").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(141,142,143/*,144,145*/));
+ componentInstanceSymbol.getPortInstance("out5").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(151,152,153/*,154,155*/));
List files = generatorSomeIP.generateSomeIPAdapter(componentInstanceSymbol);
diff --git a/src/test/java/de/monticore/lang/monticar/generator/someip/PrettyPrintGenerationTest.java b/src/test/java/de/monticore/lang/monticar/generator/someip/PrettyPrintGenerationTest.java
index 7a9eb9b51652b5f5771fe1a2c26b88eeb9965fed..f6e7fea3d62077198dadb369a55ee5e4c6c5dabe 100644
--- a/src/test/java/de/monticore/lang/monticar/generator/someip/PrettyPrintGenerationTest.java
+++ b/src/test/java/de/monticore/lang/monticar/generator/someip/PrettyPrintGenerationTest.java
@@ -34,7 +34,16 @@ public class PrettyPrintGenerationTest extends AbstractSymtabTest {
generatorSomeIP.setGenerationTargetPath("./target/generated-sources/");
// Connect component's ports to topics
- componentInstanceSymbol.getPortInstance("in1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(1,2,3));
+ componentInstanceSymbol.getPortInstance("in1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(11,12,13/*,14,15*/));
+ componentInstanceSymbol.getPortInstance("in2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(21,22,23/*,24,25*/));
+ componentInstanceSymbol.getPortInstance("in3").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(31,32,33/*,34,35*/));
+ componentInstanceSymbol.getPortInstance("in4").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(41,42,43/*,44,45*/));
+ componentInstanceSymbol.getPortInstance("in5").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(51,52,53/*,54,55*/));
+ componentInstanceSymbol.getPortInstance("out1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(111,112,113/*,114,115*/));
+ componentInstanceSymbol.getPortInstance("out2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(121,122,123/*,124,125*/));
+ componentInstanceSymbol.getPortInstance("out3").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(131,132,133/*,134,135*/));
+ componentInstanceSymbol.getPortInstance("out4").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(141,142,143/*,144,145*/));
+ componentInstanceSymbol.getPortInstance("out5").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(151,152,153/*,154,155*/));
List files = generatorSomeIP.generatePrettyPrint(componentInstanceSymbol);
diff --git a/src/test/resources/results/echo/ports.txt b/src/test/resources/results/echo/ports.txt
index fec7778c3cf6e8ccfafc2fefb7f9f9a55fddabbd..2b2c78e8106ca3daa50e667761ffbfbfcdd37e6b 100644
--- a/src/test/resources/results/echo/ports.txt
+++ b/src/test/resources/results/echo/ports.txt
@@ -3,7 +3,13 @@ Component name: tests.a.compA
Ports:
-in1 : incoming (someip, serviceID: 1 instanceID: 2 eventgroupID: 3)
-in2 : incoming (unknown symbol)
-out1 : outgoing (unknown symbol)
-out2 : outgoing (unknown symbol)
+in1 : incoming (someip, serviceID: 11 instanceID: 12 eventgroupID: 13)
+in2 : incoming (someip, serviceID: 21 instanceID: 22 eventgroupID: 23)
+in3 : incoming (someip, serviceID: 31 instanceID: 32 eventgroupID: 33)
+in4 : incoming (someip, serviceID: 41 instanceID: 42 eventgroupID: 43)
+in5 : incoming (someip, serviceID: 51 instanceID: 52 eventgroupID: 53)
+out1 : outgoing (someip, serviceID: 111 instanceID: 112 eventgroupID: 113)
+out2 : outgoing (someip, serviceID: 121 instanceID: 122 eventgroupID: 123)
+out3 : outgoing (someip, serviceID: 131 instanceID: 132 eventgroupID: 133)
+out4 : outgoing (someip, serviceID: 141 instanceID: 142 eventgroupID: 143)
+out5 : outgoing (someip, serviceID: 151 instanceID: 152 eventgroupID: 153)
diff --git a/src/test/resources/results/echoAdapter/CMakeLists.txt b/src/test/resources/results/echoAdapter/CMakeLists.txt
index 3bd5a561920c887f9d4b12a7ac25f6fcb324c0a1..78880e61596692741bc56de28070e6f12ddb230b 100644
--- a/src/test/resources/results/echoAdapter/CMakeLists.txt
+++ b/src/test/resources/results/echoAdapter/CMakeLists.txt
@@ -4,6 +4,9 @@ cmake_minimum_required (VERSION 2.8)
# Using C++ with flags
set (CMAKE_CXX_FLAGS "-g -std=c++0x")
+# Setting project name and description
+project(tests.a.compA)
+
# Find vsomeip and boost packages
find_package (vsomeip 2.10.0 REQUIRED)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
@@ -15,19 +18,19 @@ include_directories (
)
# Linking libraries to target
-add_library(SomeIPAdapter_tests_a_compA SomeIPAdapter_tests_a_compA.cpp
+add_library(SomeIPAdapter_tests_a_compA
SomeIPAdapter_tests_a_compA.cpp
SomeIPAdapter_tests_a_compA.h
-tests_a_compA.cpp
-tests_a_compA.h
)
list(APPEND LIBRARIES tests_a_compA)
list(APPEND LIBRARIES IAdapter_tests_a_compA)
-target_link_libraries(SomeIPAdapter_tests_a_compA vsomeip ${Boost_LIBRARIES} ${LIBRARIES})
+# Adding include directory to a target
+target_include_directories(SomeIPAdapter_tests_a_compA PUBLIC ${LIBRARIES} ${INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
-target_include_directories(SomeIPAdapter_tests_a_compA PUBLIC ${INCLUDE_DIRS})
+# Linking libraries to target
+target_link_libraries(SomeIPAdapter_tests_a_compA PUBLIC vsomeip ${Boost_LIBRARIES} ${LIBRARIES})
# Export target to a cmake module file for outside usage
export(TARGETS SomeIPAdapter_tests_a_compA FILE SomeIPAdapter_tests_a_compA.cmake)
diff --git a/src/test/resources/results/echoAdapter/SomeIPAdapter_tests_a_compA.cpp b/src/test/resources/results/echoAdapter/SomeIPAdapter_tests_a_compA.cpp
index c24602bca8c18cf3d75d422f1999eae0d65ebd39..ba17ecdc16ad2e1167372d0aa3796e877a85dc46 100644
--- a/src/test/resources/results/echoAdapter/SomeIPAdapter_tests_a_compA.cpp
+++ b/src/test/resources/results/echoAdapter/SomeIPAdapter_tests_a_compA.cpp
@@ -1,7 +1,7 @@
/* (c) https://github.com/MontiCore/monticore */
#include "SomeIPAdapter_tests_a_compA.h"
-SomeIPAdapter_tests_a_compA::SomeIPAdapter_tests_a_compA() : public IAdapter_tests_a_compA {
+SomeIPAdapter_tests_a_compA::SomeIPAdapter_tests_a_compA() {
}
@@ -33,6 +33,39 @@ void SomeIPAdapter_tests_a_compA::init(tests_a_compA *comp) {
std::thread sender_in2(std::bind(&SomeIPAdapter_tests_a_compA::run_in2, this));
in2_Subscriber->start();
+ in3_Subscriber = vsomeip::runtime::get()->create_application("Subscriber in3");
+ if (!in3_Subscriber->init()) {
+ std::cerr << "Couldn't initialize Subscriber in3" << std::endl;
+ }
+
+ in3_Subscriber->register_availability_handler(31, 32, std::bind(&SomeIPAdapter_tests_a_compA::on_availability_in3, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
+ in3_Subscriber->request_service(31, 32);
+ in3_Subscriber->register_message_handler(31, 32, 0, std::bind(&SomeIPAdapter_tests_a_compA::on_message_in3, this, std::placeholders::_1));
+
+ std::thread sender_in3(std::bind(&SomeIPAdapter_tests_a_compA::run_in3, this));
+ in3_Subscriber->start();
+ in4_Subscriber = vsomeip::runtime::get()->create_application("Subscriber in4");
+ if (!in4_Subscriber->init()) {
+ std::cerr << "Couldn't initialize Subscriber in4" << std::endl;
+ }
+
+ in4_Subscriber->register_availability_handler(41, 42, std::bind(&SomeIPAdapter_tests_a_compA::on_availability_in4, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
+ in4_Subscriber->request_service(41, 42);
+ in4_Subscriber->register_message_handler(41, 42, 0, std::bind(&SomeIPAdapter_tests_a_compA::on_message_in4, this, std::placeholders::_1));
+
+ std::thread sender_in4(std::bind(&SomeIPAdapter_tests_a_compA::run_in4, this));
+ in4_Subscriber->start();
+ in5_Subscriber = vsomeip::runtime::get()->create_application("Subscriber in5");
+ if (!in5_Subscriber->init()) {
+ std::cerr << "Couldn't initialize Subscriber in5" << std::endl;
+ }
+
+ in5_Subscriber->register_availability_handler(51, 52, std::bind(&SomeIPAdapter_tests_a_compA::on_availability_in5, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
+ in5_Subscriber->request_service(51, 52);
+ in5_Subscriber->register_message_handler(51, 52, 0, std::bind(&SomeIPAdapter_tests_a_compA::on_message_in5, this, std::placeholders::_1));
+
+ std::thread sender_in5(std::bind(&SomeIPAdapter_tests_a_compA::run_in5, this));
+ in5_Subscriber->start();
// Intitialize Publisher
@@ -48,6 +81,24 @@ void SomeIPAdapter_tests_a_compA::init(tests_a_compA *comp) {
}
out2_Publisher->offer_service(121, 122);
out2_Publisher->start();
+ out3_Publisher = vsomeip::runtime::get()->create_application("Publisher out3");
+ if (!out3_Publisher->init()) {
+ std::cerr << "Couldn't initialize Publisher out3" << std::endl;
+}
+ out3_Publisher->offer_service(131, 132);
+ out3_Publisher->start();
+ out4_Publisher = vsomeip::runtime::get()->create_application("Publisher out4");
+ if (!out4_Publisher->init()) {
+ std::cerr << "Couldn't initialize Publisher out4" << std::endl;
+ }
+ out4_Publisher->offer_service(141, 142);
+ out4_Publisher->start();
+ out5_Publisher = vsomeip::runtime::get()->create_application("Publisher out5");
+ if (!out5_Publisher->init()) {
+ std::cerr << "Couldn't initialize Publisher out5" << std::endl;
+ }
+ out5_Publisher->offer_service(151, 152);
+ out5_Publisher->start();
}
void SomeIPAdapter_tests_a_compA::run_in1() {
@@ -65,7 +116,10 @@ void SomeIPAdapter_tests_a_compA::on_message_in1(const std::shared_ptr its_payload = _message->get_payload();
vsomeip::length_t l = its_payload->get_length();
double dataFromMessage = *((double*)its_payload->get_data());
+
+ // double
component->in1 = dataFromMessage;
+
//print data to std out
std::cout << "SERVICE in1: Received message from ["
<< std::setw(4) << std::setfill('0') << std::hex << _message->get_client() << "/"
@@ -96,7 +150,10 @@ void SomeIPAdapter_tests_a_compA::on_message_in2(const std::shared_ptr its_payload = _message->get_payload();
vsomeip::length_t l = its_payload->get_length();
double dataFromMessage = *((double*)its_payload->get_data());
+
+ // double
component->in2 = dataFromMessage;
+
//print data to std out
std::cout << "SERVICE in2: Received message from ["
<< std::setw(4) << std::setfill('0') << std::hex << _message->get_client() << "/"
@@ -112,11 +169,114 @@ void SomeIPAdapter_tests_a_compA::on_availability_in2(vsomeip::service_t _servic
<< std::endl;
condition_in2.notify_one();
}
+void SomeIPAdapter_tests_a_compA::run_in3() {
+ std::unique_lock its_lock(mutex_in3);
+ condition_in3.wait(its_lock);
+
+ std::set event_group;
+ event_group.insert(33);
+ in3_Subscriber->request_event(31, 32, 0, event_group, true);
+ in3_Subscriber->subscribe(31, 32, 33);
+}
+
+void SomeIPAdapter_tests_a_compA::on_message_in3(const std::shared_ptr &_message) {
+ //read received message
+ std::shared_ptr its_payload = _message->get_payload();
+ vsomeip::length_t l = its_payload->get_length();
+ double dataFromMessage = *((double*)its_payload->get_data());
+
+ //int
+ component->in3 = (int) round(dataFromMessage);
+
+ //print data to std out
+ std::cout << "SERVICE in3: Received message from ["
+ << std::setw(4) << std::setfill('0') << std::hex << _message->get_client() << "/"
+ << std::setw(4) << std::setfill('0') << std::hex << _message->get_session() << "]: "
+ << dataFromMessage << std::endl;
+}
+
+void SomeIPAdapter_tests_a_compA::on_availability_in3(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available) {
+ std::cout << "Service ["
+ << std::setw(4) << std::setfill('0') << std::hex << _service << "." << _instance
+ << "] is "
+ << (_is_available ? "available." : "NOT available.")
+ << std::endl;
+ condition_in3.notify_one();
+}
+void SomeIPAdapter_tests_a_compA::run_in4() {
+ std::unique_lock its_lock(mutex_in4);
+ condition_in4.wait(its_lock);
+
+ std::set event_group;
+ event_group.insert(43);
+ in4_Subscriber->request_event(41, 42, 0, event_group, true);
+ in4_Subscriber->subscribe(41, 42, 43);
+}
+
+void SomeIPAdapter_tests_a_compA::on_message_in4(const std::shared_ptr &_message) {
+ //read received message
+ std::shared_ptr its_payload = _message->get_payload();
+ vsomeip::length_t l = its_payload->get_length();
+ double dataFromMessage = *((double*)its_payload->get_data());
+
+ //int
+ component->in4 = (int) round(dataFromMessage);
+
+ //print data to std out
+ std::cout << "SERVICE in4: Received message from ["
+ << std::setw(4) << std::setfill('0') << std::hex << _message->get_client() << "/"
+ << std::setw(4) << std::setfill('0') << std::hex << _message->get_session() << "]: "
+ << dataFromMessage << std::endl;
+}
+
+void SomeIPAdapter_tests_a_compA::on_availability_in4(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available) {
+ std::cout << "Service ["
+ << std::setw(4) << std::setfill('0') << std::hex << _service << "." << _instance
+ << "] is "
+ << (_is_available ? "available." : "NOT available.")
+ << std::endl;
+ condition_in4.notify_one();
+}
+void SomeIPAdapter_tests_a_compA::run_in5() {
+ std::unique_lock its_lock(mutex_in5);
+ condition_in5.wait(its_lock);
+
+ std::set event_group;
+ event_group.insert(53);
+ in5_Subscriber->request_event(51, 52, 0, event_group, true);
+ in5_Subscriber->subscribe(51, 52, 53);
+}
+
+void SomeIPAdapter_tests_a_compA::on_message_in5(const std::shared_ptr &_message) {
+ //read received message
+ std::shared_ptr its_payload = _message->get_payload();
+ vsomeip::length_t l = its_payload->get_length();
+ double dataFromMessage = *((double*)its_payload->get_data());
+
+ //bool
+ component->in5 = (dataFromMessage > 1.0e-10);
+
+ //print data to std out
+ std::cout << "SERVICE in5: Received message from ["
+ << std::setw(4) << std::setfill('0') << std::hex << _message->get_client() << "/"
+ << std::setw(4) << std::setfill('0') << std::hex << _message->get_session() << "]: "
+ << dataFromMessage << std::endl;
+}
+
+void SomeIPAdapter_tests_a_compA::on_availability_in5(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available) {
+ std::cout << "Service ["
+ << std::setw(4) << std::setfill('0') << std::hex << _service << "." << _instance
+ << "] is "
+ << (_is_available ? "available." : "NOT available.")
+ << std::endl;
+ condition_in5.notify_one();
+}
void SomeIPAdapter_tests_a_compA::publishout1_Publisher()
{
//Read data from component
+ // double
double d = component->out1;
const vsomeip::byte_t its_data[] = { (uint8_t) d };
@@ -132,6 +292,7 @@ void SomeIPAdapter_tests_a_compA::publishout1_Publisher()
void SomeIPAdapter_tests_a_compA::publishout2_Publisher()
{
//Read data from component
+ // double
double d = component->out2;
const vsomeip::byte_t its_data[] = { (uint8_t) d };
@@ -144,10 +305,61 @@ void SomeIPAdapter_tests_a_compA::publishout2_Publisher()
out2_Publisher->offer_event(121, 122, 0, event_group, true);
out2_Publisher->notify(121, 122, 0, payload);
}
+void SomeIPAdapter_tests_a_compA::publishout3_Publisher()
+{
+ //Read data from component
+ //int
+ double d = 1.0 * component->out3;
+
+ const vsomeip::byte_t its_data[] = { (uint8_t) d };
+ std::shared_ptr payload = vsomeip::runtime::get()->create_payload();
+ payload->set_data(its_data, sizeof(its_data));
+
+ //Publish
+ std::set event_group;
+ event_group.insert(133);
+ out3_Publisher->offer_event(131, 132, 0, event_group, true);
+ out3_Publisher->notify(131, 132, 0, payload);
+}
+void SomeIPAdapter_tests_a_compA::publishout4_Publisher()
+{
+ //Read data from component
+ //int
+ double d = 1.0 * component->out4;
+
+ const vsomeip::byte_t its_data[] = { (uint8_t) d };
+ std::shared_ptr payload = vsomeip::runtime::get()->create_payload();
+ payload->set_data(its_data, sizeof(its_data));
+
+ //Publish
+ std::set event_group;
+ event_group.insert(143);
+ out4_Publisher->offer_event(141, 142, 0, event_group, true);
+ out4_Publisher->notify(141, 142, 0, payload);
+}
+void SomeIPAdapter_tests_a_compA::publishout5_Publisher()
+{
+ //Read data from component
+ //bool
+ double d = component->out5 ? 1.0 : 0.0;
+
+ const vsomeip::byte_t its_data[] = { (uint8_t) d };
+ std::shared_ptr payload = vsomeip::runtime::get()->create_payload();
+ payload->set_data(its_data, sizeof(its_data));
+
+ //Publish
+ std::set event_group;
+ event_group.insert(153);
+ out5_Publisher->offer_event(151, 152, 0, event_group, true);
+ out5_Publisher->notify(151, 152, 0, payload);
+}
void SomeIPAdapter_tests_a_compA::tick()
{
publishout1_Publisher();
publishout2_Publisher();
+ publishout3_Publisher();
+ publishout4_Publisher();
+ publishout5_Publisher();
}
diff --git a/src/test/resources/results/echoAdapter/SomeIPAdapter_tests_a_compA.h b/src/test/resources/results/echoAdapter/SomeIPAdapter_tests_a_compA.h
index 1c5202916b850c7d6370781b9bc24c5a46f6d43c..08df549b9543e709ce770c9f437a7f15461269a6 100644
--- a/src/test/resources/results/echoAdapter/SomeIPAdapter_tests_a_compA.h
+++ b/src/test/resources/results/echoAdapter/SomeIPAdapter_tests_a_compA.h
@@ -43,6 +43,27 @@ private:
void run_in2();
void on_message_in2(const std::shared_ptr &_message);
void on_availability_in2(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
+ std::shared_ptr in3_Subscriber;
+ std::mutex mutex_in3;
+ std::condition_variable condition_in3;
+
+ void run_in3();
+ void on_message_in3(const std::shared_ptr &_message);
+ void on_availability_in3(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
+ std::shared_ptr in4_Subscriber;
+ std::mutex mutex_in4;
+ std::condition_variable condition_in4;
+
+ void run_in4();
+ void on_message_in4(const std::shared_ptr &_message);
+ void on_availability_in4(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
+ std::shared_ptr in5_Subscriber;
+ std::mutex mutex_in5;
+ std::condition_variable condition_in5;
+
+ void run_in5();
+ void on_message_in5(const std::shared_ptr &_message);
+ void on_availability_in5(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
std::shared_ptr out1_Publisher;
@@ -50,4 +71,13 @@ private:
std::shared_ptr out2_Publisher;
void publishout2_Publisher();
+ std::shared_ptr out3_Publisher;
+
+ void publishout3_Publisher();
+ std::shared_ptr out4_Publisher;
+
+ void publishout4_Publisher();
+ std::shared_ptr out5_Publisher;
+
+ void publishout5_Publisher();
};
diff --git a/src/test/resources/results/echoCMake/CMakeLists.txt b/src/test/resources/results/echoCMake/CMakeLists.txt
index 3bd5a561920c887f9d4b12a7ac25f6fcb324c0a1..78880e61596692741bc56de28070e6f12ddb230b 100644
--- a/src/test/resources/results/echoCMake/CMakeLists.txt
+++ b/src/test/resources/results/echoCMake/CMakeLists.txt
@@ -4,6 +4,9 @@ cmake_minimum_required (VERSION 2.8)
# Using C++ with flags
set (CMAKE_CXX_FLAGS "-g -std=c++0x")
+# Setting project name and description
+project(tests.a.compA)
+
# Find vsomeip and boost packages
find_package (vsomeip 2.10.0 REQUIRED)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
@@ -15,19 +18,19 @@ include_directories (
)
# Linking libraries to target
-add_library(SomeIPAdapter_tests_a_compA SomeIPAdapter_tests_a_compA.cpp
+add_library(SomeIPAdapter_tests_a_compA
SomeIPAdapter_tests_a_compA.cpp
SomeIPAdapter_tests_a_compA.h
-tests_a_compA.cpp
-tests_a_compA.h
)
list(APPEND LIBRARIES tests_a_compA)
list(APPEND LIBRARIES IAdapter_tests_a_compA)
-target_link_libraries(SomeIPAdapter_tests_a_compA vsomeip ${Boost_LIBRARIES} ${LIBRARIES})
+# Adding include directory to a target
+target_include_directories(SomeIPAdapter_tests_a_compA PUBLIC ${LIBRARIES} ${INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
-target_include_directories(SomeIPAdapter_tests_a_compA PUBLIC ${INCLUDE_DIRS})
+# Linking libraries to target
+target_link_libraries(SomeIPAdapter_tests_a_compA PUBLIC vsomeip ${Boost_LIBRARIES} ${LIBRARIES})
# Export target to a cmake module file for outside usage
export(TARGETS SomeIPAdapter_tests_a_compA FILE SomeIPAdapter_tests_a_compA.cmake)
diff --git a/src/test/resources/tests/a/CompA.emam b/src/test/resources/tests/a/CompA.emam
index 3d7575eb02f6e4287dd7427d5887a2d2078b4752..00f51b7abdb17e1a52f7f2f73210791d19d9166b 100644
--- a/src/test/resources/tests/a/CompA.emam
+++ b/src/test/resources/tests/a/CompA.emam
@@ -4,6 +4,12 @@ package tests.a;
component CompA{
port in Q in1;
port in Q in2;
+ port in N in3;
+ port in Z in4;
+ port in B in5;
port out Q out1;
port out Q out2;
+ port out N out3;
+ port out Z out4;
+ port out B out5;
}