Switch from capability strings to numeric versioning for firmwares

This commit is contained in:
James Babcock committed 2026-09-11 00:22:36 -07:00
1 parent a57b3b2cbc
commit b0cf1e4f67
19 files changed
+293 -236

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
/**
* Ambient light sensor access through the custom firmware (CFW image-handler
* mode 16, capability token "als16"; see g2flash/patches/als_sensor.c).
* mode 16; see g2flash/patches/als_sensor.c).
*
* The stock firmware only reads its OPT3001 light sensor while auto-brightness
* is on, and then steps the panel brightness itself (visible flicker). The CFW
+6 -8
View File
@@ -1,19 +1,17 @@
import { Utils } from "@nativescript/core";
import { type FirmwareInfo } from "../g2/firmware-compat";
declare const com: any;
export type DeviceInfo = {
leftVersion: string;
rightVersion: string;
capabilities: string;
};
export type DeviceInfo = FirmwareInfo;
export type DeviceInfoState = "connecting" | "authenticating" | "querying";
/**
* TS wrapper around the native FaceclawDeviceInfoProbe — a one-shot,
* stock-compatible connect + firmware/device-info read. `run()` resolves with
* the firmware versions and CFW capability string, or rejects on failure.
* the firmware versions and the firmware-extension string, or rejects on failure.
*/
export class DeviceInfoProbe {
private readonly probe: any;
@@ -34,11 +32,11 @@ export class DeviceInfoProbe {
onLog: (line: string) => this.emit(this.logListeners, String(line)),
onState: (state: string, detail: string) =>
this.emit(this.stateListeners, String(state) as DeviceInfoState, String(detail ?? "")),
onResult: (leftVersion: string, rightVersion: string, capabilities: string) =>
onResult: (leftVersion: string, rightVersion: string, extension: string) =>
this.settle(null, {
leftVersion: String(leftVersion),
rightVersion: String(rightVersion),
capabilities: String(capabilities),
extension: String(extension),
}),
onError: (message: string) => this.settle(new Error(String(message)), null),
});
+6 -8
View File
@@ -32,11 +32,9 @@ export type FrameMetrics = {
tileCount: number;
};
export type FirmwareInfo = {
leftVersion: string;
rightVersion: string;
capabilities: string;
};
import { type FirmwareInfo } from "../g2/firmware-compat";
export type { FirmwareInfo };
/**
* Compositor surface configuration. Position/size are in screen pixels;
@@ -230,11 +228,11 @@ export class FaceclawCommunicatorBridge {
onFrameFinished: (frameId: number, outcome: string) => {
this.recordFrameFinished(Number(frameId), String(outcome));
},
onFirmwareInfo: (leftVersion: string, rightVersion: string, capabilities: string) => {
const info = {
onFirmwareInfo: (leftVersion: string, rightVersion: string, extension: string) => {
const info: FirmwareInfo = {
leftVersion: String(leftVersion),
rightVersion: String(rightVersion),
capabilities: String(capabilities),
extension: String(extension),
};
this.emitAsync(this.firmwareInfoListeners, info);
},