scpi_base.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef SCPI_BASE_H
  2. #define SCPI_BASE_H
  3. // ==============================================================================================
  4. // @eScpiStatus_t
  5. // Parser-functions returns statuses:
  6. typedef enum
  7. {
  8. eScpiStatus__min = -2147483648, // don't care, just makes the enum to take 4 bytes
  9. // ------------------------------------------------------------------------------------------
  10. // Error statuses:
  11. eScpiStatus_invalid = -2, // Invalid argument value, check the input parameters and repeat
  12. eScpiStatus_failed = -1, // Operation failed due to some run-time error
  13. // Success status:
  14. eScpiStatus_success = 0, // Operation succeeded
  15. // Warning status:
  16. eScpiStatus_need_data = 1, // Operation is in progress, need more data to continue
  17. // ------------------------------------------------------------------------------------------
  18. eScpiStatus__max = 2147483647 // don't care, just makes the enum to take 4 bytes
  19. }
  20. eScpiStatus_t;
  21. // ==============================================================================================
  22. typedef struct
  23. {
  24. const char * shead; // token beginning
  25. const char * stail; // token ending
  26. }
  27. sStrToken_t;
  28. // ==============================================================================================
  29. typedef const char * xArgument_t; // NULL-terminated string, command argument string
  30. // ==============================================================================================
  31. // ==============================================================================================
  32. #define SCPI_VERSION_YEAR 1999 // SCPI Version 1999.0
  33. #define SCPI_VERSION_REVISION 0 // SCPI Version 1999.0
  34. // SCPI Maximum input command string length
  35. #define SCPI_MAX_INPUT_COMMAND 384
  36. // SCPI Error log capacity in bytes (including service overhead)
  37. #define SCPI_ERRORLOG_CAPACITY 384
  38. // SCPI Error description length (maximum)
  39. #define SCPI_ERRORMSG_MAX 128
  40. // SCPI Command Arguments limit for all the commands
  41. #define SCPI_MAX_ARGS 5
  42. // General purpose command buffer
  43. #define SCPI_MAX_CMD_TEMP_BUFFER 128
  44. // SCPI Array Arguments Buffer
  45. #define SCPI_MAX_ARRAY_ARG_BUFFER 50
  46. // Maximum recursive call depth during command processing
  47. // If no optional subsystems is used, set the value to 1.
  48. #define SCPI_MAX_CMD_SEARCH_DEPTH 5
  49. // @SCPI_MAX_NUMBER_LENGTH
  50. // Maximum supporting length of SCPI Numbers
  51. // See @processNumericArgument for details
  52. #define SCPI_MAX_NUMBER_LENGTH 64
  53. #endif