2024-05-23 22:49:18 +00:00
|
|
|
import type { Settings } from 'settings';
|
|
|
|
import type { Arduino } from 'arduino';
|
2024-05-23 23:54:42 +00:00
|
|
|
import type { BrowserWindow } from 'electron';
|
|
|
|
interface Device {
|
|
|
|
serial: string;
|
|
|
|
device: string;
|
|
|
|
}
|
2024-05-24 19:23:58 +00:00
|
|
|
/** @module lib/devices */
|
2024-05-23 22:49:18 +00:00
|
|
|
/**
|
2024-05-24 19:23:58 +00:00
|
|
|
* Class representing the device discovery features.
|
|
|
|
*/
|
2024-05-23 22:49:18 +00:00
|
|
|
export declare class Devices {
|
|
|
|
settings: Settings;
|
|
|
|
connected: any;
|
|
|
|
private arduino;
|
|
|
|
private log;
|
|
|
|
private ui;
|
|
|
|
private ipc;
|
|
|
|
private mainWindow;
|
|
|
|
/**
|
|
|
|
* Constructor assigns arduino, settings, UI browser window and cam objects
|
|
|
|
* locally to this class for reference.
|
|
|
|
**/
|
2024-05-23 23:54:42 +00:00
|
|
|
constructor(arduino: Arduino, settings: Settings, mainWindow: BrowserWindow);
|
2024-05-23 22:49:18 +00:00
|
|
|
/**
|
|
|
|
* Initialize the log for "devices". Establish an ipc connection to the UI.
|
|
|
|
* Start listening on that ipc connection.
|
|
|
|
**/
|
|
|
|
private init;
|
|
|
|
/**
|
|
|
|
* Listen to the "profile" channel for messages from the UI.
|
|
|
|
**/
|
|
|
|
private listen;
|
|
|
|
/**
|
|
|
|
* The "profile" channel callback. If a profile is changed, set it in the
|
|
|
|
* local settings object.
|
|
|
|
**/
|
|
|
|
private listener;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
enumerate(): Promise<boolean>;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private favor;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private distinguish;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private fakeProjector;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private fakeCamera;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private fakeLight;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private fakeCapper;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private connectDevice;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private all;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private remember;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
private ready;
|
|
|
|
}
|
2024-05-23 23:54:42 +00:00
|
|
|
export type { Device };
|