Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 8dc2b76bfc23a3b5216a991446f6052ff805c37b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
 * @author generated by eTrice
 *
 * Source File of ProtocolClass CommunicationProtocol
 * 
 */

#include "CommunicationProtocol.h"

#include "etMSCLogger.h"

/*--------------------- port classes */

void CommunicationProtocolPort_outMessage1(const CommunicationProtocolPort* self){
	ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolPort", "outMessage1")
	etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
	msg->address = self->peerAddress;
	msg->evtID = CommunicationProtocol_OUT_outMessage1;
	etMessageService_pushMessage(self->msgService, msg);
	ET_MSC_LOGGER_SYNC_EXIT
}
void CommunicationProtocolPort_outMessage2(const CommunicationProtocolPort* self){
	ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolPort", "outMessage2")
	etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
	msg->address = self->peerAddress;
	msg->evtID = CommunicationProtocol_OUT_outMessage2;
	etMessageService_pushMessage(self->msgService, msg);
	ET_MSC_LOGGER_SYNC_EXIT
}
void CommunicationProtocolPort_outMessage123456789(const CommunicationProtocolPort* self){
	ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolPort", "outMessage123456789")
	etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
	msg->address = self->peerAddress;
	msg->evtID = CommunicationProtocol_OUT_outMessage123456789;
	etMessageService_pushMessage(self->msgService, msg);
	ET_MSC_LOGGER_SYNC_EXIT
}



void CommunicationProtocolConjPort_inMessage1(const CommunicationProtocolConjPort* self){
	ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjPort", "inMessage1")
	etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
	msg->address = self->peerAddress;
	msg->evtID = CommunicationProtocol_IN_inMessage1;
	etMessageService_pushMessage(self->msgService, msg);
	ET_MSC_LOGGER_SYNC_EXIT
}
void CommunicationProtocolConjPort_inMessage2(const CommunicationProtocolConjPort* self){
	ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjPort", "inMessage2")
	etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
	msg->address = self->peerAddress;
	msg->evtID = CommunicationProtocol_IN_inMessage2;
	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", "outMessage1","outMessage2","outMessage123456789","inMessage1", "inMessage2", "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