-
Notifications
You must be signed in to change notification settings - Fork 7
/
MergNodeIdentification.h
246 lines (209 loc) · 7.39 KB
/
MergNodeIdentification.h
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#ifndef MERGNODEIDENTIFICATION_H
#define MERGNODEIDENTIFICATION_H
#include <Arduino.h>
#define NAME_SIZE 7 /**< Maximum node name size.*/
/**
* Class that saves the node parameters.
* Name, Manufactorer,Module, Can id, Node number, device number, Code Version, Supported events and variables.
* It is set from user information and from EEPROM: can id, node number, device number.
*/
class MergNodeIdentification
{
public:
MergNodeIdentification();
virtual ~MergNodeIdentification();
/** \brief Set the can id for this node.
* \param val The can id.
*/
void setCanID(byte val){canID=val;};
/** \brief Get the can id for this node.
* \return The can id.
*/
byte getCanID(){return canID;};
/** \brief Set the node number for this node.
* \param val The node number.
*/
void setNodeNumber(unsigned int val){nodeNumber=val;};
/** \brief Get the node number for this node.
* \return The node number.
*/
unsigned int getNodeNumber(){return nodeNumber;};
void setNodeName(char const *nodeName,int csize);
const char* getNodeName();
//void setDeviceNumber(unsigned int val){deviceNumber=val;};
//unsigned int getDeviceNumber(){return deviceNumber;};
/** \brief Set the manufacturer ID.
*
* \param val The manufacuter id.
*
*/
void setManufacturerId(byte val){manufacturerId=val;};
/** \brief GSet the manufacturer ID.
*
* \return The manufacuter id.
*
*/
byte getManufacturerId(){return manufacturerId;};
/** \brief Set the module ID.
*
* \param val The module id.
*
*/
void setModuleId(byte val){moduleId=val;};
/** \brief Get the module ID.
*
* \return The module id.
*
*/
byte getModuleId(){return moduleId;};
/** \brief Set the module flags.
*
* \param val The module flags.
*
*/
void setFlags(byte val){flags=val;};
/** \brief Get the module flags.
*
* \param val The module flags.
*
*/
byte getFlags(){return flags;};
/** \brief Set the min Code Version.
*
* \param val The min code version.
*
*/
void setMinCodeVersion(byte val){minCodeVersion=val;};
/** \brief Get the min Code Version.
*
* \return The min code version.
*
*/
byte getMinCodeVersion(){return minCodeVersion;};
/** \brief Set the max Code Version.
*
* \param val The max code version.
*
*/
void setMaxCodeVersion(byte val){maxCodeVersion=val;};
/** \brief Get the max Code Version.
*
* \return The max code version.
*
*/
byte getMaxCodeVersion(){return maxCodeVersion;};
/** \brief Set the number of supported events.
*
* \param val The number of events.
*
*/
void setSuportedEvents(byte val){suportedEvents=val;};
/** \brief Get the number of supported events.
*
* \return The number of events.
*
*/
byte getSuportedEvents(){return suportedEvents;};
/** \brief Set the number of supported events variables.
* \param val The number of events variables.
*/
void setSuportedEventsVariables(byte val){suportedEventsVariables=val;};
/** \brief Get the number of supported events variables.
* \return The number of events variables.
*/
byte getSuportedEventsVariables(){return suportedEventsVariables;};
/** \brief Set the number of supported node variables.
* \param val The number of events variables.
*/
void setSuportedNodeVariables(byte val){suportedNodeVariables=val;};
/** \brief Get the number of supported node variables.
* \return The number of events variables.
*/
byte getSuportedNodeVariables(){return suportedNodeVariables;};
void setTransportType(byte val){transportType=val;};
/** \brief Set the transport type.
*
* \param val The transport type.
* added by phil
*/
byte getTransportType(){return transportType;};
void setCpuType(byte val){cpuType=val;};
/** \brief Set the CPU type.
*
* \param val The CPU type.
* added by phil
*/
byte getCpuType(){return cpuType;};
void setCpuManufacturer(byte val){cpuManufacturer=val;};
/** \brief Set the CPU Manufacturer.
*
* \param val The CPU Manufacturer.
* added by phil
*/
byte getCpuManufacturer(){return cpuManufacturer;};
void setBetaRelease(byte val){betaRelease=val;};
/** \brief Set the Beta Release.
*
* \param val Beta Release.
* added by phil
*/
byte getBetaRelease(){return betaRelease;};
void setCodeLoad(byte val =0){codeLoad =val;};
/** \brief Set the Code Load.
*
* \param val Code Load.
* added by phil params 11 to 14 value 0x00 does not support boot loading
*/
byte getCodeLoad(){return codeLoad;};
void setManufacturerCpuCodeA(byte val){ManufacturerCpuCodeA=val;}; // added by phil actual proccessor param 15
byte getManufacturerCpuCodeA(){return ManufacturerCpuCodeA;};
void setManufacturerCpuCodeB(byte val){ManufacturerCpuCodeB=val;}; // added by phil actual proccessor param 16
byte getManufacturerCpuCodeB(){return ManufacturerCpuCodeB;};
void setManufacturerCpuCodeC(byte val){ManufacturerCpuCodeC=val;}; // added by phil actual proccessor param 17
byte getManufacturerCpuCodeC(){return ManufacturerCpuCodeC;};
void setManufacturerCpuCodeD(byte val){ManufacturerCpuCodeD=val;}; // added by phil actual proccessor param 18
byte getManufacturerCpuCodeD(){return ManufacturerCpuCodeD;};
byte getParameter(byte inx);
/** \brief Get the number of node parameters.
* \return Currently 20 changed by phil
*/
byte getNumberOfParameters(){return 20;};
void setProducerNode(bool val);
bool isProducerNode();
void setConsumerNode(bool val);
bool isConsumerNode();
void setConsumeEvents(bool val); // added by phil
bool isConsumeEvents();
void setLearnMode(bool val); // added by phil
bool isLearnMode();
void setSlimMode();
void setFlimMode();
bool isSlimMode();
bool isFlimMode();
void setSuportBootLoading(bool val);
bool isBootLoading();
protected:
private:
byte canID;
unsigned int nodeNumber;
char nodeName[NAME_SIZE];
//unsigned int deviceNumber;
byte manufacturerId;
byte moduleId;
byte flags;
byte minCodeVersion;
byte maxCodeVersion;
byte suportedEvents;
byte suportedEventsVariables;
byte suportedNodeVariables;
byte transportType;
byte betaRelease;
byte cpuManufacturer;
byte cpuType;
byte codeLoad;
byte ManufacturerCpuCodeA;
byte ManufacturerCpuCodeB;
byte ManufacturerCpuCodeC;
byte ManufacturerCpuCodeD;
};
#endif // MERGNODEIDENTIFICATION_H