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