forked from yaacov/node-modbus-serial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServerSerial.d.ts
More file actions
23 lines (20 loc) · 797 Bytes
/
ServerSerial.d.ts
File metadata and controls
23 lines (20 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as events from 'events';
import * as stream from 'stream';
import { SerialPortOpenOptions } from 'serialport';
import { FCallback, IServiceVector } from './ServerTCP';
import { ErrorCallback } from '@serialport/stream';
export class ServerSerial extends events.EventEmitter {
socks: Map<stream.Transform, 0>;
constructor(vector: IServiceVector, options: IServerSerialOptions);
close(cb: FCallback): void;
}
type IServerSerialOptions = SerialPortOpenOptions<any> & {
debug?: boolean,
unitID?: number,
openCallback?: ErrorCallback
}
export declare interface ServerSerial {
on(event: 'socketError', listener: FCallback): this;
on(event: 'error', listener: FCallback): this;
on(event: 'initialized', listener: FCallback): this;
}