Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ParseNodeIDs to use ExpandedNodeID instead of NodeID #14

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions plugin/opcua.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,17 @@ var OPCUAConfigSpec = service.NewConfigSpec().
Field(service.NewBoolField("insecure").Description("Set to true to bypass secure connections, useful in case of SSL or certificate issues. Default is secure (false).").Default(false)).
Field(service.NewBoolField("subscribeEnabled").Description("Set to true to subscribe to OPC-UA nodes instead of fetching them every seconds. Default is pulling messages every second (false).").Default(false))

func ParseNodeIDs(incomingNodes []string) []*ua.NodeID {
func ParseNodeIDs(incomingNodes []string) []*ua.ExpandedNodeID {

// Parse all nodeIDs to validate them.
// loop through all nodeIDs, parse them and put them into a slice
parsedNodeIDs := make([]*ua.NodeID, len(incomingNodes))
parsedNodeIDs := make([]*ua.ExpandedNodeID, len(incomingNodes))
// Get NamespaceArray from the server
// How do i do this?
namespaceArray := []string{"http://opcfoundation.org/UA/"}

for _, id := range incomingNodes {
parsedNodeID, err := ua.ParseNodeID(id)
parsedNodeID, err := ua.ParseExpandedNodeID(id, namespaceArray)
if err != nil {
return nil
}
Expand Down Expand Up @@ -295,7 +298,7 @@ type OPCUAInput struct {
endpoint string
username string
password string
nodeIDs []*ua.NodeID
nodeIDs []*ua.ExpandedNodeID
nodeList []NodeDef
securityMode string
securityPolicy string
Expand Down