src/eric7/MicroPython/Devices/RP2Devices.py

branch
eric7
changeset 11166
fd914f897dcf
parent 11148
15e30f0c76a8
child 11167
a3f5af773bc7
equal deleted inserted replaced
11165:24e1beb8779a 11166:fd914f897dcf
55 -1: self.tr("connection failed"), 55 -1: self.tr("connection failed"),
56 0: self.tr("idle"), 56 0: self.tr("idle"),
57 1: self.tr("connecting"), 57 1: self.tr("connecting"),
58 2: self.tr("connected, waiting for IP address"), 58 2: self.tr("connected, waiting for IP address"),
59 3: self.tr("connected"), 59 3: self.tr("connected"),
60 103: self.tr("AP listening"),
60 }, 61 },
61 "picowireless": { 62 "picowireless": {
62 0: self.tr("idle"), 63 0: self.tr("idle"),
63 1: self.tr("no matching access point found"), 64 1: self.tr("no matching access point found"),
64 2: self.tr("network scan completed"), 65 2: self.tr("network scan completed"),
629 station["status"] = str(station["status"]) 630 station["status"] = str(station["status"])
630 if "status" in ap: 631 if "status" in ap:
631 # translate the numerical status to a string 632 # translate the numerical status to a string
632 try: 633 try:
633 ap["status"] = self.__statusTranslations[self._deviceData["wifi_type"]][ 634 ap["status"] = self.__statusTranslations[self._deviceData["wifi_type"]][
634 ap["status"] 635 (
636 103
637 if self._deviceData["wifi_type"] == "picow"
638 and ap["status"] == 3
639 else ap["status"]
640 )
635 ] 641 ]
636 except KeyError: 642 except KeyError:
637 ap["status"] = str(ap["status"]) 643 ap["status"] = str(ap["status"])
638 if "ap_security" in station: 644 if "ap_security" in station:
639 # translate the numerical AP security to a string 645 # translate the numerical AP security to a string
1204 ap.active(True) 1210 ap.active(True)
1205 if ifconfig: 1211 if ifconfig:
1206 ap.ifconfig(ifconfig) 1212 ap.ifconfig(ifconfig)
1207 ap.config(ssid=ssid, security=security, password=password) 1213 ap.config(ssid=ssid, security=security, password=password)
1208 sleep(0.1) 1214 sleep(0.1)
1209 print(ap.isconnected()) 1215 print(ap.status() == network.STAT_GOT_IP)
1210 1216
1211 start_ap({0}, {1}, {2}, {3}, {4}, {5}) 1217 start_ap({0}, {1}, {2}, {3}, {4}, {5})
1212 del start_ap 1218 del start_ap
1213 """.format( 1219 """.format(
1214 repr(ssid), 1220 repr(ssid),

eric ide

mercurial