Skip to content

Commit a260d7a

Browse files
committed
Adding support for LoPy.
1 parent a648e86 commit a260d7a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

LiveObjects/hal.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,23 @@ def network_disconnect(self):
5858

5959

6060
class LoPy(BoardsInterface):
61-
pass
61+
def __init__(self, net_type):
62+
self._lang_id = BoardsInterface.MICROPYTHON
63+
self._net_type = BoardsInterface.WIFI if net_type == BoardsInterface.DEFAULT_CARRIER else net_type
64+
self._carrier_capability = (BoardsInterface.WIFI,)
65+
self._wifi_tls_capability = False
66+
self._credentials = super().create_credentials(self._net_type)
67+
self._hostname = 'LoPy'
68+
69+
def connect(self):
70+
super().check_network_capabilities(self._net_type)
71+
if self._net_type == BoardsInterface.WIFI:
72+
pycom_wifi_connect(self._credentials.get_creds()['ssid'], self._credentials.get_creds()['password'],
73+
self._hostname)
74+
75+
def get_security_level(self):
76+
if self._net_type == BoardsInterface.WIFI:
77+
return LiveObjects.SSL if self._wifi_tls_capability else LiveObjects.NONE
6278

6379

6480
class GPy(BoardsInterface):

0 commit comments

Comments
 (0)