pxt-common-packages 9.3.8 → 9.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/common-sim.d.ts +2 -0
- package/built/common-sim.js +36 -0
- package/libs/azureiot/azureiot.ts +4 -4
- package/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/color/built/debug/binary.js +8 -8
- package/libs/color-sensor/built/debug/binary.js +8 -8
- package/libs/controller/built/debug/binary.js +6551 -6551
- package/libs/controller---none/built/debug/binary.js +6531 -6531
- package/libs/core---esp32/pxt.h +2 -0
- package/libs/core---esp32/usb.cpp +43 -18
- package/libs/core---esp32/worker.cpp +8 -0
- package/libs/core---vm/vm.cpp +75 -2
- package/libs/datalogger/built/debug/binary.js +63 -63
- package/libs/edge-connector/built/debug/binary.js +8 -8
- package/libs/esp32/built/debug/binary.js +462 -462
- package/libs/game/built/debug/binary.js +6470 -6470
- package/libs/lcd/built/debug/binary.js +8 -8
- package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
- package/libs/lora/built/debug/binary.js +8 -8
- package/libs/matrix-keypad/built/debug/binary.js +8 -8
- package/libs/mqtt/built/debug/binary.js +176 -176
- package/libs/mqtt/mqtt.ts +10 -4
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +8049 -8049
- package/libs/palette/built/debug/binary.js +6469 -6469
- package/libs/pixel/built/debug/binary.js +8 -8
- package/libs/power/built/debug/binary.js +8 -8
- package/libs/proximity/built/debug/binary.js +8 -8
- package/libs/radio/built/debug/binary.js +8 -8
- package/libs/radio-broadcast/built/debug/binary.js +8 -8
- package/libs/rotary-encoder/built/debug/binary.js +8 -8
- package/libs/screen/_locales/screen-jsdoc-strings.json +1 -0
- package/libs/screen/built/debug/binary.js +50 -50
- package/libs/screen/image.cpp +43 -0
- package/libs/screen/image.ts +26 -0
- package/libs/screen/sim/image.ts +40 -0
- package/libs/servo/built/debug/binary.js +8 -8
- package/libs/storyboard/built/debug/binary.js +6469 -6469
- package/libs/wifi---esp32/controller.ts +2 -3
- package/libs/wifi---esp32/socket.cpp +4 -2
- package/package.json +1 -1
|
@@ -50,13 +50,12 @@ namespace net {
|
|
|
50
50
|
|
|
51
51
|
public connectAP(ssid: string, pass: string) {
|
|
52
52
|
control.dmesg(`connecting to [${ssid}]...`)
|
|
53
|
+
this._ssid = ssid
|
|
53
54
|
const res = _wifi.connect(ssid, pass)
|
|
54
55
|
if (res != 0)
|
|
55
56
|
return false
|
|
56
57
|
pauseUntil(() => this.isConnected, 15000)
|
|
57
58
|
control.dmesg(`${this.isConnected ? "" : "not "}connected to [${ssid}]`)
|
|
58
|
-
if (this.isConnected)
|
|
59
|
-
this._ssid = ssid
|
|
60
59
|
return this.isConnected
|
|
61
60
|
}
|
|
62
61
|
|
|
@@ -108,7 +107,7 @@ namespace net {
|
|
|
108
107
|
get isIdle(): boolean { return true; }
|
|
109
108
|
get MACaddress(): Buffer { return control.deviceLongSerialNumber().slice(1, 6); }
|
|
110
109
|
get IPaddress(): Buffer { return this.isConnected ? _wifi.ipInfo().slice(0, 4) : undefined; }
|
|
111
|
-
get ssid(): string { return this._ssid }
|
|
110
|
+
get ssid(): string { return this.isConnected ? this._ssid : "" }
|
|
112
111
|
get rssi(): number { return _wifi.rssi() }
|
|
113
112
|
public ping(dest: string, ttl: number = 250): number { return -1; }
|
|
114
113
|
|
|
@@ -273,7 +273,6 @@ static void worker_close(socket_t *sock) {
|
|
|
273
273
|
esp_tls_conn_destroy(sock->ssl);
|
|
274
274
|
sock->ssl = NULL;
|
|
275
275
|
}
|
|
276
|
-
free(sock);
|
|
277
276
|
}
|
|
278
277
|
|
|
279
278
|
/** Close the socket if open */
|
|
@@ -282,7 +281,10 @@ int socketClose(int fd) {
|
|
|
282
281
|
GET_SOCK();
|
|
283
282
|
sockets[fd] = NULL;
|
|
284
283
|
worker_run(worker, (TaskFunction_t)worker_close, sock);
|
|
285
|
-
//
|
|
284
|
+
// wait for the actual close - we only really have memory for one open SSL socket...
|
|
285
|
+
while (sock->ssl)
|
|
286
|
+
vTaskDelay(5);
|
|
287
|
+
free(sock);
|
|
286
288
|
return 0;
|
|
287
289
|
}
|
|
288
290
|
|