diff options
author | Thomas Schuetz | 2013-07-12 08:40:15 +0000 |
---|---|---|
committer | Thomas Schuetz | 2013-07-12 08:40:15 +0000 |
commit | 12cda553738ca88662624b6f47066b5564549648 (patch) | |
tree | bfa65b6c38aa566a5f1cc98395da6546a6c6e282 /examples/org.eclipse.etrice.generator.c.reference/src-gen-ts | |
parent | 3447749b1a453735ac54fc09ea7680acdbb19b69 (diff) | |
parent | d65e1d1bdd43feadb43261b85aac2d8aef5e089c (diff) | |
download | org.eclipse.etrice-12cda553738ca88662624b6f47066b5564549648.tar.gz org.eclipse.etrice-12cda553738ca88662624b6f47066b5564549648.tar.xz org.eclipse.etrice-12cda553738ca88662624b6f47066b5564549648.zip |
Merge remote-tracking branch 'origin/master'
Conflicts:
plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip
plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip
Change-Id: I98e2df3ab57d6e7e8f27e5b0aee7eaa189bfbc33
Diffstat (limited to 'examples/org.eclipse.etrice.generator.c.reference/src-gen-ts')
16 files changed, 1164 insertions, 1164 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/CommunicationProtocol.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/CommunicationProtocol.c index 63831f3f3..79947aa6d 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/CommunicationProtocol.c +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/CommunicationProtocol.c @@ -1,89 +1,89 @@ -/**
- * @author generated by eTrice
- *
- * Source File of ProtocolClass CommunicationProtocol
- *
- */
-
-#include "CommunicationProtocol.h"
-#include "debugging/etMSCLogger.h"
-
-
-/*--------------------- port methods */
-
-void CommunicationProtocolPort_receivedData(const CommunicationProtocolPort* self) {
- ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolPort", "receivedData")
- etPort_sendMessage(self, CommunicationProtocol_OUT_receivedData, 0, NULL);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void CommunicationProtocolReplPort_receivedData_broadcast(const CommunicationProtocolReplPort* self) {
- int i;
- ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolReplPort", "receivedData")
- for (i=0; i<((etReplPort*)self)->size; ++i) {
- etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[i]), CommunicationProtocol_OUT_receivedData, 0, NULL);
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void CommunicationProtocolReplPort_receivedData(const CommunicationProtocolReplPort* self, int idx) {
- ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolReplPort", "receivedData")
- if (0<=idx && idx<((etReplPort*)self)->size) {
- etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[idx]), CommunicationProtocol_OUT_receivedData, 0, NULL);
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-// getReplication
-etInt32 CommunicationProtocolReplPort_getReplication(const CommunicationProtocolReplPort* self) {
- return ((etReplPort*)self)->size;
-}
-
-
-
-void CommunicationProtocolConjPort_sendData(const CommunicationProtocolConjPort* self) {
- ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjPort", "sendData")
- etPort_sendMessage(self, CommunicationProtocol_IN_sendData, 0, NULL);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void CommunicationProtocolConjReplPort_sendData_broadcast(const CommunicationProtocolConjReplPort* self) {
- int i;
- ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjReplPort", "sendData")
- for (i=0; i<((etReplPort*)self)->size; ++i) {
- etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[i]), CommunicationProtocol_IN_sendData, 0, NULL);
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void CommunicationProtocolConjReplPort_sendData(const CommunicationProtocolConjReplPort* self, int idx) {
- ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjReplPort", "sendData")
- if (0<=idx && idx<((etReplPort*)self)->size) {
- etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[idx]), CommunicationProtocol_IN_sendData, 0, NULL);
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-// getReplication
-etInt32 CommunicationProtocolConjReplPort_getReplication(const CommunicationProtocolConjReplPort* self) {
- return ((etReplPort*)self)->size;
-}
-
-
-
-/*--------------------- debug helpers */
-
-/* message names as strings for debugging (generate MSC) */
-static const char* const CommunicationProtocol_messageStrings[] = {"MIN", "receivedData","sendData", "MAX"};
-
-const char* CommunicationProtocol_getMessageString(int msg_id) {
- if (msg_id<CommunicationProtocol_MSG_MIN || msg_id>CommunicationProtocol_MSG_MAX+1){
- /* id out of range */
- return "Message ID out of range";
- }
- else{
- return CommunicationProtocol_messageStrings[msg_id];
- }
-}
+/** + * @author generated by eTrice + * + * Source File of ProtocolClass CommunicationProtocol + * + */ + +#include "CommunicationProtocol.h" +#include "debugging/etMSCLogger.h" + + +/*--------------------- port methods */ + +void CommunicationProtocolPort_receivedData(const CommunicationProtocolPort* self) { + ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolPort", "receivedData") + etPort_sendMessage(self, CommunicationProtocol_OUT_receivedData, 0, NULL); + ET_MSC_LOGGER_SYNC_EXIT +} + +void CommunicationProtocolReplPort_receivedData_broadcast(const CommunicationProtocolReplPort* self) { + int i; + ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolReplPort", "receivedData") + for (i=0; i<((etReplPort*)self)->size; ++i) { + etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[i]), CommunicationProtocol_OUT_receivedData, 0, NULL); + } + ET_MSC_LOGGER_SYNC_EXIT +} + +void CommunicationProtocolReplPort_receivedData(const CommunicationProtocolReplPort* self, int idx) { + ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolReplPort", "receivedData") + if (0<=idx && idx<((etReplPort*)self)->size) { + etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[idx]), CommunicationProtocol_OUT_receivedData, 0, NULL); + } + ET_MSC_LOGGER_SYNC_EXIT +} + + +// getReplication +etInt32 CommunicationProtocolReplPort_getReplication(const CommunicationProtocolReplPort* self) { + return ((etReplPort*)self)->size; +} + + + +void CommunicationProtocolConjPort_sendData(const CommunicationProtocolConjPort* self) { + ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjPort", "sendData") + etPort_sendMessage(self, CommunicationProtocol_IN_sendData, 0, NULL); + ET_MSC_LOGGER_SYNC_EXIT +} + +void CommunicationProtocolConjReplPort_sendData_broadcast(const CommunicationProtocolConjReplPort* self) { + int i; + ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjReplPort", "sendData") + for (i=0; i<((etReplPort*)self)->size; ++i) { + etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[i]), CommunicationProtocol_IN_sendData, 0, NULL); + } + ET_MSC_LOGGER_SYNC_EXIT +} + +void CommunicationProtocolConjReplPort_sendData(const CommunicationProtocolConjReplPort* self, int idx) { + ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjReplPort", "sendData") + if (0<=idx && idx<((etReplPort*)self)->size) { + etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[idx]), CommunicationProtocol_IN_sendData, 0, NULL); + } + ET_MSC_LOGGER_SYNC_EXIT +} + + +// getReplication +etInt32 CommunicationProtocolConjReplPort_getReplication(const CommunicationProtocolConjReplPort* self) { + return ((etReplPort*)self)->size; +} + + + +/*--------------------- debug helpers */ + +/* message names as strings for debugging (generate MSC) */ +static const char* const CommunicationProtocol_messageStrings[] = {"MIN", "receivedData","sendData", "MAX"}; + +const char* CommunicationProtocol_getMessageString(int msg_id) { + if (msg_id<CommunicationProtocol_MSG_MIN || msg_id>CommunicationProtocol_MSG_MAX+1){ + /* id out of range */ + return "Message ID out of range"; + } + else{ + return CommunicationProtocol_messageStrings[msg_id]; + } +} diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/CommunicationProtocol.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/CommunicationProtocol.h index 7fd2bf544..f47a88a1a 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/CommunicationProtocol.h +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/CommunicationProtocol.h @@ -1,54 +1,54 @@ -/**
- * @author generated by eTrice
- *
- * Header File of ProtocolClass CommunicationProtocol
- *
- */
-
-#ifndef _COMMUNICATIONPROTOCOL_H_
-#define _COMMUNICATIONPROTOCOL_H_
-
-#include "etDatatypes.h"
-#include "modelbase/etPort.h"
-
-
-
-
-/* message IDs */
-enum CommunicationProtocol_msg_ids {
- CommunicationProtocol_MSG_MIN = 0,
- CommunicationProtocol_OUT_receivedData = 1,
- CommunicationProtocol_IN_sendData = 2,
- CommunicationProtocol_MSG_MAX = 3
-};
-
-/*--------------------- port structs and methods */
-typedef etPort CommunicationProtocolPort;
-typedef etReplPort CommunicationProtocolReplPort;
-
-
-void CommunicationProtocolPort_receivedData(const CommunicationProtocolPort* self);
-void CommunicationProtocolReplPort_receivedData_broadcast(const CommunicationProtocolReplPort* self);
-void CommunicationProtocolReplPort_receivedData(const CommunicationProtocolReplPort* self, int idx);
-
-
-etInt32 CommunicationProtocolReplPort_getReplication(const CommunicationProtocolReplPort* self);
-typedef etPort CommunicationProtocolConjPort;
-typedef etReplPort CommunicationProtocolConjReplPort;
-
-
-void CommunicationProtocolConjPort_sendData(const CommunicationProtocolConjPort* self);
-void CommunicationProtocolConjReplPort_sendData_broadcast(const CommunicationProtocolConjReplPort* self);
-void CommunicationProtocolConjReplPort_sendData(const CommunicationProtocolConjReplPort* self, int idx);
-
-
-etInt32 CommunicationProtocolConjReplPort_getReplication(const CommunicationProtocolConjReplPort* self);
-
-/*--------------------- debug helpers */
-
-/* get message string for message id */
-const char* CommunicationProtocol_getMessageString(int msg_id);
-
-
-#endif /* _COMMUNICATIONPROTOCOL_H_ */
-
+/** + * @author generated by eTrice + * + * Header File of ProtocolClass CommunicationProtocol + * + */ + +#ifndef _COMMUNICATIONPROTOCOL_H_ +#define _COMMUNICATIONPROTOCOL_H_ + +#include "etDatatypes.h" +#include "modelbase/etPort.h" + + + + +/* message IDs */ +enum CommunicationProtocol_msg_ids { + CommunicationProtocol_MSG_MIN = 0, + CommunicationProtocol_OUT_receivedData = 1, + CommunicationProtocol_IN_sendData = 2, + CommunicationProtocol_MSG_MAX = 3 +}; + +/*--------------------- port structs and methods */ +typedef etPort CommunicationProtocolPort; +typedef etReplPort CommunicationProtocolReplPort; + + +void CommunicationProtocolPort_receivedData(const CommunicationProtocolPort* self); +void CommunicationProtocolReplPort_receivedData_broadcast(const CommunicationProtocolReplPort* self); +void CommunicationProtocolReplPort_receivedData(const CommunicationProtocolReplPort* self, int idx); + + +etInt32 CommunicationProtocolReplPort_getReplication(const CommunicationProtocolReplPort* self); +typedef etPort CommunicationProtocolConjPort; +typedef etReplPort CommunicationProtocolConjReplPort; + + +void CommunicationProtocolConjPort_sendData(const CommunicationProtocolConjPort* self); +void CommunicationProtocolConjReplPort_sendData_broadcast(const CommunicationProtocolConjReplPort* self); +void CommunicationProtocolConjReplPort_sendData(const CommunicationProtocolConjReplPort* self, int idx); + + +etInt32 CommunicationProtocolConjReplPort_getReplication(const CommunicationProtocolConjReplPort* self); + +/*--------------------- debug helpers */ + +/* get message string for message id */ +const char* CommunicationProtocol_getMessageString(int msg_id); + + +#endif /* _COMMUNICATIONPROTOCOL_H_ */ + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass1.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass1.c index 5ff2a95d4..a2f92e8d7 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass1.c +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass1.c @@ -1,30 +1,30 @@ -/**
- * @author generated by eTrice
- *
- * Source File of DataClass DataClass1
- *
- */
-
-#include "DataClass1.h"
-
-#include <string.h>
-
-/*--------------------- begin user code ---------------------*/
-// usercode3
-/*--------------------- end user code ---------------------*/
-
-
-/*--------------------- operations ---------------------*/
-int32 DataClass1_MultiplyWithAttr1(DataClass1* self, int32 value) {
- return self->Attr1 /* ORIG: Attr1 */*value;
-}
-float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value) {
- return self->Attr3 /* ORIG: Attr3 */*value;
-}
-
-// deep copy
-void DataClass1_deepCopy(DataClass1* source, DataClass1* target) {
- memcpy(target, source, sizeof(DataClass1));
-}
-
-
+/** + * @author generated by eTrice + * + * Source File of DataClass DataClass1 + * + */ + +#include "DataClass1.h" + +#include <string.h> + +/*--------------------- begin user code ---------------------*/ +// usercode3 +/*--------------------- end user code ---------------------*/ + + +/*--------------------- operations ---------------------*/ +int32 DataClass1_MultiplyWithAttr1(DataClass1* self, int32 value) { + return self->Attr1 /* ORIG: Attr1 */*value; +} +float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value) { + return self->Attr3 /* ORIG: Attr3 */*value; +} + +// deep copy +void DataClass1_deepCopy(DataClass1* source, DataClass1* target) { + memcpy(target, source, sizeof(DataClass1)); +} + + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass1.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass1.h index 4f3176f62..2a98d98d0 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass1.h +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass1.h @@ -1,40 +1,40 @@ -/**
- * @author generated by eTrice
- *
- * Header File of DataClass DataClass1
- *
- */
-
-#ifndef _DATACLASS1_H_
-#define _DATACLASS1_H_
-
-#include "etDatatypes.h"
-
-#include "DataClass2.h"
-
-/*--------------------- begin user code ---------------------*/
-// usercode1
-/*--------------------- end user code ---------------------*/
-
-typedef struct {
- /*--------------------- attributes ---------------------*/
- int32 Attr1;
- DataClass2 ComplexAttr;
- float32 Attr3;
-} DataClass1;
-
-
-
-/*--------------------- operations ---------------------*/
-int32 DataClass1_MultiplyWithAttr1(DataClass1* self, int32 value);
-float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value);
-
-/* deep copy */
-void DataClass1_deepCopy(DataClass1* source, DataClass1* target);
-
-/*--------------------- begin user code ---------------------*/
-// usercode2
-/*--------------------- end user code ---------------------*/
-
-#endif /* _DATACLASS1_H_ */
-
+/** + * @author generated by eTrice + * + * Header File of DataClass DataClass1 + * + */ + +#ifndef _DATACLASS1_H_ +#define _DATACLASS1_H_ + +#include "etDatatypes.h" + +#include "DataClass2.h" + +/*--------------------- begin user code ---------------------*/ +// usercode1 +/*--------------------- end user code ---------------------*/ + +typedef struct { + /*--------------------- attributes ---------------------*/ + int32 Attr1; + DataClass2 ComplexAttr; + float32 Attr3; +} DataClass1; + + + +/*--------------------- operations ---------------------*/ +int32 DataClass1_MultiplyWithAttr1(DataClass1* self, int32 value); +float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value); + +/* deep copy */ +void DataClass1_deepCopy(DataClass1* source, DataClass1* target); + +/*--------------------- begin user code ---------------------*/ +// usercode2 +/*--------------------- end user code ---------------------*/ + +#endif /* _DATACLASS1_H_ */ + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass2.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass2.c index ab4bbb274..f7f96ed36 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass2.c +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass2.c @@ -1,24 +1,24 @@ -/**
- * @author generated by eTrice
- *
- * Source File of DataClass DataClass2
- *
- */
-
-#include "DataClass2.h"
-
-#include <string.h>
-
-
-
-/*--------------------- operations ---------------------*/
-void DataClass2_Operation1(DataClass2* self) {
- /*nothing to do*/
-}
-
-// deep copy
-void DataClass2_deepCopy(DataClass2* source, DataClass2* target) {
- memcpy(target, source, sizeof(DataClass2));
-}
-
-
+/** + * @author generated by eTrice + * + * Source File of DataClass DataClass2 + * + */ + +#include "DataClass2.h" + +#include <string.h> + + + +/*--------------------- operations ---------------------*/ +void DataClass2_Operation1(DataClass2* self) { + /*nothing to do*/ +} + +// deep copy +void DataClass2_deepCopy(DataClass2* source, DataClass2* target) { + memcpy(target, source, sizeof(DataClass2)); +} + + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass2.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass2.h index ecfba3a42..e480cddca 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass2.h +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/DataClass2.h @@ -1,32 +1,32 @@ -/**
- * @author generated by eTrice
- *
- * Header File of DataClass DataClass2
- *
- */
-
-#ifndef _DATACLASS2_H_
-#define _DATACLASS2_H_
-
-#include "etDatatypes.h"
-
-
-
-typedef struct {
- /*--------------------- attributes ---------------------*/
- int32 Attr1;
- float32 Attr2;
- int32 Attr3;
-} DataClass2;
-
-
-
-/*--------------------- operations ---------------------*/
-void DataClass2_Operation1(DataClass2* self);
-
-/* deep copy */
-void DataClass2_deepCopy(DataClass2* source, DataClass2* target);
-
-
-#endif /* _DATACLASS2_H_ */
-
+/** + * @author generated by eTrice + * + * Header File of DataClass DataClass2 + * + */ + +#ifndef _DATACLASS2_H_ +#define _DATACLASS2_H_ + +#include "etDatatypes.h" + + + +typedef struct { + /*--------------------- attributes ---------------------*/ + int32 Attr1; + float32 Attr2; + int32 Attr3; +} DataClass2; + + + +/*--------------------- operations ---------------------*/ +void DataClass2_Operation1(DataClass2* self); + +/* deep copy */ +void DataClass2_deepCopy(DataClass2* source, DataClass2* target); + + +#endif /* _DATACLASS2_H_ */ + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1.c index 9d13e2242..4d51fbaa2 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1.c +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1.c @@ -1,170 +1,170 @@ -/**
- * @author generated by eTrice
- *
- * Source File of SubSystemClass SubSys
- *
- */
-
-#include "Node1.h"
-
-/* include instances for all classes */
-#include "node1_sys1_Inst.h"
-#include "node1_sys1_Disp.h"
-
-#include "debugging/etLogger.h"
-#include "debugging/etMSCLogger.h"
-
-#include "platform/etTimer.h"
-#include "etRuntimeConfig.h"
-#include "messaging/etMessageService.h"
-
-/* data for Node1 */
-typedef struct Node1 {
- char *name;
- volatile int shutdownRequest;
-} Node1;
-
-static Node1 Node1Inst = {"Node1",0};
-
-void node1_sys1_initActorInstances(void);
-void node1_sys1_constructActorInstances(void);
-
-
-void node1_sys1_initMessageServices(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "initMessageServices")
-
- /* filling all message service threads with data */
- /*PhysicalThread1*/
- // TODO: gen
- msgService_PhysicalThread1.thread.stacksize = 1024;
- msgService_PhysicalThread1.thread.priority = 0;
- msgService_PhysicalThread1.thread.threadName = "PhysicalThread1";
- msgService_PhysicalThread1.thread.threadFunction = (etThreadFunction) etMessageService_execute;
- msgService_PhysicalThread1.thread.threadFunctionData = &msgService_PhysicalThread1;
-
-
- /*PhysicalThread2*/
- // TODO: gen
- msgService_PhysicalThread2.thread.stacksize = 1024;
- msgService_PhysicalThread2.thread.priority = 0;
- msgService_PhysicalThread2.thread.threadName = "PhysicalThread2";
- msgService_PhysicalThread2.thread.threadFunction = (etThreadFunction) etMessageService_execute;
- msgService_PhysicalThread2.thread.threadFunctionData = &msgService_PhysicalThread2;
-
- /* initialization of all message services */
- etMessageService_init(&msgService_PhysicalThread1, msgBuffer_PhysicalThread1, MESSAGE_POOL_MAX, MESSAGE_BLOCK_SIZE, MsgDispatcher_PhysicalThread1_receiveMessage);
- etMessageService_init(&msgService_PhysicalThread2, msgBuffer_PhysicalThread2, MESSAGE_POOL_MAX, MESSAGE_BLOCK_SIZE, MsgDispatcher_PhysicalThread2_receiveMessage);
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_startMessageServices(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "startMessageServices")
-
- etMessageService_start(&msgService_PhysicalThread1);
- etMessageService_start(&msgService_PhysicalThread2);
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_stopMessageServices(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "stopMessageServices")
-
- etMessageService_stop(&msgService_PhysicalThread1);
- etMessageService_stop(&msgService_PhysicalThread2);
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_destroyMessageServices(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "destroyMessageServices")
-
- etMessageService_destroy(&msgService_PhysicalThread1);
- etMessageService_destroy(&msgService_PhysicalThread2);
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_init(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "init")
- etLogger_logInfoF("%s_init", Node1Inst.name);
-
- /* construct all actors */
- node1_sys1_constructActorInstances();
-
- node1_sys1_initMessageServices();
-
- /* init all actors */
- node1_sys1_initActorInstances();
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_start(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "start")
- etLogger_logInfoF("%s_start", Node1Inst.name);
- node1_sys1_startMessageServices();
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_run(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "run")
-
- etThread_sleep(1000);
-
-// #ifdef ET_RUNTIME_ENDLESS
-// while(!(Node1Inst.shutdownRequest)){
-// if (etTimer_executeNeeded()){
-// etMessageService_execute(&msgService_PhysicalThread1);
-// }
-// }
-// #else
-// uint32 loopCounter = 0;
-// while(!(Node1Inst.shutdownRequest)){
-// if (etTimer_executeNeeded()){
-// etMessageService_execute(&msgService_PhysicalThread1);
-// etLogger_logInfo("Execute");
-// if (loopCounter++ > ET_RUNTIME_MAXLOOP){
-// break;
-// }
-// }
-// }
-// #endif
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_stop(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "stop")
- etLogger_logInfoF("%s_stop", Node1Inst.name);
- node1_sys1_stopMessageServices();
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_destroy(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "destroy")
- etLogger_logInfoF("%s_destroy", Node1Inst.name);
- node1_sys1_destroyMessageServices();
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_shutdown(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "shutdown")
- etLogger_logInfoF("%s_shutdown", Node1Inst.name);
- Node1Inst.shutdownRequest = 1;
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-void node1_sys1_constructActorInstances(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "constructActorInstances")
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void node1_sys1_initActorInstances(void){
- ET_MSC_LOGGER_SYNC_ENTRY("Node1", "initActorInstances")
- Sender_init(&_SubSys_Sender);
- Receiver_init(&_SubSys_Receiver);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
+/** + * @author generated by eTrice + * + * Source File of SubSystemClass SubSys + * + */ + +#include "Node1.h" + +/* include instances for all classes */ +#include "node1_sys1_Inst.h" +#include "node1_sys1_Disp.h" + +#include "debugging/etLogger.h" +#include "debugging/etMSCLogger.h" + +#include "platform/etTimer.h" +#include "etRuntimeConfig.h" +#include "messaging/etMessageService.h" + +/* data for Node1 */ +typedef struct Node1 { + char *name; + volatile int shutdownRequest; +} Node1; + +static Node1 Node1Inst = {"Node1",0}; + +void node1_sys1_initActorInstances(void); +void node1_sys1_constructActorInstances(void); + + +void node1_sys1_initMessageServices(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "initMessageServices") + + /* filling all message service threads with data */ + /*PhysicalThread1*/ + // TODO: gen + msgService_PhysicalThread1.thread.stacksize = 1024; + msgService_PhysicalThread1.thread.priority = 0; + msgService_PhysicalThread1.thread.threadName = "PhysicalThread1"; + msgService_PhysicalThread1.thread.threadFunction = (etThreadFunction) etMessageService_execute; + msgService_PhysicalThread1.thread.threadFunctionData = &msgService_PhysicalThread1; + + + /*PhysicalThread2*/ + // TODO: gen + msgService_PhysicalThread2.thread.stacksize = 1024; + msgService_PhysicalThread2.thread.priority = 0; + msgService_PhysicalThread2.thread.threadName = "PhysicalThread2"; + msgService_PhysicalThread2.thread.threadFunction = (etThreadFunction) etMessageService_execute; + msgService_PhysicalThread2.thread.threadFunctionData = &msgService_PhysicalThread2; + + /* initialization of all message services */ + etMessageService_init(&msgService_PhysicalThread1, msgBuffer_PhysicalThread1, MESSAGE_POOL_MAX, MESSAGE_BLOCK_SIZE, MsgDispatcher_PhysicalThread1_receiveMessage); + etMessageService_init(&msgService_PhysicalThread2, msgBuffer_PhysicalThread2, MESSAGE_POOL_MAX, MESSAGE_BLOCK_SIZE, MsgDispatcher_PhysicalThread2_receiveMessage); + + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_startMessageServices(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "startMessageServices") + + etMessageService_start(&msgService_PhysicalThread1); + etMessageService_start(&msgService_PhysicalThread2); + + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_stopMessageServices(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "stopMessageServices") + + etMessageService_stop(&msgService_PhysicalThread1); + etMessageService_stop(&msgService_PhysicalThread2); + + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_destroyMessageServices(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "destroyMessageServices") + + etMessageService_destroy(&msgService_PhysicalThread1); + etMessageService_destroy(&msgService_PhysicalThread2); + + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_init(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "init") + etLogger_logInfoF("%s_init", Node1Inst.name); + + /* construct all actors */ + node1_sys1_constructActorInstances(); + + node1_sys1_initMessageServices(); + + /* init all actors */ + node1_sys1_initActorInstances(); + + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_start(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "start") + etLogger_logInfoF("%s_start", Node1Inst.name); + node1_sys1_startMessageServices(); + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_run(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "run") + + etThread_sleep(1000); + +// #ifdef ET_RUNTIME_ENDLESS +// while(!(Node1Inst.shutdownRequest)){ +// if (etTimer_executeNeeded()){ +// etMessageService_execute(&msgService_PhysicalThread1); +// } +// } +// #else +// uint32 loopCounter = 0; +// while(!(Node1Inst.shutdownRequest)){ +// if (etTimer_executeNeeded()){ +// etMessageService_execute(&msgService_PhysicalThread1); +// etLogger_logInfo("Execute"); +// if (loopCounter++ > ET_RUNTIME_MAXLOOP){ +// break; +// } +// } +// } +// #endif + + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_stop(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "stop") + etLogger_logInfoF("%s_stop", Node1Inst.name); + node1_sys1_stopMessageServices(); + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_destroy(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "destroy") + etLogger_logInfoF("%s_destroy", Node1Inst.name); + node1_sys1_destroyMessageServices(); + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_shutdown(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "shutdown") + etLogger_logInfoF("%s_shutdown", Node1Inst.name); + Node1Inst.shutdownRequest = 1; + ET_MSC_LOGGER_SYNC_EXIT +} + + +void node1_sys1_constructActorInstances(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "constructActorInstances") + ET_MSC_LOGGER_SYNC_EXIT +} + +void node1_sys1_initActorInstances(void){ + ET_MSC_LOGGER_SYNC_ENTRY("Node1", "initActorInstances") + Sender_init(&_SubSys_Sender); + Receiver_init(&_SubSys_Receiver); + ET_MSC_LOGGER_SYNC_EXIT +} + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1.h index 7fce4d2cb..e37bb3c42 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1.h +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1.h @@ -1,30 +1,30 @@ -/**
- * @author generated by eTrice
- *
- * Header File of SubSystemClass SubSys
- *
- */
-
-#ifndef _NODE1_H_
-#define _NODE1_H_
-
-
-
-/* lifecycle functions
- * init -> start -> run (loop) -> stop -> destroy
- */
-
-void Node1_init(void); /* lifecycle init */
-void Node1_start(void); /* lifecycle start */
-
-void Node1_run(void); /* lifecycle run */
-
-void Node1_stop(void); /* lifecycle stop */
-void Node1_destroy(void); /* lifecycle destroy */
-
-void Node1_shutdown(void); /* shutdown the dispatcher loop */
-
-
-#endif /* _NODE1_H_ */
-
-
+/** + * @author generated by eTrice + * + * Header File of SubSystemClass SubSys + * + */ + +#ifndef _NODE1_H_ +#define _NODE1_H_ + + + +/* lifecycle functions + * init -> start -> run (loop) -> stop -> destroy + */ + +void Node1_init(void); /* lifecycle init */ +void Node1_start(void); /* lifecycle start */ + +void Node1_run(void); /* lifecycle run */ + +void Node1_stop(void); /* lifecycle stop */ +void Node1_destroy(void); /* lifecycle destroy */ + +void Node1_shutdown(void); /* shutdown the dispatcher loop */ + + +#endif /* _NODE1_H_ */ + + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1_Disp.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1_Disp.h index 38c3df51f..a83106d50 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1_Disp.h +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1_Disp.h @@ -1,43 +1,43 @@ -/**
- * @author generated by eTrice
- *
- * Dispatcher File of SubSystemClass SubSys
- * - one generated dispatcher for each MessageService (Thread)
- */
-
-#include "messaging/etMessageReceiver.h"
-#include "debugging/etLogger.h"
-#include "debugging/etMSCLogger.h"
-
-static void MsgDispatcher_PhysicalThread1_receiveMessage(const etMessage* msg){
- ET_MSC_LOGGER_SYNC_ENTRY("MsgDispatcher_PhysicalThread1", "receiveMessage")
- switch(msg->address){
-
- /* interface items of /SubSys/Sender */
- case 102:
- Sender_receiveMessage((void*)&_SubSys_Sender,(etPort*)&_SubSys_Sender_const.dataOut, msg);
- break;
-
- default:
- etLogger_logErrorF("MessageService_Thread1_receiveMessage: address %d does not exist ", msg->address);
- break;
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-static void MsgDispatcher_PhysicalThread2_receiveMessage(const etMessage* msg){
- ET_MSC_LOGGER_SYNC_ENTRY("MsgDispatcher_PhysicalThread2", "receiveMessage")
- switch(msg->address){
-
- /* interface items of /SubSys/Receiver */
- case 104:
- Receiver_receiveMessage((void*)&_SubSys_Receiver,(etPort*)&_SubSys_Receiver_const.dataIn, msg);
- break;
-
- default:
- etLogger_logErrorF("MessageService_Thread1_receiveMessage: address %d does not exist ", msg->address);
- break;
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
+/** + * @author generated by eTrice + * + * Dispatcher File of SubSystemClass SubSys + * - one generated dispatcher for each MessageService (Thread) + */ + +#include "messaging/etMessageReceiver.h" +#include "debugging/etLogger.h" +#include "debugging/etMSCLogger.h" + +static void MsgDispatcher_PhysicalThread1_receiveMessage(const etMessage* msg){ + ET_MSC_LOGGER_SYNC_ENTRY("MsgDispatcher_PhysicalThread1", "receiveMessage") + switch(msg->address){ + + /* interface items of /SubSys/Sender */ + case 102: + Sender_receiveMessage((void*)&_SubSys_Sender,(etPort*)&_SubSys_Sender_const.dataOut, msg); + break; + + default: + etLogger_logErrorF("MessageService_Thread1_receiveMessage: address %d does not exist ", msg->address); + break; + } + ET_MSC_LOGGER_SYNC_EXIT +} + +static void MsgDispatcher_PhysicalThread2_receiveMessage(const etMessage* msg){ + ET_MSC_LOGGER_SYNC_ENTRY("MsgDispatcher_PhysicalThread2", "receiveMessage") + switch(msg->address){ + + /* interface items of /SubSys/Receiver */ + case 104: + Receiver_receiveMessage((void*)&_SubSys_Receiver,(etPort*)&_SubSys_Receiver_const.dataIn, msg); + break; + + default: + etLogger_logErrorF("MessageService_Thread1_receiveMessage: address %d does not exist ", msg->address); + break; + } + ET_MSC_LOGGER_SYNC_EXIT +} + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1_Inst.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1_Inst.h index 75c0d0cbf..54476df7d 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1_Inst.h +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Node1_Inst.h @@ -1,81 +1,81 @@ -/**
- * @author generated by eTrice
- *
- * Instance File of SubSystemClass SubSys
- * - instantiation of all actor instances and port instances
- * - configuration of data and connection of ports
- */
-
-#include "platform/etMemory.h"
-
-/* include all used ActorClasses */
-#include "Receiver.h"
-#include "Sender.h"
-
-/* include all used ProtcolClasses */
-#include "CommunicationProtocol.h"
-
-
-/* instantiation of message services */
-/* PhysicalThread1 */
-// TODO: generate sizes
-static uint8 msgBuffer_PhysicalThread1[MESSAGE_POOL_MAX*MESSAGE_BLOCK_SIZE];
-static etMessageService msgService_PhysicalThread1;
-
-/* PhysicalThread2 */
-static uint8 msgBuffer_PhysicalThread2[MESSAGE_POOL_MAX*MESSAGE_BLOCK_SIZE];
-static etMessageService msgService_PhysicalThread2;
-
-/* declarations of all ActorClass instances (const and variable structs) */
-
-/* forward declaration of variable actor structs */
-static Sender _SubSys_Sender;
-static Receiver _SubSys_Receiver;
-
-/* forward declaration of variable port structs */
-
-
-/* instance _SubSys_Sender */
-static const Sender_const _SubSys_Sender_const = {
- /* Ports: {varData, msgService, peerAddress, localId} */
- {0,&msgService_PhysicalThread2, 104, 1} /* Port dataOut */
-
- /* data receive ports */
-};
-static Sender _SubSys_Sender = {
- &_SubSys_Sender_const,
-
- /* data send ports */
-
- /* attributes */
-
- /* state and history are initialized in init fuction */
-};
-
-/* instance _SubSys_Receiver */
-static const Receiver_const _SubSys_Receiver_const = {
- /* Ports: {varData, msgService, peerAddress, localId} */
- {0,&msgService_PhysicalThread1, 102, 1} /* Port dataIn */
-
- /* data receive ports */
-};
-static Receiver _SubSys_Receiver = {
- &_SubSys_Receiver_const,
-
- /* data send ports */
-
- /* attributes */
- {
- 0,
- {
- 0,
- 0,
- 0
- },
- 0
- }
- , /* attr1 */
-
- /* state and history are initialized in init fuction */
-};
-
+/** + * @author generated by eTrice + * + * Instance File of SubSystemClass SubSys + * - instantiation of all actor instances and port instances + * - configuration of data and connection of ports + */ + +#include "platform/etMemory.h" + +/* include all used ActorClasses */ +#include "Receiver.h" +#include "Sender.h" + +/* include all used ProtcolClasses */ +#include "CommunicationProtocol.h" + + +/* instantiation of message services */ +/* PhysicalThread1 */ +// TODO: generate sizes +static uint8 msgBuffer_PhysicalThread1[MESSAGE_POOL_MAX*MESSAGE_BLOCK_SIZE]; +static etMessageService msgService_PhysicalThread1; + +/* PhysicalThread2 */ +static uint8 msgBuffer_PhysicalThread2[MESSAGE_POOL_MAX*MESSAGE_BLOCK_SIZE]; +static etMessageService msgService_PhysicalThread2; + +/* declarations of all ActorClass instances (const and variable structs) */ + +/* forward declaration of variable actor structs */ +static Sender _SubSys_Sender; +static Receiver _SubSys_Receiver; + +/* forward declaration of variable port structs */ + + +/* instance _SubSys_Sender */ +static const Sender_const _SubSys_Sender_const = { + /* Ports: {varData, msgService, peerAddress, localId} */ + {0,&msgService_PhysicalThread2, 104, 1} /* Port dataOut */ + + /* data receive ports */ +}; +static Sender _SubSys_Sender = { + &_SubSys_Sender_const, + + /* data send ports */ + + /* attributes */ + + /* state and history are initialized in init fuction */ +}; + +/* instance _SubSys_Receiver */ +static const Receiver_const _SubSys_Receiver_const = { + /* Ports: {varData, msgService, peerAddress, localId} */ + {0,&msgService_PhysicalThread1, 102, 1} /* Port dataIn */ + + /* data receive ports */ +}; +static Receiver _SubSys_Receiver = { + &_SubSys_Receiver_const, + + /* data send ports */ + + /* attributes */ + { + 0, + { + 0, + 0, + 0 + }, + 0 + } + , /* attr1 */ + + /* state and history are initialized in init fuction */ +}; + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Receiver.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Receiver.c index 02fc5f28f..df7a1e775 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Receiver.c +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Receiver.c @@ -1,199 +1,199 @@ -/**
- * @author generated by eTrice
- *
- * Source File of ActorClass Receiver
- *
- */
-
-#include "Receiver.h"
-
-#include "modelbase/etActor.h"
-#include "debugging/etLogger.h"
-#include "debugging/etMSCLogger.h"
-#include "etUnit/etUnit.h"
-#include "platform/etMemory.h"
-
-#include "CommunicationProtocol.h"
-
-
-/* interface item IDs */
-enum interface_items {
- IFITEM_dataIn = 1
-};
-
-
-/* state IDs */
-enum state_ids {
- NO_STATE = 0,
- STATE_TOP = 1,
- STATE_Idle = 2,
- STATE_DataReceived = 3
-};
-
-static char* state_names[] = {
- "NO_STATE", "TOP", "Idle", "DataReceived"
-};
-
-/* transition chains */
-enum chain_ids {
- CHAIN_TRANS_INITIAL_TO__Idle = 1,
- CHAIN_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn = 2
-};
-
-/* triggers */
-enum triggers {
- POLLING = 0,
- TRIG_dataIn__sendData = IFITEM_dataIn + EVT_SHIFT*CommunicationProtocol_IN_sendData
-};
-
-
-static void setState(Receiver* self, int new_state) {
- etLogger_logInfoF("Receiver: setState: new state=%d", new_state);
- ET_MSC_LOGGER_CHANGE_STATE("Receiver", state_names[new_state]);
- self->state = new_state;
-}
-
-/* Entry and Exit Codes */
-
-/* Action Codes */
-static void action_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn(Receiver* self, InterfaceItemBase *ifitem) {
- CommunicationProtocolPort_receivedData(&self->constData->dataIn) /* ORIG: dataIn.receivedData() */;
-}
-
-/**
- * calls exit codes while exiting from the current state to one of its
- * parent states while remembering the history
- * @param current - the current state
- * @param to - the final parent state
- * @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)
- */
-static void exitTo(Receiver* self, int current, int to, boolean handler) {
- while (current!=to) {
- switch (current) {
- case STATE_Idle:
- self->history[STATE_TOP] = STATE_Idle;
- current = STATE_TOP;
- break;
- case STATE_DataReceived:
- self->history[STATE_TOP] = STATE_DataReceived;
- current = STATE_TOP;
- 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 - the chain ID
- * @param generic_data - the generic data pointer
- * @return the ID of the final state
- */
-static int executeTransitionChain(Receiver* self, int chain, InterfaceItemBase *ifitem, void* generic_data) {
- switch (chain) {
- case CHAIN_TRANS_INITIAL_TO__Idle:
- {
- return STATE_Idle;
- }
- case CHAIN_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn:
- {
- action_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn(self, ifitem);
- return STATE_DataReceived;
- }
- }
- return NO_STATE;
-}
-
-/**
- * calls entry codes while entering a state's history. The ID of the final leaf state is returned
- * @param state - the state which is entered
- * @param handler - entry code is executed if not handler
- * @return - the ID of the final leaf state
- */
-static int enterHistory(Receiver* self, int state, boolean handler, boolean skip_entry) {
- while (TRUE) {
- switch (state) {
- case STATE_Idle:
- // in leaf state: return state id
- return STATE_Idle;
- case STATE_DataReceived:
- // in leaf state: return state id
- return STATE_DataReceived;
- case STATE_TOP:
- state = self->history[STATE_TOP];
- break;
- }
- skip_entry = FALSE;
- }
- //return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true)
-}
-
-static void executeInitTransition(Receiver* self) {
- int chain = CHAIN_TRANS_INITIAL_TO__Idle;
- int next = executeTransitionChain(self, chain, NULL, NULL);
- next = enterHistory(self, next, FALSE, FALSE);
- setState(self, next);
-}
-
-/* receiveEvent contains the main implementation of the FSM */
-static void receiveEvent(Receiver* self, InterfaceItemBase *ifitem, int evt, void* generic_data) {
- int trigger = ifitem->localId + EVT_SHIFT*evt;
- int chain = NOT_CAUGHT;
- int catching_state = NO_STATE;
- boolean is_handler = FALSE;
- boolean skip_entry = FALSE;
- ET_MSC_LOGGER_SYNC_ENTRY("Receiver", "receiveEvent")
-
- if (!handleSystemEvent(ifitem, evt, generic_data)) {
- switch (self->state) {
- case STATE_Idle:
- switch(trigger) {
- case TRIG_dataIn__sendData:
- {
- chain = CHAIN_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn;
- catching_state = STATE_TOP;
- }
- break;
- }
- break;
- case STATE_DataReceived:
- break;
- }
- }
- if (chain != NOT_CAUGHT) {
- exitTo(self, self->state, catching_state, is_handler);
- int next = executeTransitionChain(self, chain, ifitem, generic_data);
- next = enterHistory(self, next, is_handler, skip_entry);
- setState(self, next);
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-//******************************************
-// END of generated code for FSM
-//******************************************
-
-void Receiver_init(Receiver* self){
- ET_MSC_LOGGER_SYNC_ENTRY("Receiver", "init")
- self->state = STATE_TOP;
- {
- int i;
- for (i=0; i<RECEIVER_HISTORY_SIZE; ++i)
- self->history[i] = NO_STATE;
- }
- executeInitTransition(self);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-void Receiver_receiveMessage(void* self, void* ifitem, const etMessage* msg){
- ET_MSC_LOGGER_SYNC_ENTRY("Receiver", "receiveMessage")
-
- receiveEvent(self, (etPort*)ifitem, msg->evtID, (void*)(((char*)msg)+MEM_CEIL(sizeof(etMessage))));
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-/*--------------------- operations ---------------------*/
-
+/** + * @author generated by eTrice + * + * Source File of ActorClass Receiver + * + */ + +#include "Receiver.h" + +#include "modelbase/etActor.h" +#include "debugging/etLogger.h" +#include "debugging/etMSCLogger.h" +#include "etUnit/etUnit.h" +#include "platform/etMemory.h" + +#include "CommunicationProtocol.h" + + +/* interface item IDs */ +enum interface_items { + IFITEM_dataIn = 1 +}; + + +/* state IDs */ +enum state_ids { + NO_STATE = 0, + STATE_TOP = 1, + STATE_Idle = 2, + STATE_DataReceived = 3 +}; + +static char* state_names[] = { + "NO_STATE", "TOP", "Idle", "DataReceived" +}; + +/* transition chains */ +enum chain_ids { + CHAIN_TRANS_INITIAL_TO__Idle = 1, + CHAIN_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn = 2 +}; + +/* triggers */ +enum triggers { + POLLING = 0, + TRIG_dataIn__sendData = IFITEM_dataIn + EVT_SHIFT*CommunicationProtocol_IN_sendData +}; + + +static void setState(Receiver* self, int new_state) { + etLogger_logInfoF("Receiver: setState: new state=%d", new_state); + ET_MSC_LOGGER_CHANGE_STATE("Receiver", state_names[new_state]); + self->state = new_state; +} + +/* Entry and Exit Codes */ + +/* Action Codes */ +static void action_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn(Receiver* self, InterfaceItemBase *ifitem) { + CommunicationProtocolPort_receivedData(&self->constData->dataIn) /* ORIG: dataIn.receivedData() */; +} + +/** + * calls exit codes while exiting from the current state to one of its + * parent states while remembering the history + * @param current - the current state + * @param to - the final parent state + * @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints) + */ +static void exitTo(Receiver* self, int current, int to, boolean handler) { + while (current!=to) { + switch (current) { + case STATE_Idle: + self->history[STATE_TOP] = STATE_Idle; + current = STATE_TOP; + break; + case STATE_DataReceived: + self->history[STATE_TOP] = STATE_DataReceived; + current = STATE_TOP; + 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 - the chain ID + * @param generic_data - the generic data pointer + * @return the ID of the final state + */ +static int executeTransitionChain(Receiver* self, int chain, InterfaceItemBase *ifitem, void* generic_data) { + switch (chain) { + case CHAIN_TRANS_INITIAL_TO__Idle: + { + return STATE_Idle; + } + case CHAIN_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn: + { + action_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn(self, ifitem); + return STATE_DataReceived; + } + } + return NO_STATE; +} + +/** + * calls entry codes while entering a state's history. The ID of the final leaf state is returned + * @param state - the state which is entered + * @param handler - entry code is executed if not handler + * @return - the ID of the final leaf state + */ +static int enterHistory(Receiver* self, int state, boolean handler, boolean skip_entry) { + while (TRUE) { + switch (state) { + case STATE_Idle: + // in leaf state: return state id + return STATE_Idle; + case STATE_DataReceived: + // in leaf state: return state id + return STATE_DataReceived; + case STATE_TOP: + state = self->history[STATE_TOP]; + break; + } + skip_entry = FALSE; + } + //return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) +} + +static void executeInitTransition(Receiver* self) { + int chain = CHAIN_TRANS_INITIAL_TO__Idle; + int next = executeTransitionChain(self, chain, NULL, NULL); + next = enterHistory(self, next, FALSE, FALSE); + setState(self, next); +} + +/* receiveEvent contains the main implementation of the FSM */ +static void receiveEvent(Receiver* self, InterfaceItemBase *ifitem, int evt, void* generic_data) { + int trigger = ifitem->localId + EVT_SHIFT*evt; + int chain = NOT_CAUGHT; + int catching_state = NO_STATE; + boolean is_handler = FALSE; + boolean skip_entry = FALSE; + ET_MSC_LOGGER_SYNC_ENTRY("Receiver", "receiveEvent") + + if (!handleSystemEvent(ifitem, evt, generic_data)) { + switch (self->state) { + case STATE_Idle: + switch(trigger) { + case TRIG_dataIn__sendData: + { + chain = CHAIN_TRANS_tr0_FROM_Idle_TO_DataReceived_BY_sendDatadataIn; + catching_state = STATE_TOP; + } + break; + } + break; + case STATE_DataReceived: + break; + } + } + if (chain != NOT_CAUGHT) { + exitTo(self, self->state, catching_state, is_handler); + int next = executeTransitionChain(self, chain, ifitem, generic_data); + next = enterHistory(self, next, is_handler, skip_entry); + setState(self, next); + } + ET_MSC_LOGGER_SYNC_EXIT +} + +//****************************************** +// END of generated code for FSM +//****************************************** + +void Receiver_init(Receiver* self){ + ET_MSC_LOGGER_SYNC_ENTRY("Receiver", "init") + self->state = STATE_TOP; + { + int i; + for (i=0; i<RECEIVER_HISTORY_SIZE; ++i) + self->history[i] = NO_STATE; + } + executeInitTransition(self); + ET_MSC_LOGGER_SYNC_EXIT +} + + +void Receiver_receiveMessage(void* self, void* ifitem, const etMessage* msg){ + ET_MSC_LOGGER_SYNC_ENTRY("Receiver", "receiveMessage") + + receiveEvent(self, (etPort*)ifitem, msg->evtID, (void*)(((char*)msg)+MEM_CEIL(sizeof(etMessage)))); + + ET_MSC_LOGGER_SYNC_EXIT +} + + +/*--------------------- operations ---------------------*/ + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Receiver.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Receiver.h index 6806a7d96..4e6c8218d 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Receiver.h +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Receiver.h @@ -1,62 +1,62 @@ -/**
- * @author generated by eTrice
- *
- * Header File of ActorClass Receiver
- *
- */
-
-#ifndef _RECEIVER_H_
-#define _RECEIVER_H_
-
-#include "etDatatypes.h"
-#include "messaging/etMessage.h"
-
-#include "DataClass1.h"
-#include "CommunicationProtocol.h"
-
-
-typedef struct Receiver Receiver;
-
-/* const part of ActorClass (ROM) */
-typedef struct Receiver_const {
- /* simple ports */
- const CommunicationProtocolPort dataIn;
-
- /* data receive ports */
-
- /* saps */
-
- /* replicated ports */
-
- /* services */
-} Receiver_const;
-
-
-/* constant for state machine data */
-#define RECEIVER_HISTORY_SIZE 2
-
-/* variable part of ActorClass (RAM) */
-struct Receiver {
- const Receiver_const* const constData;
-
- /* data send ports */
-
- /*--------------------- attributes ---------------------*/
- DataClass1 attr1;
-
-
- /* state machine variables */
- etInt16 state;
- etInt16 history[RECEIVER_HISTORY_SIZE];
-};
-
-void Receiver_init(Receiver* self);
-
-void Receiver_receiveMessage(void* self, void* ifitem, const etMessage* msg);
-
-
-/*--------------------- operations ---------------------*/
-
-
-#endif /* _RECEIVER_H_ */
-
+/** + * @author generated by eTrice + * + * Header File of ActorClass Receiver + * + */ + +#ifndef _RECEIVER_H_ +#define _RECEIVER_H_ + +#include "etDatatypes.h" +#include "messaging/etMessage.h" + +#include "DataClass1.h" +#include "CommunicationProtocol.h" + + +typedef struct Receiver Receiver; + +/* const part of ActorClass (ROM) */ +typedef struct Receiver_const { + /* simple ports */ + const CommunicationProtocolPort dataIn; + + /* data receive ports */ + + /* saps */ + + /* replicated ports */ + + /* services */ +} Receiver_const; + + +/* constant for state machine data */ +#define RECEIVER_HISTORY_SIZE 2 + +/* variable part of ActorClass (RAM) */ +struct Receiver { + const Receiver_const* const constData; + + /* data send ports */ + + /*--------------------- attributes ---------------------*/ + DataClass1 attr1; + + + /* state machine variables */ + etInt16 state; + etInt16 history[RECEIVER_HISTORY_SIZE]; +}; + +void Receiver_init(Receiver* self); + +void Receiver_receiveMessage(void* self, void* ifitem, const etMessage* msg); + + +/*--------------------- operations ---------------------*/ + + +#endif /* _RECEIVER_H_ */ + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Sender.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Sender.c index ac71335e8..686063e4e 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Sender.c +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Sender.c @@ -1,197 +1,197 @@ -/**
- * @author generated by eTrice
- *
- * Source File of ActorClass Sender
- *
- */
-
-#include "Sender.h"
-
-#include "modelbase/etActor.h"
-#include "debugging/etLogger.h"
-#include "debugging/etMSCLogger.h"
-#include "etUnit/etUnit.h"
-#include "platform/etMemory.h"
-
-#include "CommunicationProtocol.h"
-
-
-/* interface item IDs */
-enum interface_items {
- IFITEM_dataOut = 1
-};
-
-
-/* state IDs */
-enum state_ids {
- NO_STATE = 0,
- STATE_TOP = 1,
- STATE_SendingData = 2,
- STATE_Done = 3
-};
-
-static char* state_names[] = {
- "NO_STATE", "TOP", "SendingData", "Done"
-};
-
-/* transition chains */
-enum chain_ids {
- CHAIN_TRANS_INITIAL_TO__SendingData = 1,
- CHAIN_TRANS_tr0_FROM_SendingData_TO_Done_BY_receivedDatadataOut = 2
-};
-
-/* triggers */
-enum triggers {
- POLLING = 0,
- TRIG_dataOut__receivedData = IFITEM_dataOut + EVT_SHIFT*CommunicationProtocol_OUT_receivedData
-};
-
-
-static void setState(Sender* self, int new_state) {
- etLogger_logInfoF("Sender: setState: new state=%d", new_state);
- ET_MSC_LOGGER_CHANGE_STATE("Sender", state_names[new_state]);
- self->state = new_state;
-}
-
-/* Entry and Exit Codes */
-static void entry_SendingData(Sender* self) {
- CommunicationProtocolConjPort_sendData(&self->constData->dataOut) /* ORIG: dataOut.sendData() */;
-}
-
-/* Action Codes */
-
-/**
- * calls exit codes while exiting from the current state to one of its
- * parent states while remembering the history
- * @param current - the current state
- * @param to - the final parent state
- * @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)
- */
-static void exitTo(Sender* self, int current, int to, boolean handler) {
- while (current!=to) {
- switch (current) {
- case STATE_SendingData:
- self->history[STATE_TOP] = STATE_SendingData;
- current = STATE_TOP;
- break;
- case STATE_Done:
- self->history[STATE_TOP] = STATE_Done;
- current = STATE_TOP;
- 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 - the chain ID
- * @param generic_data - the generic data pointer
- * @return the ID of the final state
- */
-static int executeTransitionChain(Sender* self, int chain, InterfaceItemBase* ifitem, void* generic_data) {
- switch (chain) {
- case CHAIN_TRANS_INITIAL_TO__SendingData:
- {
- return STATE_SendingData;
- }
- case CHAIN_TRANS_tr0_FROM_SendingData_TO_Done_BY_receivedDatadataOut:
- {
- return STATE_Done;
- }
- }
- return NO_STATE;
-}
-
-/**
- * calls entry codes while entering a state's history. The ID of the final leaf state is returned
- * @param state - the state which is entered
- * @param handler - entry code is executed if not handler
- * @return - the ID of the final leaf state
- */
-static int enterHistory(Sender* self, int state, boolean handler, boolean skip_entry) {
- while (TRUE) {
- switch (state) {
- case STATE_SendingData:
- if (!(skip_entry || handler)) entry_SendingData(self);
- // in leaf state: return state id
- return STATE_SendingData;
- case STATE_Done:
- // in leaf state: return state id
- return STATE_Done;
- case STATE_TOP:
- state = self->history[STATE_TOP];
- break;
- }
- skip_entry = FALSE;
- }
- //return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true)
-}
-
-static void executeInitTransition(Sender* self) {
- int chain = CHAIN_TRANS_INITIAL_TO__SendingData;
- int next = executeTransitionChain(self, chain, NULL, NULL);
- next = enterHistory(self, next, FALSE, FALSE);
- setState(self, next);
-}
-
-/* receiveEvent contains the main implementation of the FSM */
-static void receiveEvent(Sender* self, InterfaceItemBase *ifitem, int evt, void* generic_data) {
- int trigger = ifitem->localId + EVT_SHIFT*evt;
- int chain = NOT_CAUGHT;
- int catching_state = NO_STATE;
- boolean is_handler = FALSE;
- boolean skip_entry = FALSE;
-
- if (!handleSystemEvent(ifitem, evt, generic_data)) {
- switch (self->state) {
- case STATE_SendingData:
- switch(trigger) {
- case TRIG_dataOut__receivedData:
- {
- chain = CHAIN_TRANS_tr0_FROM_SendingData_TO_Done_BY_receivedDatadataOut;
- catching_state = STATE_TOP;
- }
- break;
- }
- break;
- case STATE_Done:
- break;
- }
- }
- if (chain != NOT_CAUGHT) {
- exitTo(self, self->state, catching_state, is_handler);
- int next = executeTransitionChain(self, chain, ifitem, generic_data);
- next = enterHistory(self, next, is_handler, skip_entry);
- setState(self, next);
- }
-}
-
-//******************************************
-// END of generated code for FSM
-//******************************************
-
-void Sender_init(Sender* self){
- ET_MSC_LOGGER_SYNC_ENTRY("Sender", "init")
- self->state = STATE_TOP;
- {
- int i;
- for (i=0; i<SENDER_HISTORY_SIZE; ++i)
- self->history[i] = NO_STATE;
- }
- executeInitTransition(self);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-void Sender_receiveMessage(void* self, void* ifitem, const etMessage* msg){
- ET_MSC_LOGGER_SYNC_ENTRY("Sender", "_receiveMessage")
-
- receiveEvent(self, (etPort*)ifitem, msg->evtID, (void*)(((char*)msg)+MEM_CEIL(sizeof(etMessage))));
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-/*--------------------- operations ---------------------*/
-
+/** + * @author generated by eTrice + * + * Source File of ActorClass Sender + * + */ + +#include "Sender.h" + +#include "modelbase/etActor.h" +#include "debugging/etLogger.h" +#include "debugging/etMSCLogger.h" +#include "etUnit/etUnit.h" +#include "platform/etMemory.h" + +#include "CommunicationProtocol.h" + + +/* interface item IDs */ +enum interface_items { + IFITEM_dataOut = 1 +}; + + +/* state IDs */ +enum state_ids { + NO_STATE = 0, + STATE_TOP = 1, + STATE_SendingData = 2, + STATE_Done = 3 +}; + +static char* state_names[] = { + "NO_STATE", "TOP", "SendingData", "Done" +}; + +/* transition chains */ +enum chain_ids { + CHAIN_TRANS_INITIAL_TO__SendingData = 1, + CHAIN_TRANS_tr0_FROM_SendingData_TO_Done_BY_receivedDatadataOut = 2 +}; + +/* triggers */ +enum triggers { + POLLING = 0, + TRIG_dataOut__receivedData = IFITEM_dataOut + EVT_SHIFT*CommunicationProtocol_OUT_receivedData +}; + + +static void setState(Sender* self, int new_state) { + etLogger_logInfoF("Sender: setState: new state=%d", new_state); + ET_MSC_LOGGER_CHANGE_STATE("Sender", state_names[new_state]); + self->state = new_state; +} + +/* Entry and Exit Codes */ +static void entry_SendingData(Sender* self) { + CommunicationProtocolConjPort_sendData(&self->constData->dataOut) /* ORIG: dataOut.sendData() */; +} + +/* Action Codes */ + +/** + * calls exit codes while exiting from the current state to one of its + * parent states while remembering the history + * @param current - the current state + * @param to - the final parent state + * @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints) + */ +static void exitTo(Sender* self, int current, int to, boolean handler) { + while (current!=to) { + switch (current) { + case STATE_SendingData: + self->history[STATE_TOP] = STATE_SendingData; + current = STATE_TOP; + break; + case STATE_Done: + self->history[STATE_TOP] = STATE_Done; + current = STATE_TOP; + 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 - the chain ID + * @param generic_data - the generic data pointer + * @return the ID of the final state + */ +static int executeTransitionChain(Sender* self, int chain, InterfaceItemBase* ifitem, void* generic_data) { + switch (chain) { + case CHAIN_TRANS_INITIAL_TO__SendingData: + { + return STATE_SendingData; + } + case CHAIN_TRANS_tr0_FROM_SendingData_TO_Done_BY_receivedDatadataOut: + { + return STATE_Done; + } + } + return NO_STATE; +} + +/** + * calls entry codes while entering a state's history. The ID of the final leaf state is returned + * @param state - the state which is entered + * @param handler - entry code is executed if not handler + * @return - the ID of the final leaf state + */ +static int enterHistory(Sender* self, int state, boolean handler, boolean skip_entry) { + while (TRUE) { + switch (state) { + case STATE_SendingData: + if (!(skip_entry || handler)) entry_SendingData(self); + // in leaf state: return state id + return STATE_SendingData; + case STATE_Done: + // in leaf state: return state id + return STATE_Done; + case STATE_TOP: + state = self->history[STATE_TOP]; + break; + } + skip_entry = FALSE; + } + //return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) +} + +static void executeInitTransition(Sender* self) { + int chain = CHAIN_TRANS_INITIAL_TO__SendingData; + int next = executeTransitionChain(self, chain, NULL, NULL); + next = enterHistory(self, next, FALSE, FALSE); + setState(self, next); +} + +/* receiveEvent contains the main implementation of the FSM */ +static void receiveEvent(Sender* self, InterfaceItemBase *ifitem, int evt, void* generic_data) { + int trigger = ifitem->localId + EVT_SHIFT*evt; + int chain = NOT_CAUGHT; + int catching_state = NO_STATE; + boolean is_handler = FALSE; + boolean skip_entry = FALSE; + + if (!handleSystemEvent(ifitem, evt, generic_data)) { + switch (self->state) { + case STATE_SendingData: + switch(trigger) { + case TRIG_dataOut__receivedData: + { + chain = CHAIN_TRANS_tr0_FROM_SendingData_TO_Done_BY_receivedDatadataOut; + catching_state = STATE_TOP; + } + break; + } + break; + case STATE_Done: + break; + } + } + if (chain != NOT_CAUGHT) { + exitTo(self, self->state, catching_state, is_handler); + int next = executeTransitionChain(self, chain, ifitem, generic_data); + next = enterHistory(self, next, is_handler, skip_entry); + setState(self, next); + } +} + +//****************************************** +// END of generated code for FSM +//****************************************** + +void Sender_init(Sender* self){ + ET_MSC_LOGGER_SYNC_ENTRY("Sender", "init") + self->state = STATE_TOP; + { + int i; + for (i=0; i<SENDER_HISTORY_SIZE; ++i) + self->history[i] = NO_STATE; + } + executeInitTransition(self); + ET_MSC_LOGGER_SYNC_EXIT +} + + +void Sender_receiveMessage(void* self, void* ifitem, const etMessage* msg){ + ET_MSC_LOGGER_SYNC_ENTRY("Sender", "_receiveMessage") + + receiveEvent(self, (etPort*)ifitem, msg->evtID, (void*)(((char*)msg)+MEM_CEIL(sizeof(etMessage)))); + + ET_MSC_LOGGER_SYNC_EXIT +} + + +/*--------------------- operations ---------------------*/ + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Sender.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Sender.h index 50b982497..231c3556c 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Sender.h +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/Sender.h @@ -1,60 +1,60 @@ -/**
- * @author generated by eTrice
- *
- * Header File of ActorClass Sender
- *
- */
-
-#ifndef _SENDER_H_
-#define _SENDER_H_
-
-#include "etDatatypes.h"
-#include "messaging/etMessage.h"
-
-#include "CommunicationProtocol.h"
-
-
-typedef struct Sender Sender;
-
-/* const part of ActorClass (ROM) */
-typedef struct Sender_const {
- /* simple ports */
- const CommunicationProtocolConjPort dataOut;
-
- /* data receive ports */
-
- /* saps */
-
- /* replicated ports */
-
- /* services */
-} Sender_const;
-
-
-/* constant for state machine data */
-#define SENDER_HISTORY_SIZE 2
-
-/* variable part of ActorClass (RAM) */
-struct Sender {
- const Sender_const* const constData;
-
- /* data send ports */
-
- /*--------------------- attributes ---------------------*/
-
-
- /* state machine variables */
- etInt16 state;
- etInt16 history[SENDER_HISTORY_SIZE];
-};
-
-void Sender_init(Sender* self);
-
-void Sender_receiveMessage(void* self, void* ifitem, const etMessage* msg);
-
-
-/*--------------------- operations ---------------------*/
-
-
-#endif /* _SENDER_H_ */
-
+/** + * @author generated by eTrice + * + * Header File of ActorClass Sender + * + */ + +#ifndef _SENDER_H_ +#define _SENDER_H_ + +#include "etDatatypes.h" +#include "messaging/etMessage.h" + +#include "CommunicationProtocol.h" + + +typedef struct Sender Sender; + +/* const part of ActorClass (ROM) */ +typedef struct Sender_const { + /* simple ports */ + const CommunicationProtocolConjPort dataOut; + + /* data receive ports */ + + /* saps */ + + /* replicated ports */ + + /* services */ +} Sender_const; + + +/* constant for state machine data */ +#define SENDER_HISTORY_SIZE 2 + +/* variable part of ActorClass (RAM) */ +struct Sender { + const Sender_const* const constData; + + /* data send ports */ + + /*--------------------- attributes ---------------------*/ + + + /* state machine variables */ + etInt16 state; + etInt16 history[SENDER_HISTORY_SIZE]; +}; + +void Sender_init(Sender* self); + +void Sender_receiveMessage(void* self, void* ifitem, const etMessage* msg); + + +/*--------------------- operations ---------------------*/ + + +#endif /* _SENDER_H_ */ + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/SubSys_Runner.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/SubSys_Runner.c index 12b91ea00..f187882df 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/SubSys_Runner.c +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/cGenRef/SubSys_Runner.c @@ -1,49 +1,49 @@ -/**
- * @author generated by eTrice
- *
- * this class contains the main function running component SubSys
- * it instantiates SubSys and starts and ends the lifecycle
- */
-
-
-#include "Node1.h"
-
-#include "debugging/etLogger.h"
-#include "debugging/etMSCLogger.h"
-#include "platform/etPlatform.h"
-
-
-/**
- * main function
- * creates component and starts and stops the lifecycle
- */
-
-int main(void) {
- etUserEntry(); /* platform specific */
-
- etLogger_logInfo("*** T H E B E G I N ***");
- ET_MSC_LOGGER_OPEN("main");
-
- /* startup sequence of lifecycle */
- Node1_init(); /* lifecycle init */
- Node1_start(); /* lifecycle start */
-
- etUserPreRun(); /* platform specific */
-
- /* run Scheduler */
- Node1_run();
-
- etUserPostRun(); /* platform specific */
-
- /* shutdown sequence of lifecycle */
- Node1_stop(); /* lifecycle stop */
- Node1_destroy(); /* lifecycle destroy */
-
- ET_MSC_LOGGER_CLOSE
- etLogger_logInfo("*** T H E E N D ***");
-
- etUserExit(); /* platform specific */
-
- return 0;
-}
-
+/** + * @author generated by eTrice + * + * this class contains the main function running component SubSys + * it instantiates SubSys and starts and ends the lifecycle + */ + + +#include "Node1.h" + +#include "debugging/etLogger.h" +#include "debugging/etMSCLogger.h" +#include "platform/etPlatform.h" + + +/** + * main function + * creates component and starts and stops the lifecycle + */ + +int main(void) { + etUserEntry(); /* platform specific */ + + etLogger_logInfo("*** T H E B E G I N ***"); + ET_MSC_LOGGER_OPEN("main"); + + /* startup sequence of lifecycle */ + Node1_init(); /* lifecycle init */ + Node1_start(); /* lifecycle start */ + + etUserPreRun(); /* platform specific */ + + /* run Scheduler */ + Node1_run(); + + etUserPostRun(); /* platform specific */ + + /* shutdown sequence of lifecycle */ + Node1_stop(); /* lifecycle stop */ + Node1_destroy(); /* lifecycle destroy */ + + ET_MSC_LOGGER_CLOSE + etLogger_logInfo("*** T H E E N D ***"); + + etUserExit(); /* platform specific */ + + return 0; +} + diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/readme.txt b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/readme.txt index c3b99d458..1dc2b35ab 100644 --- a/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/readme.txt +++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen-ts/readme.txt @@ -1,4 +1,4 @@ -This directory is an eTrice code generation target.
-It will be erased every time the generator is executed.
-
-DO NOT PLACE OTHER FILES HERE!
+This directory is an eTrice code generation target. +It will be erased every time the generator is executed. + +DO NOT PLACE OTHER FILES HERE! |