@@ -37,6 +37,9 @@ The constructor takes the following parameters.
3737 * - ``autoconnect ``
3838 - yes
3939 - Automatically connect.
40+ * - ``load ``
41+ - yes
42+ - Load interface definition from file.
4043
4144Please see the list of handlers _ for a full description of the supported
4245interface types.
@@ -99,6 +102,8 @@ The ``Interface`` class provides the following methods.
99102 - Query device state.
100103 * - ``call_method() ``
101104 - Execute a method.
105+ * - ``save() ``
106+ - Save the interface definition to a file.
102107
103108The ``open() `` function is used to connect to a device, this is needed when
104109``autoconnect=False `` is passed to the constructor.
@@ -109,6 +114,14 @@ The ``open()`` function is used to connect to a device, this is needed when
109114 >> > # Do something.
110115 >> > interface.open()
111116
117+ The ``open() `` function accepts the optional parameter ``handle ``, which can be
118+ used to load an interface definition from a file. This can be useful when
119+ working with low throughput networks.
120+
121+ .. code :: python
122+
123+ >> > interface.open(open (' interface.yml' ))
124+
112125 The connection state can be queried using the ``is_open() `` function and it can
113126be closed using the ``close() `` function.
114127
@@ -160,6 +173,14 @@ instance. These methods can be used like any normal class methods.
160173Alternatively, the exported methods can be called by name using the
161174``call_method() `` function.
162175
176+ The ``save() `` function is used to save the interface definition to a file.
177+ This can later be used by the constructor or the ``open() `` function to
178+ initialise the interface without having to query the device.
179+
180+ .. code :: python
181+
182+ >> > interface.save(open (' interface.yml' , ' w' ))
183+
163184
164185 Basic usage
165186-----------
@@ -227,6 +248,5 @@ other Object. A similar Object is returned.
227248 (b ' b' , (11 , b ' c' ))
228249
229250
230-
231251 .. _example : https://simplerpc.readthedocs.io/en/latest/usage_device.html#example
232252.. _handlers : https://pyserial.readthedocs.io/en/latest/url_handlers.html
0 commit comments