Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"globals": "^16.4.0",
"husky": "^7.0.4",
"mocha": "^11.7.2",
"prettier": "3.3.3",
"prettier": "3.0.0",
"pretty-quick": "^4.0.0",
"sinon": "11.1.1",
"source-map-support": "^0.5.20",
Expand Down
8 changes: 4 additions & 4 deletions packages/binding-modbus/src/modbus-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,17 @@ export default class ModbusClient implements ProtocolClient {
mode === "r"
? ModbusFunction.readCoil
: contentLength > 1
? ModbusFunction.writeMultipleCoils
: ModbusFunction.writeSingleCoil;
? ModbusFunction.writeMultipleCoils
: ModbusFunction.writeSingleCoil;
break;
case "HoldingRegister":
// the content length must be divided by 2 (holding registers are 16bit)
result["modv:function"] =
mode === "r"
? ModbusFunction.readHoldingRegisters
: contentLength / 2 > 1
? ModbusFunction.writeMultipleHoldingRegisters
: ModbusFunction.writeSingleHoldingRegister;
? ModbusFunction.writeMultipleHoldingRegisters
: ModbusFunction.writeSingleHoldingRegister;
break;
case "InputRegister":
result["modv:function"] = ModbusFunction.readInputRegister;
Expand Down
4 changes: 2 additions & 2 deletions packages/binding-opcua/src/opcua-protocol-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,8 @@ export class OPCUAProtocolClient implements ProtocolClient {
valueRank === -1
? VariantArrayType.Scalar
: valueRank === 1
? VariantArrayType.Array
: VariantArrayType.Matrix;
? VariantArrayType.Array
: VariantArrayType.Matrix;

const n = (a: unknown) => Buffer.from(JSON.stringify(a));
const v = await this._contentToVariant(content2.type, n(bodyInput[name ?? "null"]), basicDataType);
Expand Down
20 changes: 10 additions & 10 deletions packages/core/src/codecs/octetstream-codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,26 +183,26 @@ export default class OctetstreamCodec implements ContentCodec {
? bytes.readInt16BE(0)
: bytes.readUInt16BE(0)
: signed
? bytes.readInt16LE(0)
: bytes.readUInt16LE(0);
? bytes.readInt16LE(0)
: bytes.readUInt16LE(0);

case 32:
return bigEndian
? signed
? bytes.readInt32BE(0)
: bytes.readUInt32BE(0)
: signed
? bytes.readInt32LE(0)
: bytes.readUInt32LE(0);
? bytes.readInt32LE(0)
: bytes.readUInt32LE(0);

default: {
const result = bigEndian
? signed
? bytes.readIntBE(0, dataLength / 8)
: bytes.readUIntBE(0, dataLength / 8)
: signed
? bytes.readIntLE(0, dataLength / 8)
: bytes.readUIntLE(0, dataLength / 8);
? bytes.readIntLE(0, dataLength / 8)
: bytes.readUIntLE(0, dataLength / 8);
// warn about numbers being too big to be represented as safe integers
if (!Number.isSafeInteger(result)) {
warn("Result is not a safe integer");
Expand Down Expand Up @@ -460,8 +460,8 @@ export default class OctetstreamCodec implements ContentCodec {
? buf.writeInt16BE(value, 0)
: buf.writeUInt16BE(value, 0)
: signed
? buf.writeInt16LE(value, 0)
: buf.writeUInt16LE(value, 0);
? buf.writeInt16LE(value, 0)
: buf.writeUInt16LE(value, 0);
break;

case 4:
Expand All @@ -470,8 +470,8 @@ export default class OctetstreamCodec implements ContentCodec {
? buf.writeInt32BE(value, 0)
: buf.writeUInt32BE(value, 0)
: signed
? buf.writeInt32LE(value, 0)
: buf.writeUInt32LE(value, 0);
? buf.writeInt32LE(value, 0)
: buf.writeUInt32LE(value, 0);
break;

default:
Expand Down