@@ -107,6 +107,7 @@ def attribute_operations( paths, int_type=None, **kwds ):
107107 op ['method' ] = 'set_attribute_single' if 'data' in op else 'get_attribute_single'
108108 else :
109109 raise AssertionError ( "Path invalid for Attribute services: %r" , op ['path' ] )
110+ log .detail ( "CIP Operation: %s" , parser .enip_format ( op ))
110111 yield op
111112
112113
@@ -245,7 +246,8 @@ def parameter_substitution( self, iterable, parameters=None, pass_thru=None ):
245246 def __init__ ( self , host , port = 44818 , timeout = None , depth = None , multiple = None ,
246247 gateway_class = None , route_path = None , send_path = None ,
247248 priority_time_tick = None , timeout_ticks = None ,
248- identity_default = None , dialect = None , ** gateway_kwds ):
249+ identity_default = None , dialect = None , operations_parser = None ,
250+ ** gateway_kwds ):
249251 """Capture the desired I/O parameters for the target CIP Device.
250252
251253 By default, the CIP Device will be identified using a List Identity request each time a CIP
@@ -273,6 +275,7 @@ def __init__( self, host, port=44818, timeout=None, depth=None, multiple=None,
273275 self .identity_default = identity_default
274276 self .identity = identity_default
275277 self .dialect = dialect
278+ self .operations_parser = operations_parser
276279
277280 def __str__ ( self ):
278281 return "%s at %s" % ( self .identity .product_name if self .identity else None , self .gateway )
@@ -545,7 +548,8 @@ def opp__att_typ_uni( i ):
545548 # No conversion of data type if None; use a Read Tag [Fragmented]; works only
546549 # for [S]STRING/SINT/INT/DINT/REAL/BOOL. Otherwise, conversion of data type
547550 # desired; get raw data using Get Attribute Single.
548- parser = client .parse_operations if typ is None else attribute_operations
551+ parser = self .operations_parser or ( client .parse_operations if typ is None
552+ else attribute_operations )
549553 opp , = parser ( ( att , ), route_path = device .parse_route_path ( self .route_path ),
550554 send_path = self .send_path , priority_time_tick = self .priority_time_tick ,
551555 timeout_ticks = self .timeout_ticks )
0 commit comments