EProtocol_API.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _EPROTOCOL_API_H_
  2. #define _EPROTOCOL_API_H_
  3. #ifdef EPROTOCOLW_EXPORTS
  4. #define EPROTOCOL_API extern "C" __declspec(dllexport)
  5. #else
  6. #define EPROTOCOL_API extern "C" __declspec(dllimport)
  7. #endif
  8. #define INVALID_INT_VALUE 0xFFFFFFFF
  9. #include <string>
  10. using namespace std;
  11. //------------------------------------------------------------
  12. //Interface
  13. //Command Header
  14. typedef struct CommandHeader
  15. {
  16. int nProcessIndex;
  17. wchar_t chDeviceType;
  18. int nDeviceIndex;
  19. wchar_t chCommandType;
  20. int nCommandCount;
  21. }
  22. CommandHeader;
  23. //A Specific Command
  24. typedef struct Command
  25. {
  26. int nFrameID;
  27. wchar_t chUseage;
  28. wstring strFunction;
  29. wchar_t chDataType;
  30. wstring strData;
  31. }
  32. Command;
  33. //------------------------------------------------------------
  34. EPROTOCOL_API bool GetCommandHeader( const wchar_t* strCommand, CommandHeader* pHeader );
  35. EPROTOCOL_API int GetCommandCount( const wchar_t* strCommand );
  36. //Index from 1 on.
  37. EPROTOCOL_API bool GetCommandByIndex( const wchar_t* strCommand, int index, Command* pCommand );
  38. #endif //_EPROTOCOL_API_H_