Skip to content

Commit

Permalink
Support for arbitrary server.enip.client connector kwds, from proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbrisebois committed May 26, 2017
1 parent 1fc3acf commit 658a6cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions server/enip/get_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def parameter_substitution( self, iterable, parameters=None, pass_thru=None ):

def __init__( self, host, port=44818, timeout=None, depth=None, multiple=None,
gateway_class=client.connector, route_path=None, send_path=None,
identity_default=None ):
identity_default=None, **gateway_kwds ):
"""Capture the desired I/O parameters for the target CIP Device.
By default, the CIP Device will be identified using a List Identity request each time a CIP
Expand All @@ -276,6 +276,7 @@ def __init__( self, host, port=44818, timeout=None, depth=None, multiple=None,
self.multiple = 0 if multiple is None else multiple
self.route_path = route_path
self.send_path = send_path
self.gateway_kwds = gateway_kwds # Any additional args to gateway
self.gateway_class = gateway_class
self.gateway = None
self.gateway_lock = threading.Lock()
Expand Down Expand Up @@ -317,7 +318,8 @@ def open_gateway( self ):
device -- all under the protection of the gateway_lock Mutex."""
with self.gateway_lock:
if self.gateway is None:
self.gateway = self.gateway_class( host=self.host, port=self.port, timeout=self.timeout )
self.gateway = self.gateway_class(
host=self.host, port=self.port, timeout=self.timeout, **self.gateway_kwds )
if not self.identity:
try:
rsp,ela = self.list_identity_details()
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = ( 3, 9, 6 )
__version_info__ = ( 3, 9, 7 )
__version__ = '.'.join( map( str, __version_info__ ))

0 comments on commit 658a6cd

Please sign in to comment.