pxt-common-packages 9.3.7 → 9.3.11

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.
@@ -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
- // don't wait for the actual close
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-common-packages",
3
- "version": "9.3.7",
3
+ "version": "9.3.11",
4
4
  "description": "Microsoft MakeCode (PXT) common packages",
5
5
  "keywords": [
6
6
  "MakeCode",