import { TimeoutOptions } from "@capacitor-community/bluetooth-le"; import MemoryMap from "nrf-intel-hex"; import { BluetoothDeviceWrapper } from "../device-wrapper.js"; export declare const enum MicroBitMode { Pairing = 0, Application = 1 } export declare const enum RegionId { SoftDevice = 0, Dal = 1, MakeCode = 2 } export interface RegionInfo { start: number; end: number; hash: string; } export declare const enum PacketState { Retransmit = 170, Success = 255 } /** * Doesn't actually implement service as we don't expose this other than via * the flash method. */ export declare class PartialFlashingService { private connection; constructor(connection: BluetoothDeviceWrapper); startNotifications(options?: TimeoutOptions): Promise; stopNotifications(): Promise; resetToMode(mode: MicroBitMode): Promise; getRegionInfo(region: RegionId): Promise; /** * Writes a flash chunk. * Use writeFlashForNotification for every 4th chunk. */ writeFlash(source: MemoryMap, batchAddress: number, dataOffset: number, packetNumber: number, packetInBatch: number): Promise; /** * Write a chunk and wait for a success/retransmit response. * The micro:bit notifies on every 4th chunk. */ writeFlashForNotification(source: MemoryMap, batchAddress: number, dataOffset: number, packetNumber: number, packetInBatch: number): Promise; writeEndOfFlashPacket(): Promise; private createWriteDataCommand; }