Skip to content

Commit

Permalink
Merge pull request #242 from gopcua/variant-arrays
Browse files Browse the repository at this point in the history
Add support for arrays in variants
  • Loading branch information
magiconair authored Jul 24, 2019
2 parents 569363a + cf89f3f commit ac572a5
Show file tree
Hide file tree
Showing 10 changed files with 627 additions and 221 deletions.
2 changes: 1 addition & 1 deletion examples/accesslevel/accesslevel.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ func main() {
case v == nil:
log.Print("v == nil")
default:
log.Print(v.Value)
log.Print(v.Value())
}
}
4 changes: 2 additions & 2 deletions examples/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func main() {
log.Fatal(err)
}
if v != nil {
fmt.Printf("Server's Time | Conn 1 %s | ", v.Value)
fmt.Printf("Server's Time | Conn 1 %s | ", v.Value())
} else {
log.Print("v == nil")
}
Expand Down Expand Up @@ -101,7 +101,7 @@ func main() {
log.Fatal(err)
}
if v != nil {
fmt.Printf("Conn 2: %s\n", v.Value)
fmt.Printf("Conn 2: %s\n", v.Value())
} else {
log.Print("v == nil")
}
Expand Down
2 changes: 1 addition & 1 deletion examples/datetime/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ func main() {
case v == nil:
log.Print("v == nil")
default:
log.Print(v.Value)
log.Print(v.Value())
}
}
2 changes: 1 addition & 1 deletion examples/history-read/history-read.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func main() {
"%s - %s - %v \n",
nodes[nodeNum].NodeID.String(),
value.SourceTimestamp.Format(time.RFC3339),
value.Value.Value,
value.Value.Value(),
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/read/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ func main() {
if resp.Results[0].Status != ua.StatusOK {
log.Fatalf("Status not OK: %v", resp.Results[0].Status)
}
log.Print(resp.Results[0].Value.Value)
log.Print(resp.Results[0].Value.Value())
}
2 changes: 1 addition & 1 deletion examples/subscribe/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func main() {
switch x := res.Value.(type) {
case *ua.DataChangeNotification:
for _, item := range x.MonitoredItems {
data := item.Value.Value.Value
data := item.Value.Value.Value()
log.Printf("MonitoredItem with client handle %v = %v", item.ClientHandle, data)
}

Expand Down
2 changes: 1 addition & 1 deletion examples/udt/udt.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func main() {
case v == nil:
log.Print("v == nil")
default:
log.Printf("val: %#v", v.Value.(*ua.ExtensionObject).Value)
log.Printf("val: %#v", v.Value().(*ua.ExtensionObject).Value)
}
}

Expand Down
8 changes: 4 additions & 4 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (n *Node) BrowseName() (*ua.QualifiedName, error) {
if err != nil {
return nil, err
}
return v.Value.(*ua.QualifiedName), nil
return v.Value().(*ua.QualifiedName), nil
}

// DisplayName returns the display name of the node.
Expand All @@ -50,7 +50,7 @@ func (n *Node) DisplayName() (*ua.LocalizedText, error) {
if err != nil {
return nil, err
}
return v.Value.(*ua.LocalizedText), nil
return v.Value().(*ua.LocalizedText), nil
}

// AccessLevel returns the access level of the node.
Expand All @@ -61,7 +61,7 @@ func (n *Node) AccessLevel() (ua.AccessLevelType, error) {
if err != nil {
return 0, err
}
return ua.AccessLevelType(v.Value.(uint8)), nil
return ua.AccessLevelType(v.Value().(uint8)), nil
}

// HasAccessLevel returns true if all bits from mask are
Expand All @@ -80,7 +80,7 @@ func (n *Node) UserAccessLevel() (ua.AccessLevelType, error) {
if err != nil {
return 0, err
}
return ua.AccessLevelType(v.Value.(uint8)), nil
return ua.AccessLevelType(v.Value().(uint8)), nil
}

// HasUserAccessLevel returns true if all bits from mask are
Expand Down
Loading

0 comments on commit ac572a5

Please sign in to comment.