EProtocolA_API.h 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _EPROTOCOL_H_
  2. #define _EPROTOCOL_H_
  3. #ifdef EPROTOCOL_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. char chDeviceType;
  17. char chCommandType;
  18. int nCommandCount;
  19. }
  20. CommandHeader;
  21. //A Specific Command
  22. typedef struct Command
  23. {
  24. int nFrameID;
  25. char chUseage;
  26. string strFunction;
  27. char chDataType;
  28. string strData;
  29. }
  30. Command;
  31. //------------------------------------------------------------
  32. EPROTOCOL_API bool GetCommandHeader( const char* strCommand, CommandHeader* pHeader );
  33. EPROTOCOL_API int GetCommandCount( const char* strCommand );
  34. //Index from 1 on.
  35. EPROTOCOL_API bool GetCommandByIndex( const char* strCommand, int index, Command* pCommand );
  36. #endif //_EPROTOCOL_H_