def set_communication_mode(self, brm, **kwargs):
"""Set the hardware communication mode. The effect of calling
this method depends on the hardware support, some drivers may
purposely ignore this function. If supported, the parameter
*brm* specifies the communication mode to choose as a string
composed of the bitrate and modulation type, for example
'212F' shall switch to 212 kbps Type F communication. Other
communication parameters may be changed with optional keyword
arguments. Currently implemented by the RC-S380 driver are the
parameters 'add-crc' and 'check-crc' when running as
initator. It is possible to set *brm* to an empty string if
bitrate and modulation shall not be changed but only optional
parameters executed.
.. note:: This is a direct interface to the
driver and not needed if :meth:`connect` is used.
"""
if self.dev is None:
raise IOError(errno.ENODEV, os.strerror(errno.ENODEV))
with self.lock:
self.dev.set_communication_mode(brm, **kwargs)
评论列表
文章目录