send command, wait for response. returns response from modem.

def sendcmd(self, cmd='AT', timeout=1.0):
        """send command, wait for response. returns response from modem."""
        import time
        if self.write(cmd):
            while self.get_response() == '' and timeout > 0:
                time.sleep(0.1)
                timeout -= 0.1
        return self.get_lines()