File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 6767FONA_HTTP_POST = const (0x01 )
6868FONA_HTTP_HEAD = const (0x02 )
6969
70- # TCP/IP
71- TCP_MODE = const (0 )
72- UDP_MODE = const (1 )
73-
7470FONA_MAX_SOCKETS = const (6 )
7571
7672# pylint: enable=bad-whitespace
@@ -83,6 +79,10 @@ class FONA:
8379 :param bool debug: Enable debugging output.
8480
8581 """
82+
83+ # Connection modes
84+ TCP_MODE = const (0 )
85+ UDP_MODE = const (1 )
8686
8787 # pylint: disable=too-many-arguments
8888 def __init__ (self , uart , rst , debug = False ):
@@ -513,11 +513,8 @@ def get_host_by_name(self, hostname):
513513 if isinstance (hostname , str ):
514514 hostname = bytes (hostname , "utf-8" )
515515
516- self ._uart .write (b'AT+CDNSGIP=' )
517- self ._uart .write (b'"' )
518- self ._uart .write (hostname )
519- self ._uart .write (b'"' )
520- self ._uart .write (b"\r \n " )
516+ self ._uart .write (b'AT+CDNSGIP="' + hostname + b'"\r \n ' )
517+
521518
522519 if not self ._expect_reply (REPLY_OK ):
523520 print ("retin" )
You can’t perform that action at this time.
0 commit comments