Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit a95a42c3 authored by Georg Vinogradov's avatar Georg Vinogradov
Browse files

Minor adjustment

parent 14a35f4b
Pipeline #159887 passed with stages
in 1 minute and 19 seconds
......@@ -25,9 +25,6 @@ public:
private:
const string SERVER_ADDRESS = "tcp://localhost:1883";
const string PUB_ID = "publisher_cpp";
const string SUB_ID = "subscriber_cpp";
const string TOPIC = "/clock";
${model.getEscapedCompName()}* component = nullptr;
......
......@@ -33,6 +33,7 @@ public class AdapterGenerationTest extends AbstractSymtabTest {
// Connect component's ports to topics
componentInstanceSymbol.getPortInstance("portA").orElse(null).setMiddlewareSymbol(new MqttConnectionSymbol("/clock"));
componentInstanceSymbol.getPortInstance("portC").orElse(null).setMiddlewareSymbol(new MqttConnectionSymbol("/clock"));
componentInstanceSymbol.getPortInstance("portD").orElse(null).setMiddlewareSymbol(new MqttConnectionSymbol("/clock2"));
List<File> files = generatorMqtt.generateMqttAdapter(componentInstanceSymbol);
......
......@@ -21,6 +21,7 @@ void MqttAdapter_tests_a_compA::init(tests_a_compA *comp)
_callback_portA = new Callback(*_sub_portA, comp);
_pub_portC = new client(SERVER_ADDRESS, portC);
_pub_portD = new client(SERVER_ADDRESS, portD);
// Connect subscribers, publishers and subscribe to the topics
try {
......@@ -28,6 +29,7 @@ void MqttAdapter_tests_a_compA::init(tests_a_compA *comp)
_sub_portA->connect(connOpts);
_sub_portA->subscribe("/clock", 1)
_pub_portC->connect(connOpts);
_pub_portD->connect(connOpts);
} catch (const mqtt::exception& exc) {
cerr << exc.what() << endl;
......@@ -48,9 +50,23 @@ void MqttAdapter_tests_a_compA::publish_echo_portC()
cerr << exc.to_string() << endl;
}
}
void MqttAdapter_tests_a_compA::publish_echo_portD()
{
string value = to_string(component->mqttOut);
auto pubmsg = make_message("/clock2", value);
try {
_pub_portD->publish(pubmsg);
}
catch (const exception& exc) {
cerr << exc.to_string() << endl;
}
}
void MqttAdapter_tests_a_compA::tick()
{
publish_echo_portC();
publish_echo_portD();
}
......@@ -17,15 +17,13 @@ public:
void init(tests_a_compA* comp);
void publish_echo_portC();
void publish_echo_portD();
void tick();
private:
const string SERVER_ADDRESS = "tcp://localhost:1883";
const string PUB_ID = "publisher_cpp";
const string SUB_ID = "subscriber_cpp";
const string TOPIC = "/clock";
tests_a_compA* component = nullptr;
......@@ -34,4 +32,5 @@ private:
client* _sub_portA = nullptr;
// Publishers
client* _pub_portC = nullptr;
client* _pub_portD = nullptr;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment