File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -506,23 +506,28 @@ def get_host_by_name(self, hostname):
506506 :param str hostname: Destination server.
507507
508508 """
509- self ._read_line ()
510509 if self ._debug :
511510 print ("*** get_host_by_name: " , hostname )
512511 if isinstance (hostname , str ):
513512 hostname = bytes (hostname , "utf-8" )
514513
515- self ._uart . write ( b'AT+CDNSGIP="' + hostname + b'" \r \n ' )
516-
514+ self ._read_line ( )
515+ self . _uart . reset_input_buffer ()
517516
518- if not self ._expect_reply (REPLY_OK ):
519- print ("retin" )
517+ if self ._debug :
518+ print ("\t ---> AT+CDNSGIP=" , hostname )
519+
520+ if not self ._send_check_reply (b'AT+CDNSGIP="' + hostname + b'"\r \n ' , reply = REPLY_OK ):
520521 return False
521- # eat the blank line
522- self ._read_line ()
523- # parse the 3rd line
524- self ._read_line ()
525522
523+ # self._uart.write(b'AT+CDNSGIP="' + hostname + b'"\r\n')
524+ # if not self._expect_reply(REPLY_OK):
525+ # return False
526+
527+ # parse the second response
528+ self ._read_line ()
529+ if self ._debug :
530+ print ("\t <--- " , self ._buf )
526531 self ._parse_reply (b"+CDNSGIP:" , idx = 2 )
527532 return self ._buf
528533
Original file line number Diff line number Diff line change 2727# Initialize FONA module (this may take a few seconds)
2828fona = FONA (uart , rst )
2929
30- print ("Adafruit FONA WebClient Test" )
31-
3230# Enable GPS
3331fona .gps = True
3432
You can’t perform that action at this time.
0 commit comments