#ifndef __JSON_HANDLE_H_ #define __JSON_HANDLE_H_ #include "cJSON.h" #include "stdint.h" typedef struct { char *type; //type list query uint8_t pro_ch_id; uint8_t open; uint8_t close; float v_max; float v_min; float i_max; float p_max; float w_max; }channel_power_request; typedef struct{ char *type; uint8_t ph_id; uint8_t open; uint8_t close; float v_max; float v_min; float i_max; float p_max; float w_max; }all_power_request; typedef struct { char *type; uint8_t sensor_id; float s_max; float s_min; }sensor_request; cJSON* json_to_chn_pwr_status_monitor(const char* str,channel_power_request* _over_chn_pwr_request); cJSON* json_to_all_pwr_status_monitor(const char* str,all_power_request* _over_all_pwr_request); cJSON* json_to_sensor_status_monitor(const char* str,sensor_request* _over_sensor_request); #endif