|
|
|
|
|
|
|
|
|
#ifndef __COMM_PORT_H_ICL__
|
|
|
|
|
#define __COMM_PORT_H_ICL__
|
|
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
|
|
#define MSGTYPE_BAOHU_BASE 200
|
|
|
|
|
#define MSGTYPE_BAOHU_103CMD MSGTYPE_BAOHU_BASE+0
|
|
|
|
|
#define MSGTYPE_BAOHU_103DATA MSGTYPE_BAOHU_BASE+1
|
|
|
|
|
#define MSGTYPE_BAOHU_SCADACMD MSGTYPE_BAOHU_BASE+2
|
|
|
|
|
#define MSGTYPE_BAOHU_SCADADATA MSGTYPE_BAOHU_BASE+3
|
|
|
|
|
|
|
|
|
|
// <20><> config.ini <20><> portconfig.ini <20><><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
u_long GetPrivateProString(const char *section, const char *entry, const char *defaultstr, char *result, int len, char *inifile);
|
|
|
|
|
int GetPrivateProInt(const char *section, const char *entry, int idefault, char *inifile);
|
|
|
|
|
u_long GetPrivateProString2(const char *section, const char *entry, const char *defaultstr, char *result, int len, HDSFILE hFile);
|
|
|
|
|
int GetPrivateProInt2(const char *section, const char *entry, int idefault, HDSFILE hFile);
|
|
|
|
|
|
|
|
|
|
int PutDataToBuf( DATA_BUF *buf, u_char *msg, int len );
|
|
|
|
|
int GetDataFormBuf( DATA_BUF *databuf, u_char *buf, int len, int clrflag );
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>豸<EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>оƬ״̬<D7B4>Ͷ<EFBFBD>оƬ<D0BE><C6AC><EFBFBD>ͺ<EFBFBD>Ƶ<EFBFBD><C6B5>
|
|
|
|
|
void ReadPortConfigInfo( u_short );
|
|
|
|
|
void ReadPortConfigInfoEx(u_short);
|
|
|
|
|
|
|
|
|
|
void OpenAllPort( void );
|
|
|
|
|
void CloseOnePort( int commid );
|
|
|
|
|
void CloseAllPort( void );
|
|
|
|
|
void PollAllSerialPort( void );
|
|
|
|
|
void PollAllNetPort( void );
|
|
|
|
|
|
|
|
|
|
int SetPntMsg( int port, int point, void *pntmsg, BYTE type, BYTE attr );
|
|
|
|
|
int GetPntMsg( int port, int point, void *pntmsg, BYTE type, BYTE attr );
|
|
|
|
|
int SetPorvPntMsg( int port, int point, void *pntmsg, BYTE type, BYTE attr );
|
|
|
|
|
int GetPorvPntMsg( int port, int point, void *pntmsg, BYTE type );
|
|
|
|
|
|
|
|
|
|
int CheckPollCmdBufEmpty( int port );
|
|
|
|
|
int PutPollCmdToBuf( int port, int type, WORD wait, char *buf, int len );
|
|
|
|
|
void SendCmdFormPollCmdBuf( int port );
|
|
|
|
|
|
|
|
|
|
// wen 2005.09.08 <20><><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EEBBBA><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
void ClearAllCmdFromPollCmdBuf(int port);
|
|
|
|
|
// wen 2004.10.25 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
|
|
|
|
|
void ClearCmdFormPollCmdBuf( int port );
|
|
|
|
|
void ClearCmdFormPollCmdBufEx( int port, char *file, int line );
|
|
|
|
|
void ClearCmdAllFlag( int port );
|
|
|
|
|
int GetCmdFormPollCmdBuf( int port, u_char *buf, int len );
|
|
|
|
|
int ReGetCmdFormPollCmdBuf( int port, u_char *buf, int len );
|
|
|
|
|
|
|
|
|
|
int GetMaxPort();
|
|
|
|
|
int GetPortProtocolIdx(char *name);
|
|
|
|
|
char *GetPortProtocolName(int Idx);
|
|
|
|
|
|
|
|
|
|
// wen 2004.11.16 <20><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>soe<6F><65><EFBFBD>ݵĴ<DDB5><C4B4><EFBFBD>
|
|
|
|
|
// <20><><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>soe<6F><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int ProvWriteSoeData( int provport, SOE_DEF *ptrSoe );
|
|
|
|
|
int ProvAndDelGetSoeData( int provport, SOE_DEF *ptrSoe );
|
|
|
|
|
int ProvHaveSoeData( int provport );
|
|
|
|
|
|
|
|
|
|
// wen 2005.02.23
|
|
|
|
|
void SendDataToPort(int commid, char *buf, int len);
|
|
|
|
|
|
|
|
|
|
// wen 2005.02.28
|
|
|
|
|
void SendYkYtCommand(int commid, char *buf, int len);
|
|
|
|
|
BOOL SendYkYtCommand2(int commid, YKYT_PARAM *pParam);
|
|
|
|
|
int FindProvPntFromYkYtPnt(int commid, int ykytpnt, SIO_PARAM_BAOHU_DEF *pBaohuParam);
|
|
|
|
|
BOOL ProvPortYkYtIsTimeOut( int commid, PROV_YKYT_DEF *pProvYkYt );
|
|
|
|
|
BOOL IsProvYkYtAck(int commid, PROV_YKYT_DEF *pProvYkYt);
|
|
|
|
|
BOOL ShmGetDispYkYtFlag();
|
|
|
|
|
BOOL ShmGetDispHostLinkFlag();
|
|
|
|
|
|
|
|
|
|
// wen 2005.04.18 <20>ڴ<EFBFBD><DAB4>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
|
|
|
|
void PortMemoryMalloc( int commid, int type, SIO_PARAM_BAOHU_DEF *pBaohuParam );
|
|
|
|
|
void PortMemoryMallocEx( int commid, int type, SIO_PARAM_BAOHU_DEF *pBaohuParam );
|
|
|
|
|
BOOL PortDataPntInit(int commid, int type, SIO_PARAM_BAOHU_DEF *pBaohuParam);
|
|
|
|
|
void PortMemoryFree( int commid, SIO_PARAM_DEF *pGenParam );
|
|
|
|
|
void PortWriteDataFree( int commid );
|
|
|
|
|
|
|
|
|
|
BOOL IsBaoHuPtr( int commid );
|
|
|
|
|
BOOL IsExtInfoPtr( int commid );
|
|
|
|
|
BOOL IsSerialPtr( int commid );
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\brief <EFBFBD><EFBFBD>ȡ<EFBFBD>˿ڴ<EFBFBD>ʶ
|
|
|
|
|
\param commid -- <EFBFBD>˿ں<EFBFBD>
|
|
|
|
|
\param rwflag -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>ʶ
|
|
|
|
|
\<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ retval-- <EFBFBD><EFBFBD><EFBFBD>ض˿ڶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д״̬
|
|
|
|
|
*/
|
|
|
|
|
int ShmGetPortFlag(int commid, int rwflag);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
|
|
|
|
|
/*!
|
|
|
|
|
\brief <EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>ʵ<EFBFBD>ʵ<EFBFBD>װ<EFBFBD><EFBFBD>
|
|
|
|
|
\param commid -- <EFBFBD>˿ں<EFBFBD>
|
|
|
|
|
\param rtumsg -- ת<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|
|
|
|
\note
|
|
|
|
|
ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ʱ<EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>103<EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD>ʽ
|
|
|
|
|
*/
|
|
|
|
|
void SendProtectCmdToDev(int commid, RTUMSG *rtumsg);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\brief <EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><EFBFBD>浽ָ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>˿<EFBFBD>
|
|
|
|
|
\param rtumsg -- ת<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|
|
|
|
\note
|
|
|
|
|
ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ʱ<EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>103<EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD>ʽ
|
|
|
|
|
*/
|
|
|
|
|
void PutBaohuDataToPort(RTUMSG *rtumsg);
|
|
|
|
|
void PutBaohuDataToPortEx(int commid, RTUMSG *rtumsg);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>scadaprotect<EFBFBD><EFBFBD>Լ<EFBFBD>˿<EFBFBD>
|
|
|
|
|
\param rtumsg -- ת<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void SendDataToAllScadaProtectPort(RTUMSG *rtumsg);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\brief <EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD>װ<EFBFBD>õı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>
|
|
|
|
|
\param commid -- <EFBFBD>˿ں<EFBFBD>
|
|
|
|
|
\param iProvAddr -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>ͳһ<EFBFBD><EFBFBD><EFBFBD>ŵĵ<EFBFBD>ַ
|
|
|
|
|
\param ppBaoHuDB -- <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>ָ<EFBFBD><EFBFBD>(PAI,PDI,PFIX...)
|
|
|
|
|
\retval <EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>װ<EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
int GetBaohuDB(int commid, int iProvAddr, GROUPDEF **ppBaoHuDB);
|
|
|
|
|
|
|
|
|
|
int GetSioParam(SIO_PARAM_DEF **ppParam);
|
|
|
|
|
int GetDevParam(DEV_DEF **ppParam);
|
|
|
|
|
int SetCurPort(int PortNo);
|
|
|
|
|
int GetCurPortEx();
|
|
|
|
|
int SetDispFlag(int iFlag);
|
|
|
|
|
|
|
|
|
|
// <20><>ȡȫ<C8A1>ֱ<EFBFBD><D6B1><EFBFBD>
|
|
|
|
|
SIO_PARAM_DEF *GetSioParamPtr();
|
|
|
|
|
#endif
|
|
|
|
|
|