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