From 9aed5d7e7b3c7bf09da712e9c272ece401a7acc9 Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期一, 25 十一月 2024 14:51:23 +0800 Subject: [PATCH] add UltraSonic and MultiWireLess --- ComLib/Inc/KLink.h | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ComLib/Inc/KLink.h b/ComLib/Inc/KLink.h index 3810d88..36f63c6 100644 --- a/ComLib/Inc/KLink.h +++ b/ComLib/Inc/KLink.h @@ -31,7 +31,7 @@ enum {KLSignStart='%', //0x25 KLSignReply='U', //0x55 KLSignEnd=0x0D, - KLMaxPacketLength=128, + KLMaxPacketLength=256, }; enum enKLCMDs { @@ -64,7 +64,11 @@ KLCmdStartPLCProgram, KLCmdWritePLCProgram, KLCmdFinishPLCProgram, - + KLCmdReadPLCAnno, + KLCmdStartPLCAnno, + KLCmdWritePLCAnno, + KLCmdFinishPLCAnno, + KLCmdRead1Bit = 0x21, //ReadSingleBit KLCmdWrite1Bit = 0x22, //WriteSingleBit KLCmdReadBits = 0x23, //ReadBits n = 1 - 8 @@ -118,6 +122,11 @@ KLCmdWriteFirmware, KLCmdWriteFirmInfo, + KLCmdGetPortInfo, + KLCmdGetPortChnInfo, + KLCmdGetPortChildInfo, + KLCmdPortRemoteReq, + KLCmdErrRply=0xEE, //ERRORReply }; @@ -129,7 +138,7 @@ KLInfoTypeEventLogCount = 3, }; -extern unsigned char KLPacketBuf1[256]; +//extern unsigned char KLPacketBuf1[256]; extern unsigned char KLPacketBuf2[256]; extern unsigned char KLBufferIn[16]; @@ -141,6 +150,11 @@ extern int KLThisuS; extern int KLRecvTimeuS; +//PendReq 鐘舵�� + //0, 娌℃湁 + //1, 鎵ц涓� + //2, 鎴愬姛瀹屾垚 + //3, 澶辫触 #pragma anon_unions typedef union tagKLStatDef { @@ -149,6 +163,7 @@ UCHAR nSEQ : 4; UCHAR HasExt : 1; UCHAR HasErr : 1; + UCHAR PendReqStat : 2; }; }unKLStat, *pKLStat; /* @@ -224,6 +239,8 @@ }stKLPacket,* pKLPacket; */ +int KLinkInit(int ); + unsigned char KLBCC(const void * pData, int nSize); // -- Gitblit v1.9.1