@nativescript-community/nordic-dfu
Version:
A NativeScript plugin for performing Nordic Bluetooth device firmware updates.
32 lines • 1.26 kB
JavaScript
import { Observable } from '@nativescript/core';
export var DfuState;
(function (DfuState) {
DfuState[DfuState["CONNECTING"] = 0] = "CONNECTING";
DfuState[DfuState["DFU_PROCESS_STARTING"] = 1] = "DFU_PROCESS_STARTING";
DfuState[DfuState["ENABLING_DFU_MODE"] = 2] = "ENABLING_DFU_MODE";
DfuState[DfuState["FIRMWARE_VALIDATING"] = 3] = "FIRMWARE_VALIDATING";
DfuState[DfuState["DEVICE_DISCONNECTING"] = 4] = "DEVICE_DISCONNECTING";
DfuState[DfuState["DFU_COMPLETED"] = 5] = "DFU_COMPLETED";
DfuState[DfuState["DFU_ABORTED"] = 6] = "DFU_ABORTED";
DfuState[DfuState["DFU_FAILED"] = 7] = "DFU_FAILED";
})(DfuState || (DfuState = {}));
export class DFUInitiatorCommon extends Observable {
constructor(peripheralUUID) {
super();
this.mPeripheralUUID = peripheralUUID;
}
get peripheralUUID() {
return this.mPeripheralUUID;
}
_notifyDfuStateChanged(state, reason) {
this.notify({
eventName: DFUInitiatorCommon.dfuStateChangedEvent,
object: this,
state: state,
reason,
});
}
}
DFUInitiatorCommon.dfuStateChangedEvent = 'DFUStateChanged';
DFUInitiatorCommon.dfuProgressEvent = 'DFUProgress';
//# sourceMappingURL=common.js.map