Skip to content

Commit 36a0ee9

Browse files
mathias-luedtkeoroulet
authored andcommitted
implement uacall --method-name
1 parent 4006341 commit 36a0ee9

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

opcua/tools.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,12 @@ def uacall():
679679
type=int,
680680
default=None,
681681
help="Set method to call. If not given then (single) method of the selected node is used.")
682+
parser.add_argument("-M",
683+
"--method-name",
684+
dest="method_name",
685+
type=str,
686+
default=None,
687+
help="Set name of method to call. Overrides --method")
682688
parser.add_argument("-l",
683689
"--list",
684690
"--array",
@@ -715,7 +721,9 @@ def uacall():
715721
method_id = None
716722
#print( "methods=%s" % (methods) )
717723

718-
if ( args.method is None ):
724+
if ( args.method_name is not None ):
725+
method_id = args.method_name
726+
elif ( args.method is None ):
719727
if ( len( methods ) == 0 ):
720728
raise ValueError( "No methods in selected node and no method given" )
721729
elif ( len( methods ) == 1 ):

0 commit comments

Comments
 (0)