Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gradle/publish.gradle2
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.core.common/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.core.config/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.core.fsm/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.core.room/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.etunit.converter/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.generator.c/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.generator.config/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.generator.fsm/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.generator.gnuplot/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.generator.java/build.gradle1
-rw-r--r--plugins/org.eclipse.etrice.generator/build.gradle1
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl.c119
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl.h58
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl_Utils.h19
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor.c220
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor.h65
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor_Utils.h42
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h92
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h1
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etSocket.c167
28 files changed, 262 insertions, 541 deletions
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
index c70e47ab0..7f2dc790c 100644
--- a/gradle/publish.gradle
+++ b/gradle/publish.gradle
@@ -1,3 +1,5 @@
+apply plugin: 'maven-publish'
+
publishing {
publications {
etrice(MavenPublication) {
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle b/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle
index a079e7bc6..274dc2b9c 100644
--- a/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.core.common/build.gradle b/plugins/org.eclipse.etrice.core.common/build.gradle
index bdc48372d..4901a7213 100644
--- a/plugins/org.eclipse.etrice.core.common/build.gradle
+++ b/plugins/org.eclipse.etrice.core.common/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.core.config/build.gradle b/plugins/org.eclipse.etrice.core.config/build.gradle
index c829113a7..52d8bcc13 100644
--- a/plugins/org.eclipse.etrice.core.config/build.gradle
+++ b/plugins/org.eclipse.etrice.core.config/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.core.etmap/build.gradle b/plugins/org.eclipse.etrice.core.etmap/build.gradle
index 161885cc5..2570e0de4 100644
--- a/plugins/org.eclipse.etrice.core.etmap/build.gradle
+++ b/plugins/org.eclipse.etrice.core.etmap/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.core.etphys/build.gradle b/plugins/org.eclipse.etrice.core.etphys/build.gradle
index 38eec7fdb..a40730e53 100644
--- a/plugins/org.eclipse.etrice.core.etphys/build.gradle
+++ b/plugins/org.eclipse.etrice.core.etphys/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.core.fsm/build.gradle b/plugins/org.eclipse.etrice.core.fsm/build.gradle
index 5d7da7362..709db0841 100644
--- a/plugins/org.eclipse.etrice.core.fsm/build.gradle
+++ b/plugins/org.eclipse.etrice.core.fsm/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle b/plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle
index caee6c8ca..8b106a6c8 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.core.genmodel/build.gradle b/plugins/org.eclipse.etrice.core.genmodel/build.gradle
index ec1c6a0f7..44d8a29a0 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/build.gradle
+++ b/plugins/org.eclipse.etrice.core.genmodel/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.core.room/build.gradle b/plugins/org.eclipse.etrice.core.room/build.gradle
index 4e8ed82cd..27b540e1d 100644
--- a/plugins/org.eclipse.etrice.core.room/build.gradle
+++ b/plugins/org.eclipse.etrice.core.room/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.etunit.converter/build.gradle b/plugins/org.eclipse.etrice.etunit.converter/build.gradle
index d0941c22a..ff480f35f 100644
--- a/plugins/org.eclipse.etrice.etunit.converter/build.gradle
+++ b/plugins/org.eclipse.etrice.etunit.converter/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'application'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.generator.c/build.gradle b/plugins/org.eclipse.etrice.generator.c/build.gradle
index 420bb37d6..403b5d312 100644
--- a/plugins/org.eclipse.etrice.generator.c/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.c/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'application'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.generator.config/build.gradle b/plugins/org.eclipse.etrice.generator.config/build.gradle
index 53ca221b6..c466fd882 100644
--- a/plugins/org.eclipse.etrice.generator.config/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.config/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.generator.cpp/build.gradle b/plugins/org.eclipse.etrice.generator.cpp/build.gradle
index ae83d0652..97b4f81b9 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.cpp/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'application'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.generator.doc/build.gradle b/plugins/org.eclipse.etrice.generator.doc/build.gradle
index e1a6ff4f5..22e1f4c90 100644
--- a/plugins/org.eclipse.etrice.generator.doc/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.doc/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.generator.fsm/build.gradle b/plugins/org.eclipse.etrice.generator.fsm/build.gradle
index a1de1737f..6846e2b40 100644
--- a/plugins/org.eclipse.etrice.generator.fsm/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.fsm/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/build.gradle b/plugins/org.eclipse.etrice.generator.gnuplot/build.gradle
index 5271ea243..8191b1ce1 100644
--- a/plugins/org.eclipse.etrice.generator.gnuplot/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.gnuplot/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.generator.java/build.gradle b/plugins/org.eclipse.etrice.generator.java/build.gradle
index 04ad2cf81..b087602e1 100644
--- a/plugins/org.eclipse.etrice.generator.java/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.java/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'application'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/plugins/org.eclipse.etrice.generator/build.gradle b/plugins/org.eclipse.etrice.generator/build.gradle
index 23dd009e2..5fd317151 100644
--- a/plugins/org.eclipse.etrice.generator/build.gradle
+++ b/plugins/org.eclipse.etrice.generator/build.gradle
@@ -1,6 +1,5 @@
plugins {
id 'java'
- id 'maven-publish'
}
apply from: "$rootDir/gradle/publish.gradle"
diff --git a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl.c b/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl.c
deleted file mode 100644
index 7d5c5db58..000000000
--- a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * @author generated by eTrice
- *
- * Source File of ProtocolClass PTestControl
- *
- */
-
-#include "PTestControl.h"
-#include "debugging/etMSCLogger.h"
-#include "PTestControl_Utils.h"
-
-
-/*--------------------- port methods */
-
-void PTestControlPort_done(const PTestControlPort* self, bool data__et) {
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlPort", "done")
- etPort_sendMessage(self, PTestControl_OUT_done, sizeof(bool), &data__et);
- ET_MSC_LOGGER_ASYNC_OUT(self->myInstName, "done", self->peerInstName)
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void PTestControlReplPort_done_broadcast(const PTestControlReplPort* self, bool data__et) {
- int i;
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlReplPort", "done")
- for (i=0; i<((etReplPort*)self)->size; ++i) {
- etPort_sendMessage((&((etReplPort*)self)->ports[i].port), PTestControl_OUT_done, sizeof(bool), &data__et);
- ET_MSC_LOGGER_ASYNC_OUT(((etReplPort*)self)->ports[i].port.myInstName, "done", ((etReplPort*)self)->ports[i].port.peerInstName)
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void PTestControlReplPort_done(const PTestControlReplPort* self, int idx__et, bool data__et) {
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlReplPort", "done")
- if (0<=idx__et && idx__et<((etReplPort*)self)->size) {
- etPort_sendMessage((&((etReplPort*)self)->ports[idx__et].port), PTestControl_OUT_done, sizeof(bool), &data__et);
- ET_MSC_LOGGER_ASYNC_OUT(((etReplPort*)self)->ports[idx__et].port.myInstName, "done", ((etReplPort*)self)->ports[idx__et].port.peerInstName)
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-etInt32 PTestControlReplPort_getReplication(const PTestControlReplPort* self) {
- return ((etReplPort*)self)->size;
-}
-
-
-
-void PTestControlConjPort_start(const PTestControlConjPort* self) {
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlConjPort", "start")
- etPort_sendMessage(self, PTestControl_IN_start, 0, NULL);
- ET_MSC_LOGGER_ASYNC_OUT(self->myInstName, "start", self->peerInstName)
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void PTestControlConjReplPort_start_broadcast(const PTestControlConjReplPort* self) {
- int i;
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlConjReplPort", "start")
- for (i=0; i<((etReplPort*)self)->size; ++i) {
- etPort_sendMessage((&((etReplPort*)self)->ports[i].port), PTestControl_IN_start, 0, NULL);
- ET_MSC_LOGGER_ASYNC_OUT(((etReplPort*)self)->ports[i].port.myInstName, "start", ((etReplPort*)self)->ports[i].port.peerInstName)
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void PTestControlConjReplPort_start(const PTestControlConjReplPort* self, int idx__et) {
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlConjReplPort", "start")
- if (0<=idx__et && idx__et<((etReplPort*)self)->size) {
- etPort_sendMessage((&((etReplPort*)self)->ports[idx__et].port), PTestControl_IN_start, 0, NULL);
- ET_MSC_LOGGER_ASYNC_OUT(((etReplPort*)self)->ports[idx__et].port.myInstName, "start", ((etReplPort*)self)->ports[idx__et].port.peerInstName)
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-void PTestControlConjPort_abort(const PTestControlConjPort* self) {
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlConjPort", "abort")
- etPort_sendMessage(self, PTestControl_IN_abort, 0, NULL);
- ET_MSC_LOGGER_ASYNC_OUT(self->myInstName, "abort", self->peerInstName)
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void PTestControlConjReplPort_abort_broadcast(const PTestControlConjReplPort* self) {
- int i;
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlConjReplPort", "abort")
- for (i=0; i<((etReplPort*)self)->size; ++i) {
- etPort_sendMessage((&((etReplPort*)self)->ports[i].port), PTestControl_IN_abort, 0, NULL);
- ET_MSC_LOGGER_ASYNC_OUT(((etReplPort*)self)->ports[i].port.myInstName, "abort", ((etReplPort*)self)->ports[i].port.peerInstName)
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void PTestControlConjReplPort_abort(const PTestControlConjReplPort* self, int idx__et) {
- ET_MSC_LOGGER_SYNC_ENTRY("PTestControlConjReplPort", "abort")
- if (0<=idx__et && idx__et<((etReplPort*)self)->size) {
- etPort_sendMessage((&((etReplPort*)self)->ports[idx__et].port), PTestControl_IN_abort, 0, NULL);
- ET_MSC_LOGGER_ASYNC_OUT(((etReplPort*)self)->ports[idx__et].port.myInstName, "abort", ((etReplPort*)self)->ports[idx__et].port.peerInstName)
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-etInt32 PTestControlConjReplPort_getReplication(const PTestControlConjReplPort* self) {
- return ((etReplPort*)self)->size;
-}
-
-
-
-/*--------------------- debug helpers */
-
-/* message names as strings for debugging (generate MSC) */
-static const char* const PTestControl_messageStrings[] = {"MIN", "done","start", "abort", "MAX"};
-
-const char* PTestControl_getMessageString(int msg_id) {
- if (msg_id<PTestControl_MSG_MIN || msg_id>PTestControl_MSG_MAX+1){
- /* id out of range */
- return "Message ID out of range";
- }
- else{
- return PTestControl_messageStrings[msg_id];
- }
-}
diff --git a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl.h b/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl.h
deleted file mode 100644
index 380b03803..000000000
--- a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @author generated by eTrice
- *
- * Header File of ProtocolClass PTestControl
- *
- */
-
-#ifndef _ROOM_BASIC_TEST_PTESTCONTROL_H_
-#define _ROOM_BASIC_TEST_PTESTCONTROL_H_
-
-#include "etDatatypes.h"
-#include "modelbase/etPort.h"
-
-
-
-
-/* message IDs */
-enum PTestControl_msg_ids {
- PTestControl_MSG_MIN = 0,
- PTestControl_OUT_done = 1,
- PTestControl_IN_start = 2,
- PTestControl_IN_abort = 3,
- PTestControl_MSG_MAX = 4
-};
-
-/*--------------------- port structs and methods */
-typedef etPort PTestControlPort;
-typedef etReplPort PTestControlReplPort;
-
-
-void PTestControlPort_done(const PTestControlPort* self, bool data);
-void PTestControlReplPort_done_broadcast(const PTestControlReplPort* self, bool data);
-void PTestControlReplPort_done(const PTestControlReplPort* self, int idx, bool data);
-
-
-etInt32 PTestControlReplPort_getReplication(const PTestControlReplPort* self);
-typedef etPort PTestControlConjPort;
-typedef etReplPort PTestControlConjReplPort;
-
-
-void PTestControlConjPort_start(const PTestControlConjPort* self);
-void PTestControlConjReplPort_start_broadcast(const PTestControlConjReplPort* self);
-void PTestControlConjReplPort_start(const PTestControlConjReplPort* self, int idx);
-void PTestControlConjPort_abort(const PTestControlConjPort* self);
-void PTestControlConjReplPort_abort_broadcast(const PTestControlConjReplPort* self);
-void PTestControlConjReplPort_abort(const PTestControlConjReplPort* self, int idx);
-
-
-etInt32 PTestControlConjReplPort_getReplication(const PTestControlConjReplPort* self);
-
-/*--------------------- debug helpers */
-
-/* get message string for message id */
-const char* PTestControl_getMessageString(int msg_id);
-
-
-#endif /* _ROOM_BASIC_TEST_PTESTCONTROL_H_ */
-
diff --git a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl_Utils.h b/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl_Utils.h
deleted file mode 100644
index 1528e06f5..000000000
--- a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/PTestControl_Utils.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * @author generated by eTrice
- *
- * Utils File of ProtocolClass PTestControl
- *
- */
-
-#ifndef _ROOM_BASIC_TEST_PTESTCONTROL_UTILS_H_
-#define _ROOM_BASIC_TEST_PTESTCONTROL_UTILS_H_
-
-#include "room/basic/test/PTestControl.h"
-
-/*
- * access macros for operations and attributes
-*/
-
-
-#endif /* _ROOM_BASIC_TEST_PTESTCONTROL_UTILS_H_ */
-
diff --git a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor.c b/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor.c
deleted file mode 100644
index 4f5bf3747..000000000
--- a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * @author generated by eTrice
- *
- * Source File of ActorClass SequentialTestExecutor
- *
- */
-
-#include "SequentialTestExecutor.h"
-
-#include "modelbase/etActor.h"
-#include "debugging/etLogger.h"
-#include "debugging/etMSCLogger.h"
-#include "etUnit/etUnit.h"
-#include "base/etMemory.h"
-
-#include "room/basic/test/PTestControl.h"
-
-#include "SequentialTestExecutor_Utils.h"
-
-/*--------------------- begin user code ---------------------*/
-#include "etUnit/etUnit.h"
-/*--------------------- end user code ---------------------*/
-
-/* interface item IDs */
-enum interface_items {
- IFITEM_control = 1
-};
-
-/* state IDs */
-enum state_ids {
- NO_STATE = 0,
- STATE_TOP = 1,
- STATE_execute = 2,
- STATE_MAX = 3
-};
-
-/* transition chains */
-enum ChainIDs {
- CHAIN_TRANS_INITIAL_TO__execute = 1,
- CHAIN_TRANS_tr0_FROM_execute_TO_execute_BY_donecontrol_tr0 = 2
-};
-
-/* triggers */
-enum triggers {
- POLLING = 0,
- TRIG_control__done = IFITEM_control + EVT_SHIFT*PTestControl_OUT_done
-};
-
-/* state names */
-static char* stateStrings[] = {"<no state>","<top>","execute"
-};
-
-static void setState(SequentialTestExecutor* self, etInt16 new_state) {
- self->state = new_state;
- ET_MSC_LOGGER_CHANGE_STATE(self->constData->instName, stateStrings[new_state])
-}
-
-static etInt16 getState(SequentialTestExecutor* self) {
- return self->state;
-}
-
-/* Entry and Exit Codes */
-static void entry_execute(SequentialTestExecutor* self) {
- if(next < self->constData->control.size){
- control_start(next++);
- } else {
- etUnit_testFinished(0);
- }
-}
-
-/* Action Codes */
-
-/* State Switch Methods */
-/**
- * calls exit codes while exiting from the current state to one of its
- * parent states while remembering the history
- * @param current__et - the current state
- * @param to - the final parent state
- */
-static void exitTo(SequentialTestExecutor* self, etInt16 current__et, etInt16 to) {
- while (current__et!=to) {
- switch (current__et) {
- case STATE_execute:
- self->history[STATE_TOP] = STATE_execute;
- current__et = STATE_TOP;
- break;
- default:
- /* should not occur */
- break;
- }
- }
-}
-
-/**
- * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data
- * matching the trigger of this chain. The ID of the final state is returned
- * @param chain__et - the chain ID
- * @param generic_data__et - the generic data pointer
- * @return the +/- ID of the final state either with a positive sign, that indicates to execute the state's entry code, or a negative sign vice versa
- */
-static etInt16 executeTransitionChain(SequentialTestExecutor* self, int chain__et, const InterfaceItemBase* ifitem, void* generic_data__et) {
- switch (chain__et) {
- case CHAIN_TRANS_INITIAL_TO__execute:
- {
- return STATE_execute;
- }
- case CHAIN_TRANS_tr0_FROM_execute_TO_execute_BY_donecontrol_tr0:
- {
- bool success = *((bool*) generic_data__et);
- return STATE_execute;
- }
- default:
- /* should not occur */
- break;
- }
- return NO_STATE;
-}
-
-/**
- * calls entry codes while entering a state's history. The ID of the final leaf state is returned
- * @param state__et - the state which is entered
- * @return - the ID of the final leaf state
- */
-static etInt16 enterHistory(SequentialTestExecutor* self, etInt16 state__et) {
- etBool skip_entry__et = ET_FALSE;
- if (state__et >= STATE_MAX) {
- state__et = (etInt16) (state__et - STATE_MAX);
- skip_entry__et = ET_TRUE;
- }
- while (ET_TRUE) {
- switch (state__et) {
- case STATE_execute:
- if (!(skip_entry__et)) entry_execute(self);
- /* in leaf state: return state id */
- return STATE_execute;
- case STATE_TOP:
- state__et = self->history[STATE_TOP];
- break;
- default:
- /* should not occur */
- break;
- }
- skip_entry__et = ET_FALSE;
- }
- /* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */
-}
-
-static void SequentialTestExecutor_executeInitTransition(SequentialTestExecutor* self) {
- int chain__et = CHAIN_TRANS_INITIAL_TO__execute;
- etInt16 next__et = executeTransitionChain(self, chain__et, NULL, NULL);
- next__et = enterHistory(self, next__et);
- setState(self, next__et);
-}
-
-/* receiveEvent contains the main implementation of the FSM */
-static void SequentialTestExecutor_receiveEventInternal(SequentialTestExecutor* self, InterfaceItemBase* ifitem, int localId, int evt, void* generic_data__et) {
- int trigger__et = localId + EVT_SHIFT*evt;
- int chain__et = NOT_CAUGHT;
- etInt16 catching_state__et = NO_STATE;
- ((void)trigger__et); /* avoids unused warning */
-
- if (!handleSystemEvent(ifitem, evt, generic_data__et)) {
- switch (getState(self)) {
- case STATE_execute:
- switch(trigger__et) {
- case TRIG_control__done:
- {
- chain__et = CHAIN_TRANS_tr0_FROM_execute_TO_execute_BY_donecontrol_tr0;
- catching_state__et = STATE_TOP;
- }
- break;
- default:
- /* should not occur */
- break;
- }
- break;
- default:
- /* should not occur */
- break;
- }
- }
- if (chain__et != NOT_CAUGHT) {
- exitTo(self, getState(self), catching_state__et);
- {
- etInt16 next__et = executeTransitionChain(self, chain__et, ifitem, generic_data__et);
- next__et = enterHistory(self, next__et);
- setState(self, next__et);
- }
- }
-}
-static void SequentialTestExecutor_receiveEvent(SequentialTestExecutor* self, InterfaceItemBase* ifitem, int evt, void* generic_data__et) {
- int localId = (ifitem==NULL)? 0 : ifitem->localId;
- SequentialTestExecutor_receiveEventInternal(self, ifitem, localId, evt, generic_data__et);
-}
-
-void SequentialTestExecutor_init(SequentialTestExecutor* self){
- ET_MSC_LOGGER_SYNC_ENTRY("SequentialTestExecutor", "init")
- self->state = STATE_TOP;
- {
- int i;
- for (i=0; i<SEQUENTIALTESTEXECUTOR_HISTORY_SIZE; ++i)
- self->history[i] = NO_STATE;
- }
- SequentialTestExecutor_executeInitTransition(self);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-void SequentialTestExecutor_receiveMessage(void* self, const void* ifitem, const etMessage* msg){
- ET_MSC_LOGGER_SYNC_ENTRY("SequentialTestExecutor", "_receiveMessage")
- SequentialTestExecutor_receiveEvent(self, (etPort*)ifitem, msg->evtID, (void*)(((char*)msg)+MEM_CEIL(sizeof(etMessage))));
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-/*--------------------- user constructor/destructor ---------------------*/
-
-/*--------------------- operations ---------------------*/
-
diff --git a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor.h b/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor.h
deleted file mode 100644
index 597d0a43e..000000000
--- a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @author generated by eTrice
- *
- * Header File of ActorClass SequentialTestExecutor
- *
- */
-
-#ifndef _ROOM_BASIC_TEST_SEQUENTIALTESTEXECUTOR_H_
-#define _ROOM_BASIC_TEST_SEQUENTIALTESTEXECUTOR_H_
-
-#include "etDatatypes.h"
-#include "messaging/etMessage.h"
-
-#include "room/basic/test/PTestControl.h"
-
-
-typedef struct SequentialTestExecutor SequentialTestExecutor;
-
-/* const part of ActorClass (ROM) */
-typedef struct SequentialTestExecutor_const {
- const char* instName;
-
- /* simple ports */
-
- /* data receive ports */
-
- /* saps */
-
- /* replicated ports */
- const etReplPort control;
-
- /* services */
-} SequentialTestExecutor_const;
-
-
-/* constant for state machine data */
-#define SEQUENTIALTESTEXECUTOR_HISTORY_SIZE 2
-
-/* variable part of ActorClass (RAM) */
-struct SequentialTestExecutor {
- const SequentialTestExecutor_const* const constData;
-
- /* data send ports */
-
- /*--------------------- attributes ---------------------*/
- int16 next;
-
-
- /* state machine variables */
- etInt16 state;
- etInt16 history[SEQUENTIALTESTEXECUTOR_HISTORY_SIZE];
-};
-
-void SequentialTestExecutor_init(SequentialTestExecutor* self);
-
-void SequentialTestExecutor_receiveMessage(void* self, const void* ifitem, const etMessage* msg);
-
-
-/*--------------------- user constructor/destructor ---------------------*/
-
-/*--------------------- operations ---------------------*/
-
-
-#endif /* _ROOM_BASIC_TEST_SEQUENTIALTESTEXECUTOR_H_ */
-
diff --git a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor_Utils.h b/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor_Utils.h
deleted file mode 100644
index 65c142abb..000000000
--- a/runtime/org.eclipse.etrice.modellib.c/src-gen/room/basic/test/SequentialTestExecutor_Utils.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @author generated by eTrice
- *
- * Utils File of ActorClass SequentialTestExecutor
- *
- */
-
-#ifndef _ROOM_BASIC_TEST_SEQUENTIALTESTEXECUTOR_UTILS_H_
-#define _ROOM_BASIC_TEST_SEQUENTIALTESTEXECUTOR_UTILS_H_
-
-#include "room/basic/test/SequentialTestExecutor.h"
-
-/*
- * access macros for ports, operations and attributes
-*/
-
-/* simple event ports */
-
-/* data receive ports */
-
-/* data send ports */
-
-/* saps */
-
-/* replicated event ports */
-#define ifitem_index (((etReplSubPort*)ifitem)->index)
-#define control_start_broadcast() PTestControlConjReplPort_start_broadcast(&self->constData->control)
-#define control_start(idx) PTestControlConjReplPort_start(&self->constData->control, idx)
-#define control_abort_broadcast() PTestControlConjReplPort_abort_broadcast(&self->constData->control)
-#define control_abort(idx) PTestControlConjReplPort_abort(&self->constData->control, idx)
-
-/* services */
-
-/* operations */
-
-/* attributes */
-#define next (self->next)
-
-/* port operations */
-
-#endif /* _ROOM_BASIC_TEST_SEQUENTIALTESTEXECUTOR_UTILS_H_ */
-
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h
new file mode 100644
index 000000000..ca1e5e397
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h
@@ -0,0 +1,92 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ETSOCKET_H_
+#define _ETSOCKET_H_
+
+#include "etDatatypes.h"
+
+/*
+ * Data structure representing an etSocket
+ * etSocket is used to establish a tcp connection
+ * Must be initialized with etSocket_construct and cleaned up with etSocket_destruct
+ */
+typedef struct {
+ etOSSocketData socket;
+}
+etSocket;
+
+/*
+ * Data structure representing an etServerSocket
+ * etServerSocket can open a port that clients can connect to via tcp
+ * Must be initialized with etServerSocket_construct and cleaned up with etServerSocket_destruct
+ */
+typedef struct {
+ etOSSocketData serverSocket;
+}
+etServerSocket;
+
+/*
+ * Constructs a new etSocket and connects to the specified host
+ * @param self: pointer to etSocket
+ * @param address: address of the host to connect to
+ * @param port: port of the host
+ * @return: 0 on success
+ */
+int etSocket_construct(etSocket* self, const char* address, short port);
+
+/*
+ * Destructs the etSocket
+ * @param self: pointer to etSocket
+ * @return: 0 on success
+ */
+int etSocket_destruct(etSocket* self);
+
+/*
+ * Receives data from an etSocket
+ * @param self: pointer to etSocket
+ * @param buffer: buffer for received data
+ * @param length: max length of received data
+ * @return: length of received data, -1 when failed
+ */
+int etSocket_recv(etSocket* self, uint8* buffer, size_t length);
+
+/*
+ * Sends data over the etSocket
+ * @param self: pointer to etSocket
+ * @param buffer: buffer that holds the data to be sent
+ * @param length: length of the data
+ * @return: length of sent data, -1 when failed
+ */
+int etSocket_send(etSocket* self, uint8* buffer, size_t length);
+
+
+/*
+ * Constructs a new etServerSocket and starts to listen on the specified port
+ * @param self: pointer to etServerSocket
+ * @param port: port number
+ * @return: 0 on success
+ */
+int etServerSocket_construct(etServerSocket* self, short port);
+
+/*
+ * Destructs an etServerSocket
+ * @param self: pointer to etServerSocket
+ * @return: 0 on success
+ */
+int etServerSocket_destruct(etServerSocket* self);
+
+/*
+ * Accepts a new connection
+ * @param self: pointer to etServerSocket
+ * @param socket: pointer to the etSocket for the new connection
+ */
+int etServerSocket_accept(etServerSocket* self, etSocket* socket);
+
+
+#endif /* _ETSOCKET_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h
index 057d23a06..9910144ac 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h
@@ -50,6 +50,7 @@ typedef DWORD etOSThreadId;
typedef HANDLE etOSSemaData;
typedef HANDLE etOSTimerData;
typedef DWORD etOSTimerId;
+typedef SOCKET etOSSocketData;
/*-----------------------------------------------------------*/
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etSocket.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etSocket.c
new file mode 100644
index 000000000..b6492af2f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etSocket.c
@@ -0,0 +1,167 @@
+#include "osal/etSocket.h"
+
+#include <winsock2.h>
+
+int initializeWinsock(void);
+int cleanupWinsock(void);
+void printLastError(void);
+
+int etSocket_construct(etSocket* self, const char* address, short port) {
+ int result = initializeWinsock();
+ if (result != 0) {
+ return result;
+ }
+
+ self->socket = socket(AF_INET, SOCK_STREAM, 0);
+ if(self->socket == INVALID_SOCKET)
+ {
+ printf("Error: could not create socket\n");
+ return WSAGetLastError();
+ }
+ // printf("Socket created\n");
+
+ // TODO JB: Improve address resolution
+ SOCKADDR_IN addr;
+ memset(&addr, 0, sizeof(SOCKADDR_IN));
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(port);
+ addr.sin_addr.s_addr = inet_addr(address);
+
+ if(connect(self->socket, (SOCKADDR*) &addr, sizeof(SOCKADDR)) == SOCKET_ERROR)
+ {
+ printf("Error: socket could not connect\n");
+ printLastError();
+ return WSAGetLastError();
+ }
+ printf("Socket connected\n");
+
+ return 0;
+}
+
+int etSocket_destruct(etSocket* self) {
+ if(closesocket(self->socket) == SOCKET_ERROR) {
+ printf("Error: could not close socket\n");
+ printLastError();
+ return WSAGetLastError();
+ }
+
+ return cleanupWinsock();
+}
+
+int etSocket_recv(etSocket* self, uint8* buffer, size_t length) {
+ int result = recv(self->socket, buffer, length, 0);
+ if(result < 0) {
+ printf("Error: socket could not receive data\n");
+ printLastError();
+ }
+ return result;
+}
+
+int etSocket_send(etSocket* self, uint8* buffer, size_t length) {
+ int result = send(self->socket, buffer, length, 0);
+ if(result < 0) {
+ printf("Error: socket could not send data\n");
+ printLastError();
+ }
+ return result;
+}
+
+
+int etServerSocket_construct(etServerSocket* self, short port) {
+ int result = initializeWinsock();
+ if (result != 0) {
+ return result;
+ }
+
+ self->serverSocket = socket(AF_INET, SOCK_STREAM, 0);
+ if(self->serverSocket == INVALID_SOCKET)
+ {
+ printf("Error: could not create server socket\n");
+ printLastError();
+ return WSAGetLastError();
+ }
+ // printf("Server socket created\n");
+
+ SOCKADDR_IN addr;
+ memset(&addr, 0, sizeof(SOCKADDR_IN));
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(port);
+ addr.sin_addr.s_addr = ADDR_ANY;
+ if(bind(self->serverSocket, (SOCKADDR*) &addr, sizeof(SOCKADDR_IN)) == SOCKET_ERROR)
+ {
+ printf("Error: Could not bind server socket\n");
+ printLastError();
+ return WSAGetLastError();
+ }
+ // printf("Server socket bound\n");
+
+ if(listen(self->serverSocket, 10) == SOCKET_ERROR)
+ {
+ printf("Error: server socket could not listen\n");
+ printLastError();
+ return WSAGetLastError();
+ }
+ // printf("Server socket listening\n");
+
+ return 0;
+}
+
+int etServerSocket_destruct(etServerSocket* self) {
+ if(closesocket(self->serverSocket) == SOCKET_ERROR) {
+ printf("Error: could not close server socket\n");
+ printLastError();
+ return WSAGetLastError();
+ }
+
+ return cleanupWinsock();
+}
+
+int etServerSocket_accept(etServerSocket* self, etSocket* socket) {
+ int result = initializeWinsock(); // Initialize Winsock for new accepted socket
+ if (result != 0) {
+ return result;
+ }
+
+ socket->socket = accept(self->serverSocket, NULL, NULL);
+ if(socket->socket == INVALID_SOCKET)
+ {
+ printf("Error: server socket accept failed\n");
+ printLastError();
+ return WSAGetLastError();
+ }
+ printf("Server socket accepted new connection\n");
+
+ return 0;
+}
+
+int initializeWinsock() {
+ WSADATA wsaData;
+ int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
+ if (result != 0) {
+ printf("Error: WSAStartup failed\n");
+ printLastError();
+ return result;
+ }
+ // printf("Initialized Winsock\n");
+ return result;
+}
+
+int cleanupWinsock() {
+ if(WSACleanup() == SOCKET_ERROR) {
+ printf("Error: clean up winsock failed\n");
+ printLastError();
+ return WSAGetLastError();
+ }
+ // printf("Cleaned up winsock\n");
+ return 0;
+}
+
+void printLastError() {
+ wchar_t *s = NULL;
+ FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, WSAGetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPWSTR)&s, 0, NULL);
+ printf("%S\n", s);
+ LocalFree(s);
+}

Back to the top