modbus-rs 0.15.2 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +32 -0
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -251,6 +251,38 @@ export declare class AsyncSerialModbusClient {
|
|
|
251
251
|
* Use the static `bindRtu` or `bindAscii` methods to create and start a server instance.
|
|
252
252
|
*/
|
|
253
253
|
export declare class AsyncSerialModbusServer {
|
|
254
|
+
/**
|
|
255
|
+
* Creates and starts a new Modbus RTU server on a serial port.
|
|
256
|
+
*
|
|
257
|
+
* @param opts Server configuration options.
|
|
258
|
+
* @param opts.portPath The path to the serial port (e.g., '/dev/ttyUSB0', 'COM3').
|
|
259
|
+
* @param opts.baudRate The communication speed (e.g., 9600, 19200).
|
|
260
|
+
* @param opts.unitId The Modbus unit ID the server will respond to.
|
|
261
|
+
* @param opts.dataBits Optional number of data bits (5, 6, 7, or 8). Defaults to 8.
|
|
262
|
+
* @param opts.parity Optional parity setting ('none', 'even', 'odd'). Defaults to 'none'.
|
|
263
|
+
* @param opts.stopBits Optional number of stop bits (1 or 2). Defaults to 1.
|
|
264
|
+
* @param opts.responseTimeoutMs Optional response timeout in milliseconds. Defaults to 1000.
|
|
265
|
+
*
|
|
266
|
+
* @param handlers An object containing callback functions to handle Modbus requests (matches the `ServerHandlers` interface in TypeScript).
|
|
267
|
+
* @returns A `Promise` that resolves to a running `AsyncSerialModbusServer` instance.
|
|
268
|
+
*/
|
|
269
|
+
static bindRtu(opts: SerialServerOptions, handlers: ServerHandlers): Promise<AsyncSerialModbusServer>
|
|
270
|
+
/**
|
|
271
|
+
* Creates and starts a new Modbus ASCII server on a serial port.
|
|
272
|
+
*
|
|
273
|
+
* @param opts Server configuration options.
|
|
274
|
+
* @param opts.portPath The path to the serial port (e.g., '/dev/ttyUSB0', 'COM3').
|
|
275
|
+
* @param opts.baudRate The communication speed (e.g., 9600, 19200).
|
|
276
|
+
* @param opts.unitId The Modbus unit ID the server will respond to.
|
|
277
|
+
* @param opts.dataBits Optional number of data bits (7 or 8). Defaults to 8.
|
|
278
|
+
* @param opts.parity Optional parity setting ('none', 'even', 'odd'). Defaults to 'none'.
|
|
279
|
+
* @param opts.stopBits Optional number of stop bits (1 or 2). Defaults to 1.
|
|
280
|
+
* @param opts.responseTimeoutMs Optional response timeout in milliseconds. Defaults to 1000.
|
|
281
|
+
*
|
|
282
|
+
* @param handlers An object containing callback functions to handle Modbus requests (matches the `ServerHandlers` interface in TypeScript).
|
|
283
|
+
* @returns A `Promise` that resolves to a running `AsyncSerialModbusServer` instance.
|
|
284
|
+
*/
|
|
285
|
+
static bindAscii(opts: SerialServerOptions, handlers: ServerHandlers): Promise<AsyncSerialModbusServer>
|
|
254
286
|
/**
|
|
255
287
|
* Stops the server.
|
|
256
288
|
* Stops the server and closes the serial port.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modbus-rs",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"description": "High-performance Modbus TCP/RTU/ASCII client, server and gateway for Node.js, powered by Rust",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {},
|
|
66
66
|
"optionalDependencies": {
|
|
67
|
-
"modbus-rs-win32-x64-msvc": "0.15.
|
|
68
|
-
"modbus-rs-linux-x64-gnu": "0.15.
|
|
69
|
-
"modbus-rs-darwin-x64": "0.15.
|
|
70
|
-
"modbus-rs-darwin-arm64": "0.15.
|
|
71
|
-
"modbus-rs-linux-arm64-gnu": "0.
|
|
67
|
+
"modbus-rs-win32-x64-msvc": "0.15.3",
|
|
68
|
+
"modbus-rs-linux-x64-gnu": "0.15.3",
|
|
69
|
+
"modbus-rs-darwin-x64": "0.15.3",
|
|
70
|
+
"modbus-rs-darwin-arm64": "0.15.3",
|
|
71
|
+
"modbus-rs-linux-arm64-gnu": "0.1532"
|
|
72
72
|
}
|
|
73
73
|
}
|