Skip to content

JSD: method reference ​

Methods you can use in your application. A void promise confirms command submission; device data and rejections arrive through events. Operations returning boolean or arrays wait for their specific results.

start ​

ts
public start(): void;

Starts the serial service.

Initiates connection to the Device if not already connected.

devicePortStatus ​

ts
public devicePortStatus(): SerialStatus;

Gets the current status of the serial service.

stop ​

ts
public async stop(): Promise<void>;

Stops the relay service and closes the serial connection.

listPorts ​

ts
public static listPorts(filter: PortFilter = {}): Promise<SerialPortInfo[]>;

Enumerate ports with exact AND-combined filters, without opening or reserving them.

findPorts ​

ts
public static findPorts(filter: PortFilter = {}): Promise<SerialPortInfo[]>;

Find all matching ports; equivalent to listPorts(). Enumeration errors reject.

listPorts ​

ts
public listPorts(filter: PortFilter = {}): Promise<SerialPortInfo[]>;

Enumerate ports independently of this client's connection configuration.

findPorts ​

ts
public findPorts(filter: PortFilter = {}): Promise<SerialPortInfo[]>;

Find matching ports without changing this client's session.

getPortPath ​

ts
public getPortPath(): string | null;

Current physical port path, or null before opening and after cleanup.

transport ​

ts
public get transport(): string;

Get the name of current transport strategy.

Advanced internal integration reference

Use the methods above in your application. These hooks are reserved for low-level integrations.

connection ​

ts
public connection(): number[];

Generate connection packet.

_toQueue ​

ts
public _toQueue(
    data: BuildPacketResult,
    options?: {
      alias?: string;
      timeout?: number;
      waitResponse?: boolean;
    }
  ): void;

Internal submission hook used by the JSD applications.

Explicit protocol, typed events, isolated transport.