json_handle.h 956 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef __JSON_HANDLE_H_
  2. #define __JSON_HANDLE_H_
  3. #include "cJSON.h"
  4. #include "stdint.h"
  5. typedef struct
  6. {
  7. char *type; //type list query
  8. uint8_t pro_ch_id;
  9. uint8_t open;
  10. uint8_t close;
  11. float v_max;
  12. float v_min;
  13. float i_max;
  14. float p_max;
  15. float w_max;
  16. }channel_power_request;
  17. typedef struct{
  18. char *type;
  19. uint8_t ph_id;
  20. uint8_t open;
  21. uint8_t close;
  22. float v_max;
  23. float v_min;
  24. float i_max;
  25. float p_max;
  26. float w_max;
  27. }all_power_request;
  28. typedef struct
  29. {
  30. char *type;
  31. uint8_t sensor_id;
  32. float s_max;
  33. float s_min;
  34. }sensor_request;
  35. cJSON* json_to_chn_pwr_status_monitor(const char* str,channel_power_request* _over_chn_pwr_request);
  36. cJSON* json_to_all_pwr_status_monitor(const char* str,all_power_request* _over_all_pwr_request);
  37. cJSON* json_to_sensor_status_monitor(const char* str,sensor_request* _over_sensor_request);
  38. #endif