def serial_disconnect(self):
if self._serial_connected:<EOL><INDENT>try:<EOL><INDENT>self.serial_connection.close()<EOL><DEDENT>except c1218.errors.C1218IOError as error:<EOL><INDENT>self.logger.error('<STR_LIT>' + str(error))<EOL><DEDENT>except serial.serialutil.SerialException as error:<EOL><INDENT>self.logger.error('<STR_LIT>' + str(error))<EOL><DEDENT>self._serial_connected = False<EOL>self.logger.warning('<STR_LIT>')<EOL><DEDENT>return True<EOL>
Closes the serial connection to the meter and disconnects from the
device.