Skip to content

Commit

Permalink
fix(plc4go/cbus): fix wrong query string
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Apr 14, 2023
1 parent 51d75e2 commit 34cf92f
Show file tree
Hide file tree
Showing 2 changed files with 405 additions and 9 deletions.
18 changes: 9 additions & 9 deletions plc4go/internal/cbus/Query.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (u unitInfoQuery) GetQueryString() string {
}
attributeString := "*"
if u.attribute != nil {
unitAddressString = u.attribute.String()
attributeString = u.attribute.String()
}
return fmt.Sprintf("cal/%s/identify=%s", unitAddressString, attributeString)
}
Expand All @@ -72,15 +72,15 @@ func (u unitInfoQuery) GetValueType() values.PlcValueType {
}

func (u unitInfoQuery) GetArrayInfo() []apiModel.ArrayInfo {
if u.numElements != 1 {
return []apiModel.ArrayInfo{
spiModel.DefaultArrayInfo{
LowerBound: 0,
UpperBound: uint32(u.numElements),
},
}
if u.numElements == 1 {
return []apiModel.ArrayInfo{}
}
return []apiModel.ArrayInfo{
spiModel.DefaultArrayInfo{
LowerBound: 0,
UpperBound: uint32(u.numElements),
},
}
return []apiModel.ArrayInfo{}
}

func (u unitInfoQuery) GetTagType() TagType {
Expand Down
Loading

0 comments on commit 34cf92f

Please sign in to comment.