User | Revision | Line number | New contents of line |
masterkookus |
0:af3075c48866
|
1
|
#ifndef MKNETATATREG_H
|
masterkookus |
0:af3075c48866
|
2
|
#define MKNETATATREG_H
|
masterkookus |
0:af3075c48866
|
3
|
|
masterkookus |
0:af3075c48866
|
4
|
#define pollEnabled 0x80000000
|
masterkookus |
0:af3075c48866
|
5
|
#define fmEnabled 0x40000000
|
masterkookus |
0:af3075c48866
|
6
|
#define fmdEnabled 0x20000000
|
masterkookus |
0:af3075c48866
|
7
|
#define serEnabled 0x10000000
|
masterkookus |
2:3f8751bccba3
|
8
|
#define recEnabled 0x08000000
|
masterkookus |
2:3f8751bccba3
|
9
|
//#define reserved 0x04000000
|
masterkookus |
0:af3075c48866
|
10
|
#define cltIsActive 0x02000000
|
masterkookus |
0:af3075c48866
|
11
|
#define cltCloseConnection 0x01000000
|
masterkookus |
2:3f8751bccba3
|
12
|
//#define reserved 0x00800000
|
masterkookus |
2:3f8751bccba3
|
13
|
#define fmOnline 0x00400000
|
masterkookus |
2:3f8751bccba3
|
14
|
#define fmdOnline 0x00200000
|
masterkookus |
0:af3075c48866
|
15
|
#define sendRetry 0x00100000
|
masterkookus |
0:af3075c48866
|
16
|
#define serTimeout 0x00080000
|
masterkookus |
0:af3075c48866
|
17
|
#define fmTimeout 0x00040000
|
masterkookus |
2:3f8751bccba3
|
18
|
//#define reserved 0x00020000
|
masterkookus |
0:af3075c48866
|
19
|
#define serMsgRx 0x00010000
|
masterkookus |
0:af3075c48866
|
20
|
#define serPollReq 0x00008000
|
masterkookus |
0:af3075c48866
|
21
|
#define fmPollReq 0x00004000
|
masterkookus |
0:af3075c48866
|
22
|
#define fmdPollReq 0x00002000
|
masterkookus |
0:af3075c48866
|
23
|
#define fmCfgReq 0x00001000
|
masterkookus |
0:af3075c48866
|
24
|
#define serPollInProg 0x00000800
|
masterkookus |
0:af3075c48866
|
25
|
#define fmPollInProg 0x00000400
|
masterkookus |
0:af3075c48866
|
26
|
#define fmdPollInProg 0x00000200
|
masterkookus |
0:af3075c48866
|
27
|
#define fmCfgInProg 0x00000100
|
masterkookus |
0:af3075c48866
|
28
|
#define serRespRx 0x00000080
|
masterkookus |
0:af3075c48866
|
29
|
#define fmRespRx 0x00000040
|
masterkookus |
0:af3075c48866
|
30
|
#define fmdRespRx 0x00000020
|
masterkookus |
0:af3075c48866
|
31
|
#define recDataFile 0x00000010
|
masterkookus |
0:af3075c48866
|
32
|
#define serCloseConnection 0x00000008
|
masterkookus |
0:af3075c48866
|
33
|
#define fmCloseConnection 0x00000004
|
masterkookus |
0:af3075c48866
|
34
|
#define fmdCloseConnection 0x00000002
|
masterkookus |
0:af3075c48866
|
35
|
#define devOnline 0x00000001
|
masterkookus |
0:af3075c48866
|
36
|
|
masterkookus |
2:3f8751bccba3
|
37
|
#define cltclose 0x031F0FEE
|
masterkookus |
2:3f8751bccba3
|
38
|
#define serclose 0x03100888
|
masterkookus |
2:3f8751bccba3
|
39
|
#define fmclose 0x03100766
|
masterkookus |
0:af3075c48866
|
40
|
|
masterkookus |
0:af3075c48866
|
41
|
class netDevStatus
|
masterkookus |
0:af3075c48866
|
42
|
{
|
masterkookus |
0:af3075c48866
|
43
|
unsigned int statusReg;
|
masterkookus |
0:af3075c48866
|
44
|
|
masterkookus |
0:af3075c48866
|
45
|
unsigned int txMessageCount; //1
|
masterkookus |
0:af3075c48866
|
46
|
unsigned int rxMessageCount; //2
|
masterkookus |
0:af3075c48866
|
47
|
unsigned int fmTimeoutCount; //3
|
masterkookus |
0:af3075c48866
|
48
|
unsigned int serTimeoutCount; //4
|
masterkookus |
0:af3075c48866
|
49
|
unsigned int msgFailCount; //5
|
masterkookus |
0:af3075c48866
|
50
|
|
masterkookus |
0:af3075c48866
|
51
|
char connectFailCount;
|
masterkookus |
0:af3075c48866
|
52
|
char connectSuccessCount;
|
masterkookus |
0:af3075c48866
|
53
|
char connectFailLimit;
|
masterkookus |
0:af3075c48866
|
54
|
|
masterkookus |
0:af3075c48866
|
55
|
char devMsgReq;
|
masterkookus |
0:af3075c48866
|
56
|
char devMsgPos;
|
masterkookus |
0:af3075c48866
|
57
|
|
masterkookus |
0:af3075c48866
|
58
|
public:
|
masterkookus |
0:af3075c48866
|
59
|
|
masterkookus |
0:af3075c48866
|
60
|
netDevStatus(unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,char);
|
masterkookus |
0:af3075c48866
|
61
|
|
masterkookus |
0:af3075c48866
|
62
|
void iedOnline(bool);
|
masterkookus |
0:af3075c48866
|
63
|
|
masterkookus |
0:af3075c48866
|
64
|
unsigned int getStatus(void);
|
masterkookus |
0:af3075c48866
|
65
|
|
masterkookus |
0:af3075c48866
|
66
|
//Get count Value
|
masterkookus |
0:af3075c48866
|
67
|
unsigned int getCount(char);
|
masterkookus |
0:af3075c48866
|
68
|
|
masterkookus |
0:af3075c48866
|
69
|
//Increment count Value
|
masterkookus |
0:af3075c48866
|
70
|
void incCount(char);
|
masterkookus |
0:af3075c48866
|
71
|
|
masterkookus |
0:af3075c48866
|
72
|
//Set count Value
|
masterkookus |
0:af3075c48866
|
73
|
void setCount(char, unsigned int);
|
masterkookus |
0:af3075c48866
|
74
|
|
masterkookus |
0:af3075c48866
|
75
|
void setDevMsgReq(char);
|
masterkookus |
0:af3075c48866
|
76
|
|
masterkookus |
0:af3075c48866
|
77
|
char getDevMsgReq(void);
|
masterkookus |
0:af3075c48866
|
78
|
|
masterkookus |
0:af3075c48866
|
79
|
void setDevMsgPos(char);
|
masterkookus |
0:af3075c48866
|
80
|
|
masterkookus |
0:af3075c48866
|
81
|
char getDevMsgPos(void);
|
masterkookus |
0:af3075c48866
|
82
|
|
masterkookus |
0:af3075c48866
|
83
|
//Return true if bit is set
|
masterkookus |
0:af3075c48866
|
84
|
bool bit_isset(unsigned int);
|
masterkookus |
0:af3075c48866
|
85
|
//Return true if bit is clear
|
masterkookus |
0:af3075c48866
|
86
|
bool bit_isclear(unsigned int);
|
masterkookus |
0:af3075c48866
|
87
|
//Set bit
|
masterkookus |
0:af3075c48866
|
88
|
void bit_toset(unsigned int);
|
masterkookus |
0:af3075c48866
|
89
|
//Clear bit
|
masterkookus |
0:af3075c48866
|
90
|
void bit_toclear(unsigned int);
|
masterkookus |
0:af3075c48866
|
91
|
|
masterkookus |
0:af3075c48866
|
92
|
//Bit set if set, do nothing if not set
|
masterkookus |
0:af3075c48866
|
93
|
void bit_sis(unsigned int,unsigned int);
|
masterkookus |
0:af3075c48866
|
94
|
//Bit clear if set, do nothing if not set
|
masterkookus |
0:af3075c48866
|
95
|
void bit_cis(unsigned int,unsigned int);
|
masterkookus |
0:af3075c48866
|
96
|
//Bit set if set, clear if not set
|
masterkookus |
0:af3075c48866
|
97
|
void bit_sisc(unsigned int,unsigned int);
|
masterkookus |
0:af3075c48866
|
98
|
//Bit clear if set, set if not set
|
masterkookus |
0:af3075c48866
|
99
|
void bit_ciss(unsigned int,unsigned int);
|
masterkookus |
0:af3075c48866
|
100
|
|
masterkookus |
0:af3075c48866
|
101
|
//Bit set if clear, do nothing if set
|
masterkookus |
0:af3075c48866
|
102
|
void bit_sic(unsigned int,unsigned int);
|
masterkookus |
0:af3075c48866
|
103
|
//Bit clear if clear, do nothing if set
|
masterkookus |
0:af3075c48866
|
104
|
void bit_cic(unsigned int,unsigned int);
|
masterkookus |
0:af3075c48866
|
105
|
//Bit set if clear, clear if set
|
masterkookus |
0:af3075c48866
|
106
|
void bit_sicc(unsigned int,unsigned int);
|
masterkookus |
0:af3075c48866
|
107
|
//Bit clear if clear, set if set
|
masterkookus |
0:af3075c48866
|
108
|
void bit_cics(unsigned int,unsigned int);
|
masterkookus |
0:af3075c48866
|
109
|
};
|
masterkookus |
0:af3075c48866
|
110
|
#endif |