39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
export type versionNotes = {
|
|
title: string;
|
|
date: Date | string;
|
|
link: string;
|
|
html: string;
|
|
};
|
|
export default class Updater {
|
|
archiveURL: string;
|
|
feedType: string;
|
|
bleObject: BLECentralPlugin.BLECentralPluginStatic;
|
|
protected bleDeviceId: string;
|
|
private readonly _updaterServiceUUID;
|
|
private readonly _updaterVersionCharactersiticUUID;
|
|
private readonly _updaterCommandCharacterisitcUUID;
|
|
private readonly _updateFileCharacteristicUUID;
|
|
file: Int8Array;
|
|
private _fileSize;
|
|
private _fileProgress;
|
|
private _packetSize;
|
|
constructor(archiveURL?: string, feedType?: string, bleObject?: BLECentralPlugin.BLECentralPluginStatic, packetSize?: number);
|
|
private getRawArchive;
|
|
private atomGetVersionDetails;
|
|
private atomGetArchive;
|
|
private rssGetVersionDetails;
|
|
private rssGetArchive;
|
|
getArchive(): Promise<versionNotes[]>;
|
|
setDeviceId(id: string): void;
|
|
private bytesToString;
|
|
private readVersionNumber;
|
|
private getLatestVersion;
|
|
checkForUpdate(): Promise<boolean>;
|
|
getBoardVersion(): Promise<string>;
|
|
getFirmware(version: versionNotes): Promise<boolean>;
|
|
getFileSize(): number;
|
|
private sendNextPacket;
|
|
private sendEndCmd;
|
|
flashFirmware(progressCallback: (message: string) => void): Promise<boolean>;
|
|
}
|