Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c')
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c
new file mode 100644
index 000000000..ede596a7b
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c
@@ -0,0 +1,58 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ProtocolClass CommunicationProtocol
+ *
+ */
+
+#include "CommunicationProtocol.h"
+
+#include "etMSCLogger.h"
+
+/*--------------------- port classes */
+
+void CommunicationProtocolPort_receivedData(const CommunicationProtocolPort* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolPort", "receivedData")
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
+ msg->address = self->peerAddress;
+ msg->evtID = CommunicationProtocol_OUT_receivedData;
+ etMessageService_pushMessage(self->msgService, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+
+void CommunicationProtocolConjPort_sendData(const CommunicationProtocolConjPort* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjPort", "sendData")
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
+ msg->address = self->peerAddress;
+ msg->evtID = CommunicationProtocol_IN_sendData;
+ etMessageService_pushMessage(self->msgService, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+void CommunicationProtocolConjPort_sendData2(const CommunicationProtocolConjPort* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjPort", "sendData2")
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
+ msg->address = self->peerAddress;
+ msg->evtID = CommunicationProtocol_IN_sendData2;
+ etMessageService_pushMessage(self->msgService, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+
+/*--------------------- debug helpers */
+
+/* TODO: make this optional or different for smaller footprint */
+/* message names as strings for debugging (generate MSC) */
+static const char* CommunicationProtocol_messageStrings[] = {"MIN", "receivedData","sendData", "sendData2", "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];
+ }
+}

Back to the top