| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #ifndef __SPBRANCH_BRANCH_DEF_H
- #define __SPBRANCH_BRANCH_DEF_H
- #pragma once
- #include "SpHelper.h"
- namespace SpBranch {
- #define TO_STRING(str) \
- (#str)
- #define BUFSIZE 4096
- const int MAX_RETVALUE_LEN = 2048;
- enum CMDType {
- BRCMD_START,
- BRCMD_GETSTATE,
- BRCMD_OPENDEV,
- BRCMD_CLOSEDEV,
- BRCMD_GETERROR,
- BRCMD_SENDCMD,
- BRCMD_GETDEVINFO,
- BRCMD_END
- };
- enum DevThreadState {
- State_NoInit,
- State_Invalid,
- State_LoadFailed,
- State_LoadSucc,
- State_OpenFailed,
- State_Opened,
- State_Idle,
- State_Busy,
- State_Max
- };
- struct SpBranch_Command_Req
- {
- int nCmdType;
- int nparam1;
- int nparam2;
- CSimpleStringA ssparam1;
- CSimpleStringA ssparam2;
- void Serialize(SpBuffer &buf)
- {
- buf & nCmdType & nparam1 & nparam2 & ssparam1 & ssparam2;
- }
- };
- struct SpBranch_Command_Ans
- {
- int nparam1;
- int nparam2;
- CSimpleStringA ssparam1;
- CSimpleStringA ssparam2;
- CSimpleStringA ssparam3;
- CSimpleStringA ssparam4;
- DWORD dwErroCode;
- CSimpleStringA desc;
- void Serialize(SpBuffer &buf)
- {
- buf & nparam1 & nparam2 & ssparam1 & ssparam2 & ssparam3 & ssparam4 & dwErroCode & desc;
- }
- void Init()
- {
- nparam2 = nparam1 = 0;
- ssparam1 = ssparam2 = ssparam3 = ssparam4 = "";
- dwErroCode = 0x7fffffff;
- desc = "No more Information";
- }
- };
- }
- #endif //__SPBRANCH_BRANCH_DEF_H
|