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 67
67
FONA_HTTP_POST = const (0x01 )
68
68
FONA_HTTP_HEAD = const (0x02 )
69
69
70
- # TCP/IP
71
- TCP_MODE = const (0 )
72
- UDP_MODE = const (1 )
73
-
74
70
FONA_MAX_SOCKETS = const (6 )
75
71
76
72
# pylint: enable=bad-whitespace
@@ -83,6 +79,10 @@ class FONA:
83
79
:param bool debug: Enable debugging output.
84
80
85
81
"""
82
+
83
+ # Connection modes
84
+ TCP_MODE = const (0 )
85
+ UDP_MODE = const (1 )
86
86
87
87
# pylint: disable=too-many-arguments
88
88
def __init__ (self , uart , rst , debug = False ):
@@ -513,11 +513,8 @@ def get_host_by_name(self, hostname):
513
513
if isinstance (hostname , str ):
514
514
hostname = bytes (hostname , "utf-8" )
515
515
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
+
521
518
522
519
if not self ._expect_reply (REPLY_OK ):
523
520
print ("retin" )
You can’t perform that action at this time.
0 commit comments