Skip to content

Commit 6e758cf

Browse files
Add DeviceRadioBridgeConnection interface
1 parent 42a5480 commit 6e758cf

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

lib/device.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,12 @@ export interface DeviceWebBluetoothConnection extends DeviceConnection {
262262
*/
263263
setNameFilter(name: string): void;
264264
}
265+
266+
export interface DeviceRadioBridgeConnection extends DeviceConnection {
267+
/**
268+
* Sets remote device.
269+
*
270+
* @param deviceId The device id of remote micro:bit.
271+
*/
272+
setRemoteDeviceId(deviceId: number): void;
273+
}

lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
DeviceConnectionEventMap,
1313
DeviceError,
1414
DeviceErrorCode,
15+
DeviceRadioBridgeConnection,
1516
DeviceWebBluetoothConnection,
1617
DeviceWebUSBConnection,
1718
FlashDataError,
@@ -59,6 +60,7 @@ export type {
5960
ButtonState,
6061
DeviceConnection,
6162
DeviceErrorCode,
63+
DeviceRadioBridgeConnection,
6264
DeviceWebBluetoothConnection,
6365
DeviceWebUSBConnection,
6466
FlashOptions,

lib/usb-radio-bridge.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
BoardVersion,
1111
ConnectionStatus,
1212
ConnectionStatusEvent,
13-
DeviceConnection,
1413
DeviceConnectionEventMap,
14+
DeviceRadioBridgeConnection,
1515
SerialDataEvent,
1616
SerialErrorEvent,
1717
} from "./device.js";
@@ -48,7 +48,7 @@ interface ConnectCallbacks {
4848
*/
4949
export class MicrobitRadioBridgeConnection
5050
extends TypedEventTarget<DeviceConnectionEventMap & ServiceConnectionEventMap>
51-
implements DeviceConnection
51+
implements DeviceRadioBridgeConnection
5252
{
5353
status: ConnectionStatus;
5454
private logging: Logging;

0 commit comments

Comments
 (0)