Commit 7466103a authored by Alexander David Hellwig's avatar Alexander David Hellwig

Merge branch '19-add-deploy-job-to-gitlab-ci' into 'master'

Resolve "Add deploy job to gitlab-ci"

See merge request !3
parents d20b02e1 953f8c48
Pipeline #166074 passed with stages
in 1 minute and 39 seconds
stages:
- project
- adapter
- deploy
BranchJobDeploy:
stage: deploy
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emam2mqtt
script:
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean deploy --settings settings.xml
- cat target/site/jacoco/index.html
only:
- master
BranchJobProject:
stage: project
......
# Use an official Python runtime as a parent image
FROM ubuntu:16.04
# Install Java 8
RUN apt-get update \
&& apt-get -y install openjdk-8-jdk \
&& rm -rf /var/lib/apt/lists/*
......@@ -9,6 +10,7 @@ ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
ENV PATH $JAVA_HOME/bin:$PATH
#Install cmake, boost, maven, git
RUN apt-get update && apt-get -y install \
build-essential \
cmake \
......@@ -35,7 +37,7 @@ WORKDIR /usr/src/emam2someip/vsomeip
RUN rm -rf build
#copy example and adapter
#copy example
COPY . /usr/src/emam2someip
#build example
......@@ -44,5 +46,3 @@ WORKDIR /usr/src/emam2someip/example/build
RUN cmake ..
RUN make
WORKDIR /usr/src/emam2someip/
# Setting cmake version
cmake_minimum_required (VERSION 2.8)
# Using C++ version 11 with threads for compiling
set (CMAKE_CXX_FLAGS "-g -std=c++0x")
# Find packages and include directories
find_package (vsomeip 2.10.0 REQUIRED)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
include_directories (
${Boost_INCLUDE_DIR}
${VSOMEIP_INCLUDE_DIRS}
)
# Linking libraries to target
add_library(SomeipAdapter_tests_a_compA SomeipAdapter_tests_a_compA.cpp)
target_link_libraries(SomeipAdapter_tests_a_compA vsomeip ${Boost_LIBRARIES})
# Export target to a cmake module file for outside usage
export(TARGETS SomeipAdapter_tests_a_compA FILE SomeipAdapter_tests_a_compA.cmake)
#include "SomeipAdapter_tests_a_compA.h"
#define SAMPLE_SERVICE_ID 0x1234
#define SAMPLE_INSTANCE_ID 0x5678
#define SAMPLE_METHOD_ID 0x0421
#define SAMPLE_EVENT_ID 0x2345
#define SAMPLE_EVENTGROUP_ID 0x1456
tests_a_compA* component;
std::shared_ptr<vsomeip::application> _clockSubscriber;
std::shared_ptr<vsomeip::application> _echoPublisher;
SomeipAdapter_tests_a_compA::SomeipAdapter_tests_a_compA() {}
void SomeipAdapter_tests_a_compA::init(tests_a_compA *comp)
{
this->component = comp;
_clockSubscriber = vsomeip::runtime::get()->create_application("Subscriber");
_clockSubscriber->init();
//_clockSubscriber->register_availability_handler(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, on_availability);
_clockSubscriber->request_service(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID);
_clockSubscriber->register_message_handler(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, SAMPLE_METHOD_ID, std::bind(&SomeipAdapter_tests_a_compA::on_message, this, std::placeholders::_1));
//_clockSubscriber->register_message_handler(vsomeip::ANY_SERVICE, vsomeip::ANY_INSTANCE, vsomeip::ANY_METHOD, std::bind(&SomeipAdapter_tests_a_compA::on_message, this, std::placeholders::_1));
std::set<vsomeip::eventgroup_t> its_groups;
its_groups.insert(SAMPLE_EVENTGROUP_ID);
_clockSubscriber->request_event(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, SAMPLE_EVENT_ID, its_groups, true);
_clockSubscriber->subscribe(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, SAMPLE_EVENTGROUP_ID);
_clockSubscriber->start();
_echoPublisher = vsomeip::runtime::get()->create_application("Publisher");
_echoPublisher->init();
//_echoPublisher->register_message_handler(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, SAMPLE_METHOD_ID, on_message);
_echoPublisher->offer_service(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID);
_echoPublisher->start();
}
void SomeipAdapter_tests_a_compA::on_message(const std::shared_ptr<vsomeip::message> &_request) {
std::shared_ptr<vsomeip::payload> its_payload = _request->get_payload();
vsomeip::length_t l = its_payload->get_length();
double dataFromMessage = *((double*)its_payload->get_data());
component->rosIn = dataFromMessage;
std::cout << "SERVICE: Received message from ["
<< std::setw(4) << std::setfill('0') << std::hex << _request->get_client() << "/"
<< std::setw(4) << std::setfill('0') << std::hex << _request->get_session() << "]: "
<< dataFromMessage << std::endl;
}
void SomeipAdapter_tests_a_compA::publish_echoPublisher()
{
double d = component->rosOut;
uint8_t *byteArray = (uint8_t*)&d;
vsomeip::byte_t *p;
p = byteArray;
std::shared_ptr< vsomeip::payload > payload = vsomeip::runtime::get()->create_payload(p,8);
//const vsomeip::byte_t its_data[] = component->rosOut; //component->rosOut
//std::shared_ptr< vsomeip::payload > payload = vsomeip::runtime::get()->create_payload();
//payload->set_data(its_data, sizeof(its_data));
std::set<vsomeip::eventgroup_t> its_groups;
its_groups.insert(SAMPLE_EVENTGROUP_ID);
_echoPublisher->offer_event(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, SAMPLE_EVENT_ID, its_groups, true);
_echoPublisher->notify(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, SAMPLE_EVENT_ID, payload);
}
void SomeipAdapter_tests_a_compA::tick()
{
publish_echoPublisher();
}
#pragma once
#include "tests_a_compA.h"
#include <iomanip>
#include <iostream>
#include <sstream>
#include <condition_variable>
#include <thread>
#include <vsomeip/vsomeip.hpp>
using namespace std;
class SomeipAdapter_tests_a_compA {
public:
SomeipAdapter_tests_a_compA();
void init(tests_a_compA* comp);
void publish_echoPublisher();
void tick();
void on_message(const std::shared_ptr<vsomeip::message> &_response);
private:
tests_a_compA* component = nullptr;
};
#ifndef tests_a_compA_h
#define tests_a_compA_h
#include <iostream>
using namespace std;
class tests_a_compA {
public:
double rosIn = 2.5;
double rosOut = 3.14;
};
#endif /* tests_a_compA_h */
......@@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>emam2someipgroup</groupId>
<artifactId>emam2someip</artifactId>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-emam2someip-generator</artifactId>
<version>1.0-SNAPSHOT</version>
<name>emam2someip</name>
......
......@@ -2,51 +2,82 @@
SomeIPAdapter_tests_a_compA::SomeIPAdapter_tests_a_compA() {
//choose random ids
service_id = 1;
instance_id = 2;
method_id = 3;
event_id = 4;
eventgroup_id = 5;
}
in1_service_id = 11;
in1_instance_id = 12;
in1_method_id = 13;
in1_event_id = 14;
in1_eventgroup_id = 15;
in2_service_id = 21;
in2_instance_id = 22;
in2_method_id = 23;
in2_event_id = 24;
in2_eventgroup_id = 25;
out1_service_id = 111;
out1_instance_id = 112;
out1_method_id = 113;
out1_event_id = 114;
out1_eventgroup_id = 115;
SomeIPAdapter_tests_a_compA::SomeIPAdapter_tests_a_compA(int service_id, int instance_id, int method_id, int event_id, int eventgroup_id) {
this->service_id = service_id;
this->instance_id = instance_id;
this->method_id = method_id;
this->event_id = event_id;
this->eventgroup_id = eventgroup_id;
out2_service_id = 121;
out2_instance_id = 122;
out2_method_id = 123;
out2_event_id = 124;
out2_eventgroup_id = 125;
}
void SomeIPAdapter_tests_a_compA::init(tests_a_compA *comp) {
// Initialize component
// Initialize component
this->component = comp;
// Intitialize subscriber
_clockSubscriber = vsomeip::runtime::get()->create_application("Subscriber");
_clockSubscriber->init();
_clockSubscriber->request_service(service_id, instance_id);
_clockSubscriber->register_message_handler(service_id, instance_id, method_id, std::bind(&SomeIPAdapter_tests_a_compA::on_message, this, std::placeholders::_1));
// Intitialize subscriber for in1
in1_Subscriber = vsomeip::runtime::get()->create_application("Subscriber");
in1_Subscriber->init();
in1_Subscriber->request_service(in1_service_id, in1_instance_id);
in1_Subscriber->register_message_handler(in1_service_id, in1_instance_id, in1_method_id, std::bind(&SomeIPAdapter_tests_a_compA::on_message_in1, this, std::placeholders::_1));
// Subscribe
std::set<vsomeip::eventgroup_t> event_group;
event_group.insert(eventgroup_id);
_clockSubscriber->request_event(service_id, instance_id, event_id, event_group, true);
_clockSubscriber->subscribe(service_id, instance_id, eventgroup_id);
_clockSubscriber->start();
// Intitialize Publisher
_echoPublisher = vsomeip::runtime::get()->create_application("Publisher");
_echoPublisher->init();
_echoPublisher->offer_service(service_id, instance_id);
_echoPublisher->start();
std::set<vsomeip::eventgroup_t> in1_event_group;
in1_event_group.insert(in1_eventgroup_id);
in1_Subscriber->request_event(in1_service_id, in1_instance_id, in1_event_id, in1_event_group, true);
in1_Subscriber->subscribe(in1_service_id, in1_instance_id, in1_eventgroup_id);
in1_Subscriber->start();
// Intitialize subscriber for in2
in2_Subscriber = vsomeip::runtime::get()->create_application("Subscriber");
in2_Subscriber->init();
in2_Subscriber->request_service(in2_service_id, in2_instance_id);
in2_Subscriber->register_message_handler(in2_service_id, in2_instance_id, in2_method_id, std::bind(&SomeIPAdapter_tests_a_compA::on_message_in2, this, std::placeholders::_1));
// Subscribe
std::set<vsomeip::eventgroup_t> in2_event_group;
in2_event_group.insert(in2_eventgroup_id);
in2_Subscriber->request_event(in2_service_id, in2_instance_id, in2_event_id, in2_event_group, true);
in2_Subscriber->subscribe(in2_service_id, in2_instance_id, in2_eventgroup_id);
in2_Subscriber->start();
// Intitialize Publisher for out1
out1_Publisher = vsomeip::runtime::get()->create_application("Publisher");
out1_Publisher->init();
out1_Publisher->offer_service(out1_service_id, out1_instance_id);
out1_Publisher->start();
// Intitialize Publisher for out2
out2_Publisher = vsomeip::runtime::get()->create_application("Publisher");
out2_Publisher->init();
out2_Publisher->offer_service(out2_service_id, out2_instance_id);
out2_Publisher->start();
}
void SomeIPAdapter_tests_a_compA::on_message(const std::shared_ptr<vsomeip::message> &_request) {
void SomeIPAdapter_tests_a_compA::on_message_in1(const std::shared_ptr<vsomeip::message> &_request) {
//read received message
std::shared_ptr<vsomeip::payload> its_payload = _request->get_payload();
vsomeip::length_t l = its_payload->get_length();
double dataFromMessage = *((double*)its_payload->get_data());
component->someIPIn = dataFromMessage;
component->in1 = dataFromMessage;
//print data to std out
std::cout << "SERVICE: Received message from ["
<< std::setw(4) << std::setfill('0') << std::hex << _request->get_client() << "/"
......@@ -54,10 +85,41 @@ void SomeIPAdapter_tests_a_compA::on_message(const std::shared_ptr<vsomeip::mess
<< dataFromMessage << std::endl;
}
void SomeIPAdapter_tests_a_compA::publish_echoPublisher()
void SomeIPAdapter_tests_a_compA::on_message_in2(const std::shared_ptr<vsomeip::message> &_request) {
//read received message
std::shared_ptr<vsomeip::payload> its_payload = _request->get_payload();
vsomeip::length_t l = its_payload->get_length();
double dataFromMessage = *((double*)its_payload->get_data());
component->in2 = dataFromMessage;
//print data to std out
std::cout << "SERVICE: Received message from ["
<< std::setw(4) << std::setfill('0') << std::hex << _request->get_client() << "/"
<< std::setw(4) << std::setfill('0') << std::hex << _request->get_session() << "]: "
<< dataFromMessage << std::endl;
}
void SomeIPAdapter_tests_a_compA::publishout1_Publisher()
{
//Read data from component
double d = component->out1;
//Create message
uint8_t *byteArray = (uint8_t*)&d;
vsomeip::byte_t *p;
p = byteArray;
std::shared_ptr< vsomeip::payload > payload = vsomeip::runtime::get()->create_payload(p,8);
//Publish
std::set<vsomeip::eventgroup_t> out1_event_group;
out1_event_group.insert(out1_eventgroup_id);
out1_Publisher->offer_event(out1_service_id, out1_instance_id, out1_event_id, out1_event_group, true);
out1_Publisher->notify(out1_service_id, out1_instance_id, out1_event_id, payload);
}
void SomeIPAdapter_tests_a_compA::publishout2_Publisher()
{
//Read data from component
double d = component->someIPOut;
double d = component->out2;
//Create message
uint8_t *byteArray = (uint8_t*)&d;
......@@ -66,13 +128,15 @@ void SomeIPAdapter_tests_a_compA::publish_echoPublisher()
std::shared_ptr< vsomeip::payload > payload = vsomeip::runtime::get()->create_payload(p,8);
//Publish
std::set<vsomeip::eventgroup_t> event_group;
event_group.insert(eventgroup_id);
_echoPublisher->offer_event(service_id, instance_id, event_id, event_group, true);
_echoPublisher->notify(service_id, instance_id, event_id, payload);
std::set<vsomeip::eventgroup_t> out2_event_group;
out2_event_group.insert(out2_eventgroup_id);
out2_Publisher->offer_event(out2_service_id, out2_instance_id, out2_event_id, out2_event_group, true);
out2_Publisher->notify(out2_service_id, out2_instance_id, out2_event_id, payload);
}
void SomeIPAdapter_tests_a_compA::tick()
{
publish_echoPublisher();
publishout1_Publisher();
publishout2_Publisher();
}
......@@ -17,27 +17,52 @@ public:
SomeIPAdapter_tests_a_compA();
SomeIPAdapter_tests_a_compA(int service_id, int instance_id, int method_id, int event_id, int eventgroup_id);
void init(tests_a_compA *comp);
void init(tests_a_compA* comp);
void on_message_in1(const std::shared_ptr<vsomeip::message> &_request);
void publish_echoPublisher();
void on_message_in2(const std::shared_ptr<vsomeip::message> &_request);
void publishout1_Publisher();
void publishout2_Publisher();
void tick();
void on_message(const std::shared_ptr<vsomeip::message> &_response);
private:
tests_a_compA* component = nullptr;
std::shared_ptr<vsomeip::application> _clockSubscriber;
std::shared_ptr<vsomeip::application> in1_Subscriber;
std::shared_ptr<vsomeip::application> in2_Subscriber;
std::shared_ptr<vsomeip::application> out1_Publisher;
std::shared_ptr<vsomeip::application> out2_Publisher;
int in1_service_id;
int in1_instance_id;
int in1_method_id;
int in1_event_id;
int in1_eventgroup_id;
int in2_service_id;
int in2_instance_id;
int in2_method_id;
int in2_event_id;
int in2_eventgroup_id;
std::shared_ptr<vsomeip::application> _echoPublisher;
int out1_service_id;
int out1_instance_id;
int out1_method_id;
int out1_event_id;
int out1_eventgroup_id;
int service_id;
int instance_id;
int method_id;
int event_id;
int eventgroup_id;
int out2_service_id;
int out2_instance_id;
int out2_method_id;
int out2_event_id;
int out2_eventgroup_id;
};
#include <stdio.h>
#include "tests_a_compA.h"
tests_a_compA::tests_a_compA(double value)
testComp::tests_a_compA(double out1_value, double out2_value)
{
someIPOut = value;
out1 = out1_value;
out2 = out2_value;
}
......@@ -9,8 +9,10 @@ class tests_a_compA {
public:
tests_a_compA(double value);
double someIPIn = 2.5;
double someIPOut = 3.14;
double in1 = 1.5;
double in2 = 2.5;
double out1 = 0.1;
double out2 = 0.2;
};
#endif /* tests_a_compA_h */
......@@ -3,51 +3,95 @@
<@m.mwIdent/>Adapter_${model.getEscapedCompName()}::<@m.mwIdent/>Adapter_${model.getEscapedCompName()}() {
//choose random ids
service_id = 1;
instance_id = 2;
method_id = 3;
event_id = 4;
eventgroup_id = 5;
}
in1_service_id = 11;
in1_instance_id = 12;
in1_method_id = 13;
in1_event_id = 14;
in1_eventgroup_id = 15;
in2_service_id = 21;
in2_instance_id = 22;
in2_method_id = 23;
in2_event_id = 24;
in2_eventgroup_id = 25;
<@m.mwIdent/>Adapter_${model.getEscapedCompName()}::<@m.mwIdent/>Adapter_${model.getEscapedCompName()}(int service_id, int instance_id, int method_id, int event_id, int eventgroup_id) {
this->service_id = service_id;
this->instance_id = instance_id;
this->method_id = method_id;
this->event_id = event_id;
this->eventgroup_id = eventgroup_id;
out1_service_id = 111;
out1_instance_id = 112;
out1_method_id = 113;
out1_event_id = 114;
out1_eventgroup_id = 115;
out2_service_id = 121;
out2_instance_id = 122;
out2_method_id = 123;
out2_event_id = 124;
out2_eventgroup_id = 125;
}
void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::init(${model.getEscapedCompName()} *comp) {
// Initialize component
this->component = comp;
// Intitialize subscriber
_clockSubscriber = vsomeip::runtime::get()->create_application("Subscriber");
_clockSubscriber->init();
_clockSubscriber->request_service(service_id, instance_id);
_clockSubscriber->register_message_handler(service_id, instance_id, method_id, std::bind(&SomeIPAdapter_tests_a_compA::on_message, this, std::placeholders::_1));
// Intitialize subscriber for in1
in1_Subscriber = vsomeip::runtime::get()->create_application("Subscriber");
in1_Subscriber->init();
in1_Subscriber->request_service(in1_service_id, in1_instance_id);
in1_Subscriber->register_message_handler(in1_service_id, in1_instance_id, in1_method_id, std::bind(&SomeIPAdapter_${model.getEscapedCompName()}::on_message_in1, this, std::placeholders::_1));
// Subscribe
std::set<vsomeip::eventgroup_t> in1_event_group;
in1_event_group.insert(in1_eventgroup_id);
in1_Subscriber->request_event(in1_service_id, in1_instance_id, in1_event_id, in1_event_group, true);
in1_Subscriber->subscribe(in1_service_id, in1_instance_id, in1_eventgroup_id);
in1_Subscriber->start();
// Intitialize subscriber for in2
in2_Subscriber = vsomeip::runtime::get()->create_application("Subscriber");
in2_Subscriber->init();
in2_Subscriber->request_service(in2_service_id, in2_instance_id);
in2_Subscriber->register_message_handler(in2_service_id, in2_instance_id, in2_method_id, std::bind(&SomeIPAdapter_${model.getEscapedCompName()}::on_message_in2, this, std::placeholders::_1));
// Subscribe
std::set<vsomeip::eventgroup_t> event_group;
event_group.insert(eventgroup_id);
_clockSubscriber->request_event(service_id, instance_id, event_id, event_group, true);
_clockSubscriber->subscribe(service_id, instance_id, eventgroup_id);
_clockSubscriber->start();
// Intitialize Publisher
_echoPublisher = vsomeip::runtime::get()->create_application("Publisher");
_echoPublisher->init();
_echoPublisher->offer_service(service_id, instance_id);
_echoPublisher->start();
std::set<vsomeip::eventgroup_t> in2_event_group;
in2_event_group.insert(in2_eventgroup_id);
in2_Subscriber->request_event(in2_service_id, in2_instance_id, in2_event_id, in2_event_group, true);
in2_Subscriber->subscribe(in2_service_id, in2_instance_id, in2_eventgroup_id);
in2_Subscriber->start();
// Intitialize Publisher for out1
out1_Publisher = vsomeip::runtime::get()->create_application("Publisher");
out1_Publisher->init();
out1_Publisher->offer_service(out1_service_id, out1_instance_id);
out1_Publisher->start();
// Intitialize Publisher for out2
out2_Publisher = vsomeip::runtime::get()->create_application("Publisher");
out2_Publisher->init();
out2_Publisher->offer_service(out2_service_id, out2_instance_id);
out2_Publisher->start();
}
void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::on_message_in1(const std::shared_ptr<vsomeip::message> &_request) {
//read received message
std::shared_ptr<vsomeip::payload> its_payload = _request->get_payload();
vsomeip::length_t l = its_payload->get_length();
double dataFromMessage = *((double*)its_payload->get_data());
component->in1 = dataFromMessage;
//print data to std out
std::cout << "SERVICE: Received message from ["
<< std::setw(4) << std::setfill('0') << std::hex << _request->get_client() << "/"
<< std::setw(4) << std::setfill('0') << std::hex << _request->get_session() << "]: "
<< dataFromMessage << std::endl;
}
void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::on_message(const std::shared_ptr<vsomeip::message> &_request) {
void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::on_message_in2(const std::shared_ptr<vsomeip::message> &_request) {
//read received message
std::shared_ptr<vsomeip::payload> its_payload = _request->get_payload();
vsomeip::length_t l = its_payload->get_length();
double dataFromMessage = *((double*)its_payload->get_data());
component->someIPIn = dataFromMessage;
component->in2 = dataFromMessage;
//print data to std out
std::cout << "SERVICE: Received message from ["
<< std::setw(4) << std::setfill('0') << std::hex << _request->get_client() << "/"
......@@ -55,10 +99,28 @@ void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::on_message(const std::s
<< dataFromMessage << std::endl;
}
void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::publish_echoPublisher()
void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::publishout1_Publisher()
{
//Read data from component
double d = component->out1;
//Create message
uint8_t *byteArray = (uint8_t*)&d;
vsomeip::byte_t *p;
p = byteArray;
std::shared_ptr< vsomeip::payload > payload = vsomeip::runtime::get()->create_payload(p,8);
//Publish
std::set<vsomeip::eventgroup_t> out1_event_group;
out1_event_group.insert(out1_eventgroup_id);
out1_Publisher->offer_event(out1_service_id, out1_instance_id, out1_event_id, out1_event_group, true);
out1_Publisher->notify(out1_service_id, out1_instance_id, out1_event_id, payload);
}
void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::publishout2_Publisher()
{
//Read data from component
double d = component->someIPOut;
double d = component->out2;
//Create message
uint8_t *byteArray = (uint8_t*)&d;
......@@ -67,13 +129,14 @@ void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::publish_echoPublisher()
std::shared_ptr< vsomeip::payload > payload = vsomeip::runtime::get()->create_payload(p,8);
//Publish
std::set<vsomeip::eventgroup_t> event_group;
event_group.insert(eventgroup_id);
_echoPublisher->offer_event(service_id, instance_id, event_id, event_group, true);
_echoPublisher->notify(service_id, instance_id, event_id, payload);
std::set<vsomeip::eventgroup_t> out2_event_group;
out2_event_group.insert(out2_eventgroup_id);
out2_Publisher->offer_event(out2_service_id, out2_instance_id, out2_event_id, out2_event_group, true);
out2_Publisher->notify(out2_service_id, out2_instance_id, out2_event_id, payload);
}
void <@m.mwIdent/>Adapter_${model.getEscapedCompName()}::tick()
{
publish_echoPublisher();
publishout1_Publisher();
publishout2_Publisher();
}
......@@ -18,27 +18,52 @@ public:
<@m.mwIdent/>Adapter_${model.getEscapedCompName()}();
<@m.mwIdent/>Adapter_${model.getEscapedCompName()}(int service_id, int instance_id, int method_id, int event_id, int eventgroup_id);
void init(${model.getEscapedCompName()} *comp);
void init(${model.getEscapedCompName()}* comp);
void on_message_in1(const std::shared_ptr<vsomeip::message> &_request);
void publish_echoPublisher();
void on_message_in2(const std::shared_ptr<vsomeip::message> &_request);
void publishout1_Publisher();
void publishout2_Publisher();
void tick();
void on_message(const std::shared_ptr<vsomeip::message> &_response);
private:
${model.getEscapedCompName()}* component = nullptr;
std::shared_ptr<vsomeip::application> _clockSubscriber;
std::shared_ptr<vsomeip::application> in1_Subscriber;
std::shared_ptr<vsomeip::application> in2_Subscriber;
std::shared_ptr<vsomeip::application> out1_Publisher;
std::shared_ptr<vsomeip::application> out2_Publisher;
int in1_service_id;
int in1_instance_id;
int in1_method_id;
int in1_event_id;