forked from Blendman974/faceclaw
Partial support for Rayneo iO
This commit is contained in:
1 parent
742a5a3f81
commit
4d101eefe1
23 files changed
+1954
-69
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import type { GlassesType } from "../ui/dashboard-settings";
|
||||
import type { RingInput } from "../g2/ring-input";
|
||||
import { File, knownFolders, path, type ImageSource } from "@nativescript/core";
|
||||
import { REQUIRED_FACECLAW_FIRMWARE_VERSION, type FirmwareInfo } from "../g2/firmware-compat";
|
||||
@@ -241,7 +242,10 @@ export class FaceclawCommunicatorBridge {
|
||||
return FaceclawCommunicatorBridge.active;
|
||||
}
|
||||
|
||||
constructor(addresses: { right: string; left: string; ring?: string; ringRole?: string }) {
|
||||
constructor(addresses: { right: string; left: string; ring?: string; ringRole?: string; glassesType?: GlassesType }) {
|
||||
if (addresses.glassesType === "rayneo-io") {
|
||||
throw new Error("RayNeo iO glasses are not supported on iOS yet.");
|
||||
}
|
||||
this.communicator = FaceclawKitIosGlassesSession.alloc().initWithRightAddressLeftAddressRingAddress(
|
||||
String(addresses.right ?? "").toUpperCase(),
|
||||
String(addresses.left ?? "").toUpperCase(),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { GlassesType } from "../ui/dashboard-settings";
|
||||
import type { RingInput } from "../g2/ring-input";
|
||||
import { ImageSource, Utils } from "@nativescript/core";
|
||||
import * as frameTimings from "./frame-timings";
|
||||
@@ -161,7 +162,7 @@ export class FaceclawCommunicatorBridge {
|
||||
private readonly firmwareInfoListeners = new Set<(info: FirmwareInfo) => void>();
|
||||
private readonly previewAnimationListeners = new Set<() => void>();
|
||||
|
||||
constructor(addresses: { right: string; left: string; ring?: string; ringRole?: string }) {
|
||||
constructor(addresses: { right: string; left: string; ring?: string; ringRole?: string; glassesType?: GlassesType }) {
|
||||
const context = Utils.android.getApplicationContext();
|
||||
if (!context) throw new Error("Android application context unavailable");
|
||||
|
||||
@@ -173,6 +174,8 @@ export class FaceclawCommunicatorBridge {
|
||||
);
|
||||
// The shared session halts on any other firmware ("incompatible-firmware").
|
||||
this.communicator.setRequiredFirmwareRevision(REQUIRED_FACECLAW_FIRMWARE_VERSION);
|
||||
// RayNeo iO: one link (its address in both arm slots), its own handshake and page lease.
|
||||
if (addresses.glassesType === "rayneo-io") this.communicator.useRayNeoIo();
|
||||
// Which R1 role the direct ring link claims; only matters with a ring address.
|
||||
if (addresses.ringRole) this.communicator.setDirectRingRole(addresses.ringRole);
|
||||
this.listenerProxy = new com.faceclaw.app.FaceclawBleCommunicatorListener({
|
||||
|
||||
Reference in new issue
Block a user