修改:1、mqttEmqx上报服务中Username字段改成UserName适配web页面 2、软件版本改成V0.3.1
This commit is contained in:
parent
b93113a381
commit
b82cb09966
|
@ -27,7 +27,7 @@ func MQTTEmqxGWLogin(param ReportServiceGWParamEmqxTemplate, publishHandler MQTT
|
|||
opts := MQTT.NewClientOptions().AddBroker(param.IP + ":" + param.Port)
|
||||
|
||||
opts.SetClientID(param.Param.ClientID)
|
||||
opts.SetUsername(param.Param.Username)
|
||||
opts.SetUsername(param.Param.UserName)
|
||||
//hs256 := sha256.New()
|
||||
//hs256.Write([]byte("zhsHrx123456@"))
|
||||
//password := hs256.Sum(nil)
|
||||
|
|
|
@ -40,7 +40,7 @@ type ReportServiceGWParamEmqxTemplate struct {
|
|||
ReportErrCnt int
|
||||
Protocol string
|
||||
Param struct {
|
||||
Username string
|
||||
UserName string
|
||||
Password string
|
||||
ClientID string
|
||||
}
|
||||
|
|
|
@ -44,14 +44,16 @@ func MQTTHuaweiGWPropertyPost(client MQTT.Client, gw MQTTHuaweiRegisterTemplate,
|
|||
|
||||
propertyPostTopic := "$oc/devices/" + gw.DeviceID + "/sys/properties/report"
|
||||
|
||||
setting.Logger.Infof("gw property post topic: %s", propertyPostTopic)
|
||||
setting.Logger.Debugf("gw property post msg: %v", sJson)
|
||||
setting.Logger.Infof("huawei gw property post topic: %s", propertyPostTopic)
|
||||
setting.Logger.Debugf("huawei gw property post msg: %v", sJson)
|
||||
if client != nil {
|
||||
token := client.Publish(propertyPostTopic, 1, false, sJson)
|
||||
if token.WaitTimeout(2*time.Second) == true {
|
||||
MsgID = 0
|
||||
setting.Logger.Debugf("huawei gw property post msg sucess")
|
||||
} else {
|
||||
MsgID = 1
|
||||
setting.Logger.Debugf("huawei gw property post msg fail")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ var SystemState = SystemStateTemplate{
|
|||
Name: "openGW",
|
||||
SN: "22005260001",
|
||||
HardVer: "openGW-V.A",
|
||||
SoftVer: "V0.2.0",
|
||||
SoftVer: "V0.3.1",
|
||||
SystemRTC: "2020-05-26 12:00:00",
|
||||
RunTime: "0",
|
||||
DeviceOnline: "0",
|
||||
|
|
Loading…
Reference in New Issue