def _send_message(self, message, update_status=True):
"""
Sends a message to the VMU931 device, with 5ms delay between each character.
:param message: Message to send to device
:param update_status: Update sensor status after message send (defaults to True)
"""
byte_message = message.encode('ascii')
# bytes must be sent with 1ms+ interval to be recognised by device.
for c in byte_message:
bs = bytes([c])
self.ser.write(bs)
logging.debug("Sent {}".format(bs))
time.sleep(0.01)
time.sleep(0.05)
if update_status:
self.request_status()
time.sleep(0.100)
评论列表
文章目录