UNPKG

@nativescript-community/nordic-dfu

Version:

A NativeScript plugin for performing Nordic Bluetooth device firmware updates.

31 lines (30 loc) 1.45 kB
import { Observable } from '@nativescript/core'; import { DfuServiceController } from './serviceController'; export declare enum DfuState { CONNECTING = 0, DFU_PROCESS_STARTING = 1, ENABLING_DFU_MODE = 2, FIRMWARE_VALIDATING = 3, DEVICE_DISCONNECTING = 4, DFU_COMPLETED = 5, DFU_ABORTED = 6, DFU_FAILED = 7 } export declare abstract class DFUInitiatorCommon extends Observable { static readonly dfuStateChangedEvent = "DFUStateChanged"; static readonly dfuProgressEvent = "DFUProgress"; protected readonly mPeripheralUUID: string; constructor(peripheralUUID: string); get peripheralUUID(): string; abstract setAndroidDeviceName(name: string): DFUInitiatorCommon; abstract setAndroidDisableNotification(val: boolean): DFUInitiatorCommon; abstract setAndroidForeground(val: boolean): DFUInitiatorCommon; abstract setAndroidKeepBond(val: boolean): DFUInitiatorCommon; abstract setForceDfu(val: boolean): DFUInitiatorCommon; abstract setForceScanningForNewAddressInLegacyDfu(val: boolean): DFUInitiatorCommon; abstract setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(val: boolean): DFUInitiatorCommon; abstract setPacketReceiptNotificationParameter(val: number): DFUInitiatorCommon; abstract disableResume(): DFUInitiatorCommon; abstract start(filePath: string): DfuServiceController; _notifyDfuStateChanged(state: DfuState, reason?: string): void; }