| | |
| | | //设备管理 |
| | | struct DevicesInfo |
| | | { |
| | | int deviceID; |
| | | char deviceName[32];//设备名称 |
| | | char deviceStatus[32];//设备状态 |
| | | char area[32]; // 地区 |
| | | double longitude;//经度 |
| | | double latitude;//纬度 |
| | | char purchasingTime[15];//购买时间 |
| | | char installTime[15];//安装时间 |
| | | char manufacturer[100];//厂家 |
| | | char devicesSerialNumber[32];//设备编码 |
| | | char devicesType[32];//设备类型 |
| | | double longitude;//经度 |
| | | double latitude;//纬度 |
| | | char purchasingTime[15];//购买时间 |
| | | char installTime[15];//安装时间 |
| | | char devicesSerialNumber[32];//设备编码 |
| | | }; |
| | | //添加设备 |
| | | struct ADReq//添加请求 |
| | | { |
| | | Head head; |
| | | char deviceName[32]; |
| | | DevicesInfo devInfo[0]; |
| | | ADReq() { |
| | | head.type = AD_REQ; |
| | | head.len = sizeof(ADReq); |
| | |
| | | struct ADRes//添加响应 |
| | | { |
| | | Head head; |
| | | int type; |
| | | int status; |
| | | ADRes() { |
| | | head.type = AD_RES; |
| | | head.len = sizeof(ADRes); |
| | |
| | | |
| | | }; |
| | | //修改设备 |
| | | struct MDRes//修改请求 |
| | | struct MDReq//修改请求 |
| | | { |
| | | Head head; |
| | | DevicesInfo info; |
| | | MDRes() { |
| | | head.type = MD_RES; |
| | | head.len = sizeof(MDRes); |
| | | } |
| | | }; |
| | | struct MDReq//修改响应 |
| | | { |
| | | Head head; |
| | | int type; |
| | | |
| | | MDReq() { |
| | | head.type = MD_REQ; |
| | | head.len = sizeof(MDReq); |
| | | } |
| | | }; |
| | | struct MDRes//修改响应 |
| | | { |
| | | Head head; |
| | | DevicesInfo info; |
| | | int status; |
| | | MDRes() { |
| | | head.type = MD_RES; |
| | | head.len = sizeof(MDRes); |
| | | } |
| | | }; |
| | | //查询设备 |
| | |
| | | struct QDRes//查询响应 |
| | | { |
| | | Head head; |
| | | int type; |
| | | int status; |
| | | QDRes() { |
| | | head.type = QD_RES; |
| | | head.len = sizeof(QDRes); |
| | |
| | | //环境数据响应 |
| | | struct Environment |
| | | { |
| | | double longitude;//经度 |
| | | double latitude;//纬度 |
| | | float temp;//温度 |
| | | float humidity;//湿度 |
| | | float oxygen;//氧气浓度 |
| | |
| | | //设备状态响应 |
| | | struct DeviceStatus |
| | | { |
| | | double longitude;//经度 |
| | | double latitude;//纬度 |
| | | int deviceID;//设备编号 |
| | | char deviceName[32];//设备名称 |
| | | char deviceStatus[32];//设备状态 |
| | |
| | | //操作日志响应 |
| | | struct MovementRecord |
| | | { |
| | | double longitude;//经度 |
| | | double latitude;//纬度 |
| | | char userName;//操作用户名 |
| | | char operateTime[32];//操作时间 |
| | | char deviceName[32];//操作设备 |
| | |
| | | //警报记录响应 |
| | | struct AlarmRecord |
| | | { |
| | | double longitude;//经度 |
| | | double latitude;//纬度 |
| | | char alarmTime[32];//警报时间 |
| | | char alarmtype[32];//通知时间 |
| | | char alarmtype[32];//处理时间 |
| | | char alarmContent[256];//警报内容 |
| | | }; |
| | | struct AlarmRecordRes |