UNPKG

sim800

Version:

A modern and opiniated module for SIM800 GSM modems ( SIM800 / SIM800L ).

34 lines (33 loc) 1.45 kB
import { AsyncSubject, Subscription } from 'rxjs'; import { Sim800CommandInput } from '../interfaces/sim800-command-input.interface'; import { Sim800CommandState } from '../interfaces/sim800-command-state.enum'; import { Sim800Client } from '../sim800.client'; import { SerialPort } from 'serialport'; export declare class Sim800Command { command: Sim800CommandInput['command']; arg?: string; state: Sim800CommandState; pid: number; completed$: AsyncSubject<number>; protected completeWhen: Sim800CommandInput['completeWhen']; protected errorWhen: Sim800CommandInput['errorWhen']; protected expectedData: Sim800CommandInput['expectedData']; protected ack: boolean; protected isInput?: boolean; result: string | null; raw: string[]; error: Error | null; protected observer: Sim800CommandInput['observer']; protected subscription?: Subscription; protected timeoutMs: number; constructor(input: Sim800CommandInput); send(stream$: Sim800Client['stream$'], serial: SerialPort): Promise<void>; isDataPartOfRunningCommand(data: string): boolean | undefined; protected execute(stream$: Sim800Client['stream$'], serial: SerialPort): void; protected complete(state?: Sim800CommandState): void; protected setResult(data: string): void; protected setError(error: Error): void; private handleCompletedWhen; private handleErrorWhen; private isDataExpected; }