1212
1313class BoardsInterface:
1414
15+ DEFAULT_CARRIER = 1
1516 EXISTING_NETWORK = 2
1617 WIFI = 3
1718 LTE = 4
@@ -51,11 +52,11 @@ class LoPy(BoardsInterface):
5152class GPy(BoardsInterface):
5253 def __init__(self, net_type):
5354 self._lang = 'microPython'
54- self._net_type = net_type
55+ self._net_type = BoardsInterface.WIFI if net_type == BoardsInterface.DEFAULT_CARRIER else net_type
5556 self._wifi_tls_capability = True
5657 self._lte_tls_capability = False
5758 self._mqtt_lib = super().mqtt_lib_import_str(self._lang)
58- self._credentials = super().create_credentials(net_type )
59+ self._credentials = super().create_credentials(self._net_type )
5960
6061 def network_connect(self):
6162 if self._net_type == BoardsInterface.WIFI:
@@ -73,7 +74,7 @@ def get_security_level(self):
7374class Esp8266(BoardsInterface):
7475 def __init__(self, net_type):
7576 self._lang = 'microPython'
76- self._net_type = net_type
77+ self._net_type = BoardsInterface.WIFI if net_type == BoardsInterface.DEFAULT_CARRIER else None
7778 self._wifi_tls_capability = False
7879 self._wifi_lte_capability = False
7980 self._mqtt_lib = super().mqtt_lib_import_str(self._lang)
@@ -95,7 +96,7 @@ class Win32(BoardsInterface):
9596class Esp32(BoardsInterface):
9697 def __init__(self, net_type):
9798 self._lang = 'microPython'
98- self._net_type = net_type
99+ self._net_type = BoardsInterface.WIFI if net_type == BoardsInterface.DEFAULT_CARRIER else None
99100 self._wifi_tls_capability = True
100101 self._wifi_lte_capability = False
101102 self._mqtt_lib = super().mqtt_lib_import_str(self._lang)
@@ -113,7 +114,7 @@ def get_security_level(self):
113114class Linux(BoardsInterface):
114115 def __init__(self, net_type):
115116 self._lang = 'Python'
116- self._net_type = net_type
117+ self._net_type = BoardsInterface.EXISTING_NETWORK if net_type == BoardsInterface.DEFAULT_CARRIER else None
117118 self._wifi_tls_capability = True
118119 self._wifi_lte_capability = False
119120 self._mqtt_lib = super().mqtt_lib_import_str(self._lang)
0 commit comments