Skip to content

启动后没有正确解析deviceProfile.json #65

@dafanshu

Description

@dafanshu
  • 版本
    kubeedge: 1.8.2
    mapper-go: 分支release-1.8

  • 问题描述:
    启动后没有将modbus协议的点位解析出来,导致后面设置desire的代码永远都不会执行
    `

mappers-go\mappers\modbus\configmap\parse.go

for j = 0; j < len(deviceProfile.Protocols); j++ {
if instance.ProtocolName == deviceProfile.Protocols[j].Name {
instance.PProtocol = deviceProfile.Protocols[j]
break
}
}
if j == len(deviceProfile.Protocols) {
err = errors.New("Protocol not found")
return err
}

if instance.PProtocol.Protocol != "modbus" {
continue
}
`
instance.ProtocolName 这里的 ProtocolName 其实在deviceProfile.json中并不存在
在云端发布设备实例之后,在congfigmap中的deviceProfile.json里面,只有一个叫Protocol的字段来标识协议名称

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions