Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c90a0ce1601962109c20b2e99b237bbd2cf843d7 (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
#ifndef _CommunicationProtocol_H_
#define _CommunicationProtocol_H_

#include "datatypes.h"



#include "CommunicationProtocol.h"

typedef struct {


} CommunicationProtocol;

/* message IDs */
enum {
	MSG_CommunicationProtocol_MIN = 0, 
	/* IDs for outgoing messages */
	OUT_CommunicationProtocol_receivedData = 1,
	/* IDs for incoming messages */
	IN_CommunicationProtocol_sendData = 2,
	IN_CommunicationProtocol_sendData2 = 3,
	/* error if msgID >= MSG_MAX */
	MSG_CommunicationProtocol_MAX = 4
};


/* message names as strings for debugging (generate MSC) */
/* TODO: make this optional or different for smaller footprint */
static char CommunicationProtocol_messageStrings[][] = {"MIN", "receivedData","sendData", "sendData2", "MAX"};

char* CommunicationProtocol_getMessageString(int msg_id) {
	if (msg_id<MSG_CommunicationProtocol_MIN || msg_id>MSG_CommunicationProtocol_MAX+1){
		/* id out of range */
		return "Message ID out of range";
	}
	else{
		return CommunicationProtocol_messageStrings[msg_id];
	}
}




#endif /* _CommunicationProtocol_H_ */

Back to the top