'Creates the connection to the modem via pySerial, optionally
killing and re-creating any existing connection.'

def connect(self, reconnect=False):

    self._log('Connecting')
    if ((not hasattr(self, 'device')) or (self.device is None)):
        with self.modem_lock:
            self.device = DeviceWrapper(self.logger, *self.device_args, **self.device_kwargs)
    elif reconnect:
        self.disconnect()
        self.connect(False)
    return self.device
