package protocol // 网关配置 type MqttConfig struct { Server string `json:"server"` User string `json:"user"` Password string `json:"password"` Timeout uint `json:"timeout"` } type RedisConfig struct { Server string `json:"server"` Password string `json:"password"` } type EdgeConfig struct { Mqtt MqttConfig `json:"mqtt"` Redis RedisConfig `json:"redis"` } type CloudConfig struct { Mqtt MqttConfig `json:"mqtt"` } type AppConfig struct { Name string `json:"name"` //应用名称 Tenant string `json:"tenant"` //租户ID GID string `json:"gid"` //网关ID SN string `json:"sn"` //序列号 Upgrade bool `json:"upgrade"` //需要升级 Edge EdgeConfig `json:"edge"` //边缘端配置 Cloud CloudConfig `json:"cloud"` //云端配置 } // -------------------------------------------------------- // 串口配置 type SerialConfig struct { Serial map[uint8]*SerialPort `json:"serial"` } type SerialPort struct { Code uint8 `json:"code"` //key串口编号,上层应用使用,网关下唯一 Interface string `json:"interface"` //串口物理位置,方便维修 Address string `json:"address"` //串口地址 BaudRate int `json:"baudrate"` DataBits uint8 `json:"databits"` StopBits uint `json:"stopbits"` Parity string `json:"parity"` Timeout uint `json:"timeout"` //毫秒 ProtocolType uint8 `json:"protocoltype"` //0:modbus-rtu;1:长和单灯集控zigbee } // 设备配置 type DevInfo struct { Code uint8 `json:"code"` //串口编号,上层应用使用,网关下唯一 DevID uint8 `json:"devid"` //从设备地址,配置时设定,串口下唯一 DevCode string `json:"devcode"` //设备编码,应用层使用 TID uint16 `json:"tid"` //模型ID Name string `json:"name"` //从设备名称 SendCloud int `json:"sendcloud"` //毫秒 WaitTime uint `json:"waittime"` //发送后等待多久 ProtocolType uint8 `json:"protocoltype"` //0:modbus-rtu;1:长和单灯集控zigbee;2:裕明485单灯控制器协议 DevType uint8 `json:"devtype"` //设备类型,1-灯控类设备 2-环境监测类设备 3-裕明485单灯控制器 4-液位计 5-路面状况传感器 Height float64 `json:"height"` //离地高度,液位计适用 } type MapDevConfig struct { Rtu []DevInfo `json:"dev"` } // 摄象机和一键报警(带摄象机功能)的配置 type OnvifDev struct { Code string `json:"code"` SN string `json:"sn"` IP string `json:"ip"` Name string `json:"name"` Brand string `json:"brand"` Model string `json:"model"` DevType int `json:"devtype"` //3摄象机,4一键报警(带视频) User string `json:"user"` Password string `json:"password"` RtmpServer string `json:"rtmpserver"` WebServer string `json:"webserver"` Event string `json:"event"` Gb28181 bool `json:"gb28181"` //国标28181 } // 抓拍单元配置 type ITSDev struct { Code string `json:"code"` ID string `json:"id"` TollgateID string `json:"tollgateid"` Name string `json:"name"` Brand string `json:"brand"` Model string `json:"model"` DevType int `json:"devtype"` //5 抓拍单元 User string `json:"user"` Password string `json:"password"` IP string `json:"ip"` Port uint16 `json:"port"` } type ITSDevConfig struct { IPAddr string `json:"ipaddr"` SuggestSpeed uint8 `json:"suggestspeed"` Duration int `json:"duration"` EnvID string `json:"envid"` DefProvince string `json:"defprovince"` DefCity string `json:"defcity"` RemotePub uint8 `json:"remotepub"` RemoteSub string `json:"remotesub"` Its []ITSDev `json:"dev"` }