@microbit/microbit-connection 0.0.0-alpha.3 → 0.0.0-alpha.31
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/build/accelerometer-service.d.ts +8 -9
- package/build/accelerometer-service.js +24 -43
- package/build/accelerometer-service.js.map +1 -1
- package/build/bluetooth-device-wrapper.d.ts +30 -26
- package/build/bluetooth-device-wrapper.js +147 -89
- package/build/bluetooth-device-wrapper.js.map +1 -1
- package/build/bluetooth.d.ts +15 -11
- package/build/bluetooth.js +74 -91
- package/build/bluetooth.js.map +1 -1
- package/build/board-id.d.ts +1 -0
- package/build/board-id.js +8 -0
- package/build/board-id.js.map +1 -1
- package/build/button-service.d.ts +13 -0
- package/build/button-service.js +76 -0
- package/build/button-service.js.map +1 -0
- package/build/buttons.d.ts +10 -0
- package/build/buttons.js +18 -0
- package/build/buttons.js.map +1 -0
- package/build/constants.d.ts +1 -0
- package/build/constants.js +1 -0
- package/build/constants.js.map +1 -1
- package/build/device.d.ts +32 -39
- package/build/device.js +18 -3
- package/build/device.js.map +1 -1
- package/build/events.d.ts +11 -1
- package/build/events.js +86 -1
- package/build/events.js.map +1 -1
- package/build/hex-flash-data-source.d.ts +6 -8
- package/build/hex-flash-data-source.js +16 -45
- package/build/hex-flash-data-source.js.map +1 -1
- package/build/index.d.ts +10 -5
- package/build/index.js +7 -4
- package/build/index.js.map +1 -1
- package/build/led-service.d.ts +20 -0
- package/build/led-service.js +116 -0
- package/build/led-service.js.map +1 -0
- package/build/led.d.ts +6 -0
- package/build/led.js +2 -0
- package/build/led.js.map +1 -0
- package/build/logging.js +3 -1
- package/build/logging.js.map +1 -1
- package/build/promise-queue.d.ts +27 -0
- package/build/promise-queue.js +74 -0
- package/build/promise-queue.js.map +1 -0
- package/build/service-events.d.ts +5 -0
- package/build/service-events.js +18 -0
- package/build/service-events.js.map +1 -1
- package/build/uart-service.d.ts +13 -0
- package/build/uart-service.js +72 -0
- package/build/uart-service.js.map +1 -0
- package/build/uart.d.ts +4 -0
- package/build/uart.js +12 -0
- package/build/uart.js.map +1 -0
- package/build/usb-device-wrapper.d.ts +7 -1
- package/build/usb-device-wrapper.js +40 -3
- package/build/usb-device-wrapper.js.map +1 -1
- package/build/usb-partial-flashing.d.ts +11 -5
- package/build/usb-partial-flashing.js +53 -10
- package/build/usb-partial-flashing.js.map +1 -1
- package/build/usb-radio-bridge.d.ts +31 -18
- package/build/usb-radio-bridge.js +351 -187
- package/build/usb-radio-bridge.js.map +1 -1
- package/build/usb.d.ts +14 -17
- package/build/usb.js +111 -47
- package/build/usb.js.map +1 -1
- package/package.json +5 -3
- package/vite.config.ts +9 -7
- package/build/bluetooth-utils.d.ts +0 -5
- package/build/bluetooth-utils.js +0 -14
- package/build/bluetooth-utils.js.map +0 -1
|
@@ -3,26 +3,39 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { BoardVersion, ConnectionStatus, DeviceConnection, DeviceConnectionEventMap } from "./device.js";
|
|
7
|
+
import { TypedEventTarget } from "./events.js";
|
|
7
8
|
import { Logging } from "./logging.js";
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
import { ServiceConnectionEventMap } from "./service-events.js";
|
|
10
|
+
import { MicrobitWebUSBConnection } from "./usb.js";
|
|
11
|
+
export interface MicrobitRadioBridgeConnectionOptions {
|
|
12
|
+
logging: Logging;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Wraps around a USB connection to implement a subset of services over a serial protocol.
|
|
16
|
+
*
|
|
17
|
+
* When it connects/disconnects it affects the delegate connection.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MicrobitRadioBridgeConnection extends TypedEventTarget<DeviceConnectionEventMap & ServiceConnectionEventMap> implements DeviceConnection {
|
|
20
|
+
private delegate;
|
|
21
|
+
status: ConnectionStatus;
|
|
10
22
|
private logging;
|
|
23
|
+
private serialSession;
|
|
11
24
|
private remoteDeviceId;
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
private disconnectPromise;
|
|
26
|
+
private serialSessionOpen;
|
|
27
|
+
private ignoreDelegateStatus;
|
|
28
|
+
private delegateStatusListener;
|
|
29
|
+
constructor(delegate: MicrobitWebUSBConnection, options?: MicrobitRadioBridgeConnectionOptions);
|
|
30
|
+
getBoardVersion(): BoardVersion | undefined;
|
|
31
|
+
serialWrite(data: string): Promise<void>;
|
|
32
|
+
initialize(): Promise<void>;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
clearDevice(): void;
|
|
35
|
+
setRemoteDeviceId(remoteDeviceId: number): void;
|
|
36
|
+
connect(): Promise<ConnectionStatus>;
|
|
20
37
|
disconnect(): Promise<void>;
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
reconnect(finalAttempt?: boolean): Promise<void>;
|
|
25
|
-
private sendCmdWaitResponse;
|
|
26
|
-
private handshake;
|
|
38
|
+
private log;
|
|
39
|
+
private setStatus;
|
|
40
|
+
private statusFromDelegate;
|
|
27
41
|
}
|
|
28
|
-
export declare const startSerialConnection: (logging: Logging, usb: MicrobitWebUSBConnection, remoteDeviceId: number) => Promise<MicrobitRadioBridgeConnection | undefined>;
|