| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #ifndef __WEB_Hx__
- #define __WEB_Hx__
- #include "stdint.h"
- #define CHANEL_WANNING_INFO_TYPE "{"\
- "\"code\":200,"\
- "\"data\":{"\
- "\"chnName\":\"%s\","\
- "\"chnId\":%d,"\
- "\"chnWanVolMax\":%d,"\
- "\"chnWanVolMin\":%d,"\
- "\"chnWanCurMax\":%d,"\
- "\"chnWanPwrMax\":%d,"\
- "\"chnWanKwhMax\":%d,"\
- "\"phOrder\":\"%s\""\
- "},"\
- "\"msg\":\"success\""\
- "}"
- #define CHANNEL_SINGLE_RES_TYPE "{"\
- "\"code\":200,"\
- "\"data\":{"\
- "\"chnName\":\"%s\","\
- "\"chnId\":%d,"\
- "\"chnVoltage\":%.2f,"\
- "\"chnCurrent\":%.2f,"\
- "\"chnPower\":%.2f,"\
- "\"chnApparentPower\":%.2f,"\
- "\"chnPowerFreq\":%.1f,"\
- "\"chnPowerFactor\":%.3f,"\
- "\"chnConsumption\":%.2f,"\
- "\"chnVoltageMax\":%.2f,"\
- "\"chnVoltageMin\":%.2f,"\
- "\"chnCurrentMAX\":%.2f,"\
- "\"chnPowerMAX\":%.2f,"\
- "\"chnConsumptionMAX\":%.2f,"\
- "\"openInterval\":%d,"\
- "\"closeInterval\":%d,"\
- "\"chStatus\":%d,"\
- "\"chnWanVolMax\":%d,"\
- "\"chnWanVolMin\":%d,"\
- "\"chnWanCurMax\":%d,"\
- "\"chnWanPwrMax\":%d,"\
- "\"chnWanKwhMax\":%d,"\
- "\"chPhOrder\":\"%s\""\
- "},"\
- "\"msg\":\"success\""\
- "}"
-
- #define ALL_INFO_RES_TYPE "{"\
- "\"code\":200,"\
- "\"data\":{"\
- "\"phId\":%d,"\
- "\"allVoltage\":%.2f,"\
- "\"allCurrent\":%.2f,"\
- "\"allPower\":%.2f,"\
- "\"allApparentPower\":%.2f,"\
- "\"allPowerFactor\":%.3f,"\
- "\"allConsumption\":%.2f,"\
- "\"phOrder\":\"%s\""\
- "},"\
- "\"msg\":\"success\""\
- "}"
-
- #define SENSOR_INFO_RES_TYPE "{"\
- "\"code\":200,"\
- "\"data\":{"\
- "\"sensorId\":%d,"\
- "\"sensorName\":\"%s\","\
- "\"sensorValue\":%.2f,"\
- "\"sensorThrMax\":%.2f,"\
- "\"sensorThrMin\":%.2f,"\
- "\"sensorWanMax\":%d,"\
- "\"sensorWanMin\":%d,"\
- "\"sensorStatus\":%d"\
- "},"\
- "\"msg\":\"success\""\
- "}"
-
- #define SUCESS_RSP "{\"code\": 200,\"msg\": \"success\"}"
- enum{
- USER_SUCCESS,
- USER_EXIST,
- USER_OVER_TEN,
- };
- enum{
- USER_DELETE_SUCCESS,
- USER_DELETE_NO_EXIT,
- };
- enum{
- USER_UPDATE_SUCCESS,
- USER_UPDATE_PASSERR,
- };
- int web_init(void);
- int web_post(int type, void *data, int len);
- #endif
|