Socket
Socket
Sign inDemoInstall

modbus-serial

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modbus-serial - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

t.js

1

index.d.ts

@@ -6,2 +6,3 @@ declare namespace ModbusRTU {

open(callback: Function): void;
close(callback: Function): void;

@@ -8,0 +9,0 @@ writeFC1(address: number, dataAddress: number, length: number, next: NodeStyleCallback<ReadCoilResult>): void;

@@ -275,2 +275,13 @@ 'use strict';

/**
* Close the serial port
*
* @param {Function} callback the function to call next on close success
* or failure.
*/
ModbusRTU.prototype.close = function (callback) {
// close the serial port
this._port.close(callback);
};
/**
* Write a Modbus "Read Coil Status" (FC=01) to serial port.

@@ -277,0 +288,0 @@ *

2

package.json
{
"name": "modbus-serial",
"version": "4.1.0",
"version": "4.2.0",
"description": "A pure JavaScript implemetation of MODBUS-RTU (and TCP) for NodeJS.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -21,2 +21,12 @@ 'use strict';

describe('#close() - close serial port.', function () {
it('should close the port without errors', function (done) {
modbusRTU.close(function(err) {
expect(err).to.be.a('null');
done();
});
});
});
describe('#writeFC3() - read holding registers.', function () {

@@ -23,0 +33,0 @@ it('should read 3 registers [0xa12b, 0xffff, 0xb21a] without errors', function (done) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc