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.
- 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/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 +85 -9
- package/libs/game/built/debug/binary.js +6468 -6468
- package/libs/matrix-keypad/built/debug/binary.js +8 -8
- package/libs/mqtt/mqtt.ts +10 -4
- package/libs/palette/built/debug/binary.js +6467 -6467
- 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/storyboard/built/debug/binary.js +6467 -6467
- package/libs/wifi---esp32/controller.ts +2 -3
- package/libs/wifi---esp32/socket.cpp +4 -2
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ namespace azureiot {
|
|
|
17
17
|
let _messageBusId: number;
|
|
18
18
|
let _receiveHandler: (msg: Json, sysProps: SMap<string>) => void;
|
|
19
19
|
let _methodHandlers: SMap<(msg: Json) => Json>;
|
|
20
|
+
let twinRespHandlers: SMap<(status: number, body: any) => void>
|
|
20
21
|
|
|
21
22
|
function log(msg: string) {
|
|
22
23
|
console.add(logPriority, "azureiot: " + msg);
|
|
@@ -156,7 +157,6 @@ namespace azureiot {
|
|
|
156
157
|
}
|
|
157
158
|
catch {
|
|
158
159
|
// just ignore errors disconnecting
|
|
159
|
-
_mqttClient = undefined
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
@@ -320,16 +320,16 @@ namespace azureiot {
|
|
|
320
320
|
c.publish('$iothub/methods/res/' + status + "/?$rid=" + props["$rid"], JSON.stringify(resp))
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
let twinRespHandlers: SMap<(status: number, body: any) => void>
|
|
324
|
-
|
|
325
323
|
// $iothub/twin/res/{status}/?$rid={request id}
|
|
326
324
|
function twinResponse(msg: mqtt.IMessage) {
|
|
327
325
|
const args = parseTopicArgs(msg.topic)
|
|
328
326
|
const h = twinRespHandlers[args["$rid"]]
|
|
329
327
|
const status = parseInt(msg.topic.slice(17))
|
|
330
328
|
// log(`twin resp: ${status} ${msg.content.toHex()} ${msg.content.toString()}`)
|
|
331
|
-
if (h)
|
|
329
|
+
if (h) {
|
|
330
|
+
delete twinRespHandlers[args["$rid"]]
|
|
332
331
|
h(status, JSON.parse(msg.content.toString() || "{}"))
|
|
332
|
+
}
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
export class ValueAwaiter {
|