From 11b10c3fc6cb2d79c563c03109c91b0b05ade46e Mon Sep 17 00:00:00 2001 From: Galen Collins Date: Sun, 4 Jan 2015 23:36:52 -0800 Subject: [PATCH] fixes #70 --- pymodbus/server/sync.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pymodbus/server/sync.py b/pymodbus/server/sync.py index f367fac2c..d2d2ca8be 100644 --- a/pymodbus/server/sync.py +++ b/pymodbus/server/sync.py @@ -436,9 +436,10 @@ def StartUdpServer(context=None, identity=None, address=None, **kwargs): :param context: The ModbusServerContext datastore :param identity: An optional identify structure :param address: An optional (interface, port) to bind to. + :param framer: The framer to operate with (default ModbusSocketFramer) :param ignore_missing_slaves: True to not send errors on a request to a missing slave ''' - framer = ModbusSocketFramer + framer = kwargs.pop('framer', ModbusSocketFramer) server = ModbusUdpServer(context, framer, identity, address, **kwargs) server.serve_forever() @@ -448,6 +449,7 @@ def StartSerialServer(context=None, identity=None, **kwargs): :param context: The ModbusServerContext datastore :param identity: An optional identify structure + :param framer: The framer to operate with (default ModbusAsciiFramer) :param port: The serial port to attach to :param stopbits: The number of stop bits to use :param bytesize: The bytesize of the serial messages @@ -456,7 +458,7 @@ def StartSerialServer(context=None, identity=None, **kwargs): :param timeout: The timeout to use for the serial device :param ignore_missing_slaves: True to not send errors on a request to a missing slave ''' - framer = ModbusAsciiFramer + framer = kwargs.pop('framer', ModbusAsciiFramer) server = ModbusSerialServer(context, framer, identity, **kwargs) server.serve_forever()