You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.4 KiB

2 years ago
2 years ago
2 years ago
2 years ago
  1. #include "errorcode.hpp"
  2. #define ERR2STR(code) \
  3. case code: \
  4. return #code;
  5. namespace iflytop {
  6. namespace err {
  7. const char* error2str(int32_t code) {
  8. switch (code) {
  9. ERR2STR(ksucc);
  10. ERR2STR(kfail);
  11. ERR2STR(ksys_error);
  12. ERR2STR(ksys_create_file_error);
  13. ERR2STR(ksys_create_dir_error);
  14. ERR2STR(ksys_open_file_error);
  15. ERR2STR(ksys_open_dir_error);
  16. ERR2STR(ksys_read_file_error);
  17. ERR2STR(ksys_write_file_error);
  18. ERR2STR(ksys_close_file_error);
  19. ERR2STR(ksys_close_dir_error);
  20. ERR2STR(ksys_delete_file_error);
  21. ERR2STR(ksys_delete_dir_error);
  22. ERR2STR(ksys_copy_file_error);
  23. ERR2STR(kce_device_not_zero);
  24. ERR2STR(kce_over_temperature);
  25. ERR2STR(kce_over_voltage);
  26. ERR2STR(kce_param_out_of_range);
  27. ERR2STR(kce_not_found_zero_point);
  28. ERR2STR(kce_not_found_x_zero_point);
  29. ERR2STR(kce_not_found_y_zero_point);
  30. ERR2STR(kce_x_leave_away_zero_point_fail);
  31. ERR2STR(kce_y_leave_away_zero_point_fail);
  32. ERR2STR(kce_operation_not_support);
  33. ERR2STR(kce_device_is_busy);
  34. ERR2STR(kce_device_is_offline);
  35. ERR2STR(kce_break_by_user);
  36. ERR2STR(kce_overtime);
  37. ERR2STR(kce_noack);
  38. ERR2STR(kce_errorack);
  39. ERR2STR(kce_device_offline);
  40. ERR2STR(kce_parse_json_err);
  41. ERR2STR(kce_subdevice_overtime);
  42. ERR2STR(kdbe_user_not_exist);
  43. ERR2STR(kdbe_catch_exception);
  44. ERR2STR(kharde_unfound);
  45. ERR2STR(kre_catch_exception);
  46. ERR2STR(kinteraction_error_passwd_error);
  47. ERR2STR(kinteraction_error_user_not_exist);
  48. ERR2STR(kce_buffer_not_enough);
  49. ERR2STR(kce_cmd_not_found);
  50. ERR2STR(kce_cmd_param_num_error);
  51. ERR2STR(kce_no_such_module);
  52. ERR2STR(kSMTP2_NoError);
  53. ERR2STR(kSMTP2_InitFail);
  54. ERR2STR(kSMTP2_InvalidCmd);
  55. ERR2STR(kSMTP2_InvalidArg);
  56. ERR2STR(kSMTP2_PressureSensorError);
  57. ERR2STR(kSMTP2_OverPressure);
  58. ERR2STR(kSMTP2_LLDError);
  59. ERR2STR(kSMTP2_DeviceNotInit);
  60. ERR2STR(kSMTP2_TipPopError);
  61. ERR2STR(kSMTP2_PumpOverload);
  62. ERR2STR(kSMTP2_TipDrop);
  63. ERR2STR(kSMTP2_CanBusError);
  64. ERR2STR(kSMTP2_InvalidChecksum);
  65. ERR2STR(kSMTP2_EEPROMError);
  66. ERR2STR(kSMTP2_CmdBufferEmpty);
  67. ERR2STR(kSMTP2_CmdBufferOverflow);
  68. ERR2STR(kSMTP2_TipBlock);
  69. ERR2STR(kSMTP2_AirSuction);
  70. ERR2STR(kSMTP2_Bubble);
  71. ERR2STR(kSMTP2_VolumeError);
  72. ERR2STR(kSMTP2_TipAlreadyLoad);
  73. ERR2STR(kSMTP2_TipLoadFail);
  74. default:
  75. return "known";
  76. break;
  77. }
  78. }
  79. } // namespace err
  80. } // namespace iflytop