提交 | 用户 | age
|
5dd1b7
|
1 |
|
Q |
2 |
|
|
3 |
#ifndef __SLP_H_V10__ |
|
4 |
#define __SLP_H_V10__ |
|
5 |
typedef unsigned char uchar; |
|
6 |
|
|
7 |
enum SLPCmds |
|
8 |
{ |
|
9 |
ST_M = 0x49, |
|
10 |
ST_S = 0x69, |
|
11 |
EDsign = 0x0d, |
|
12 |
}; |
|
13 |
|
|
14 |
typedef struct tagSLPPacket{ |
|
15 |
uchar ST; |
|
16 |
uchar Dst; |
|
17 |
uchar Data; |
|
18 |
uchar BCC; |
|
19 |
// uchar ED; |
|
20 |
}stSLPPacket; |
|
21 |
|
842bb6
|
22 |
//extern uchar bSLPMaster; |
Q |
23 |
//extern uchar nStation; |
|
24 |
//extern uchar SLPinputB; |
|
25 |
//extern uchar SLPoutputB; |
|
26 |
//extern uchar SLPErrSign; |
5dd1b7
|
27 |
|
842bb6
|
28 |
typedef void (*SLPSendPktDef)(char * pBuf, int Len1); |
Q |
29 |
|
|
30 |
|
|
31 |
typedef struct tagSLPDef |
|
32 |
{ |
|
33 |
uchar bSLPMaster; |
|
34 |
uchar nStation; |
|
35 |
uchar SLPinputB; |
|
36 |
uchar SLPoutputB; |
|
37 |
uchar nCurStation; |
|
38 |
uchar inputBuf[5]; |
|
39 |
uchar outputBuf[5]; |
|
40 |
|
|
41 |
uchar SendBuf[8]; |
|
42 |
|
|
43 |
uchar SLPMasterRecved; //主机收到子机回复 |
|
44 |
|
|
45 |
SLPSendPktDef SLPSendPktFunc; |
|
46 |
|
|
47 |
unsigned int SLPSlaveCountOut; |
|
48 |
|
|
49 |
unsigned int SLPLostPkt; // 丢包数量 |
|
50 |
|
|
51 |
uchar SLPOKSign; |
|
52 |
uchar SLPErrSign; |
|
53 |
|
|
54 |
int nCount; |
|
55 |
|
|
56 |
}stSLPDef; |
|
57 |
|
|
58 |
void SLPInit(stSLPDef * pSLP, SLPSendPktDef pFunc1); |
|
59 |
void SLPSetCallBack(stSLPDef * pSLP, SLPSendPktDef pFunc1); |
|
60 |
|
|
61 |
void SLPparsePacket(stSLPDef * pSLP, char * pBuf, uchar len1); |
|
62 |
void SLPMasterSendPacket(stSLPDef * pSLP); |
|
63 |
void SLPProcess(stSLPDef * pSLP); |
|
64 |
|
5dd1b7
|
65 |
|
Q |
66 |
#endif /* __SLP_H_V10__ */ |