pxt-common-packages 9.3.11 → 9.4.2
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 +38 -0
- package/libs/azureiot/built/debug/binary.js +469 -464
- 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 +7126 -6975
- package/libs/controller---none/built/debug/binary.js +7105 -6954
- package/libs/core---esp32/pins.cpp +30 -4
- package/libs/core---esp32/shims.d.ts +15 -0
- package/libs/core---esp32s2/shims.d.ts +15 -0
- 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 +470 -465
- package/libs/game/_locales/game-jsdoc-strings.json +10 -1
- package/libs/game/_locales/game-strings.json +18 -2
- package/libs/game/assetTemplates.ts +2 -0
- package/libs/game/built/debug/binary.js +7018 -6867
- package/libs/game/docs/reference/scene/get-tile-location.md +96 -0
- package/libs/game/docs/reference/scene/get-tiles-by-type.md +64 -43
- package/libs/game/docs/reference/scene/is-hitting-tile.md +87 -0
- package/libs/game/docs/reference/scene/on-hit-wall.md +88 -0
- package/libs/game/docs/reference/scene/on-overlap-tile.md +88 -0
- package/libs/game/docs/reference/scene/place-on-random-tile.md +95 -41
- package/libs/game/docs/reference/scene/place-on-tile.md +88 -0
- package/libs/game/docs/reference/scene/set-tile-at.md +45 -41
- package/libs/game/docs/reference/scene/set-wall-at.md +86 -0
- package/libs/game/docs/reference/scene/tile-at-location-equals.md +97 -0
- package/libs/game/docs/reference/scene/tile-kind-at.md +118 -0
- package/libs/game/docs/reference/scene.md +18 -16
- package/libs/game/physics.ts +1 -1
- package/libs/game/scenes.ts +5 -1
- package/libs/game/sprite.ts +23 -6
- package/libs/game/spriteevents.ts +7 -7
- package/libs/game/sprites.ts +16 -0
- package/libs/game/tilemap.ts +172 -26
- 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/net/built/debug/binary.js +176 -176
- package/libs/net/controller.ts +15 -1
- package/libs/net-game/built/debug/binary.js +8896 -8680
- package/libs/palette/built/debug/binary.js +7017 -6866
- 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 +45 -0
- package/libs/screen/image.ts +26 -0
- package/libs/screen/sim/image.ts +42 -0
- package/libs/servo/built/debug/binary.js +8 -8
- package/libs/storyboard/built/debug/binary.js +7017 -6866
- package/package.json +1 -1
package/libs/net/controller.ts
CHANGED
|
@@ -3,11 +3,17 @@ namespace net {
|
|
|
3
3
|
NewScan = 1,
|
|
4
4
|
GotIP = 2,
|
|
5
5
|
LostIP = 3,
|
|
6
|
+
NoScannedNetworks = 4,
|
|
7
|
+
NoKnownNetworks = 5,
|
|
8
|
+
Connecting = 6,
|
|
9
|
+
ConnectionFailed = 7
|
|
6
10
|
}
|
|
7
11
|
export class Controller {
|
|
8
12
|
eventID: number
|
|
9
13
|
private _isConnected = false
|
|
10
14
|
|
|
15
|
+
onConnectSSIDFailed: (ssid: string) => void;
|
|
16
|
+
|
|
11
17
|
constructor() {
|
|
12
18
|
this.eventID = control.allocateEventSource()
|
|
13
19
|
}
|
|
@@ -75,6 +81,7 @@ namespace net {
|
|
|
75
81
|
return
|
|
76
82
|
const myReconn = {}
|
|
77
83
|
this.reconnectRunning = myReconn
|
|
84
|
+
this.emitEvent(ControllerEvent.Connecting)
|
|
78
85
|
control.runInParallel(() => {
|
|
79
86
|
while (this.reconnectRunning == myReconn) {
|
|
80
87
|
if (this.isConnected) {
|
|
@@ -101,6 +108,7 @@ namespace net {
|
|
|
101
108
|
this.scanNetworks()
|
|
102
109
|
if (!this.lastScanResults || this.lastScanResults.length == 0) {
|
|
103
110
|
net.log(`no networks detected`)
|
|
111
|
+
this.emitEvent(ControllerEvent.NoScannedNetworks)
|
|
104
112
|
return false
|
|
105
113
|
}
|
|
106
114
|
|
|
@@ -114,6 +122,7 @@ namespace net {
|
|
|
114
122
|
|
|
115
123
|
if (!networks.length) {
|
|
116
124
|
net.log(`no known networks`)
|
|
125
|
+
this.emitEvent(ControllerEvent.NoKnownNetworks)
|
|
117
126
|
return false
|
|
118
127
|
}
|
|
119
128
|
|
|
@@ -127,15 +136,20 @@ namespace net {
|
|
|
127
136
|
// try connecting to known networks
|
|
128
137
|
for (const network of networks) {
|
|
129
138
|
net.log(`connecting to ${network.ssid}...`)
|
|
130
|
-
|
|
139
|
+
const pwd = wifis[network.ssid]
|
|
140
|
+
if (this.connectAP(network.ssid, pwd)) {
|
|
131
141
|
net.log(`connected to ${network.ssid}`)
|
|
132
142
|
return true
|
|
133
143
|
}
|
|
134
144
|
if (!this.reconnectRunning)
|
|
135
145
|
return false
|
|
146
|
+
|
|
147
|
+
if (this.onConnectSSIDFailed)
|
|
148
|
+
this.onConnectSSIDFailed(network.ssid)
|
|
136
149
|
}
|
|
137
150
|
|
|
138
151
|
net.log(`connection failed`)
|
|
152
|
+
this.emitEvent(ControllerEvent.ConnectionFailed)
|
|
139
153
|
return false
|
|
140
154
|
}
|
|
141
155
|
|