#ifndef __SLP_H_V10__
|
#define __SLP_H_V10__
|
typedef unsigned char uchar;
|
|
enum SLPCmds
|
{
|
ST_M = 0x49,
|
ST_S = 0x69,
|
EDsign = 0x0d,
|
};
|
|
typedef struct tagSLPPacket{
|
uchar ST;
|
uchar Dst;
|
uchar Data;
|
uchar BCC;
|
// uchar ED;
|
}stSLPPacket;
|
|
//extern uchar bSLPMaster;
|
//extern uchar nStation;
|
//extern uchar SLPinputB;
|
//extern uchar SLPoutputB;
|
//extern uchar SLPErrSign;
|
|
typedef void (*SLPSendPktDef)(unsigned char * pBuf, int Len1);
|
|
|
typedef struct tagSLPDef
|
{
|
uchar bSLPMaster;
|
uchar nStation;
|
uchar SLPinputB;
|
uchar SLPoutputB;
|
uchar nCurStation;
|
uchar inputBuf[5];
|
uchar outputBuf[5];
|
|
uchar SendBuf[8];
|
|
uchar SLPMasterRecved; //Ö÷»úÊÕµ½×Ó»ú»Ø¸´
|
|
SLPSendPktDef SLPSendPktFunc;
|
|
unsigned int SLPSlaveCountOut;
|
|
unsigned int SLPLostPkt; // ¶ª°üÊýÁ¿
|
|
uchar SLPOKSign;
|
uchar SLPErrSign;
|
|
int nCount;
|
|
}stSLPDef;
|
|
void SLPInit(stSLPDef * pSLP, SLPSendPktDef pFunc1);
|
void SLPSetCallBack(stSLPDef * pSLP, SLPSendPktDef pFunc1);
|
|
void SLPparsePacket(stSLPDef * pSLP, unsigned char * pBuf, uchar len1);
|
void SLPMasterSendPacket(stSLPDef * pSLP);
|
void SLPProcess(stSLPDef * pSLP);
|
|
|
#endif /* __SLP_H_V10__ */
|