UNPKG

@robotical/ricjs

Version:

Javascript/TS library for Robotical RIC

36 lines (35 loc) 1.32 kB
import RICChannel from "./RICChannel"; import RICMsgHandler from "./RICMsgHandler"; import { RICConnEventFn } from "./RICConnEvents"; export default class RICChannelWebSerial implements RICChannel { private _ricMsgHandler; private _port; private _reader?; private _isConnected; private _connPaused; private _serialBuffer; private _escapeSeqCode; private _OVERASCII_ESCAPE_1; private _OVERASCII_ESCAPE_2; private _OVERASCII_ESCAPE_3; private _OVERASCII_MOD_CODE; private _onConnEvent; private _requestedBatchAckSize; private _requestedFileBlockSize; fhBatchAckSize(): number; fhFileBlockSize(): number; isConnected(): boolean; setMsgHandler(ricMsgHandler: RICMsgHandler): void; requiresSubscription(): boolean; setOnConnEvent(connEventFn: RICConnEventFn): void; getConnectedLocator(): string | object; connect(locator: string | object): Promise<boolean>; disconnect(): Promise<void>; pauseConnection(pause: boolean): void; private _overasciiDecodeByte; private _overasciiEncode; _onMsgRx(msg: Uint8Array | null): void; sendTxMsg(msg: Uint8Array, sendWithResponse: boolean): Promise<boolean>; sendTxMsgNoAwait(msg: Uint8Array, sendWithResponse: boolean): Promise<boolean>; _readLoop(): Promise<void>; }