/** * (c) 2026, Micro:bit Educational Foundation and contributors * * Derived from dapjs (https://github.com/ARMmbed/dapjs) which is * Copyright (c) Arm Limited 2018 * Copyright (c) Microsoft Corporation * * SPDX-License-Identifier: MIT * * See arm-debug.ts for the full dapjs license. * * WebUSB transport layer. Handles opening/closing the USB interface, * finding the correct CMSIS-DAP endpoints, and reading/writing raw packets. * * This is the lowest layer in the USB stack, sitting beneath the CMSIS-DAP * protocol layer. It knows nothing about DAP commands — it just moves * fixed-size packets between the host and the USB device. * * micro:bit V2 uses CMSIS-DAP v2 (bulk endpoints). micro:bit V1 uses * CMSIS-DAP v1 (HID) which has no bulk endpoints — we fall back to * control transfers (SET_REPORT/GET_REPORT) in that case. */ export declare const PACKET_SIZE = 64; export interface Transport { readonly isOpen: boolean; open(): Promise; close(): Promise; read(): Promise; write(data: Uint8Array): Promise; } export declare class UsbTransport implements Transport { private device; private interfaceNumber?; private endpointIn?; private endpointOut?; constructor(device: USBDevice); get isOpen(): boolean; open(): Promise; close(): Promise; read(): Promise; write(data: Uint8Array): Promise; }