@enyo-energy/sunspec-sdk 0.0.85 → 0.0.86
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/dist/cjs/sunspec-modbus-client.cjs +14 -0
- package/dist/cjs/sunspec-modbus-client.d.cts +13 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/sunspec-modbus-client.d.ts +13 -0
- package/dist/sunspec-modbus-client.js +14 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -365,6 +365,20 @@ class SunspecModbusClient {
|
|
|
365
365
|
throw new Error(`Modbus instance for unit ${unitId} not initialized — call connect(host, port, ${unitId}) first`);
|
|
366
366
|
return inst;
|
|
367
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* Expose this client's open Modbus connection for a unit so a co-located driver can
|
|
370
|
+
* share the SAME TCP socket instead of opening a second one. This matters for devices
|
|
371
|
+
* behind single-connection bridges (e.g. the Solax ESP32 Pocket WiFi dongle, which
|
|
372
|
+
* resets the link when a second Modbus-TCP client connects): the driver reads its own
|
|
373
|
+
* function codes (e.g. FC04 input registers) over this socket.
|
|
374
|
+
*
|
|
375
|
+
* Throws if the unit isn't open. The connection's lifecycle stays owned by this client —
|
|
376
|
+
* borrowers MUST NOT call disconnect() on the returned instance; release it via
|
|
377
|
+
* disconnectUnit(unitId) / releaseSunspecClient() as usual.
|
|
378
|
+
*/
|
|
379
|
+
getModbusInstance(unitId) {
|
|
380
|
+
return this.getInstance(unitId);
|
|
381
|
+
}
|
|
368
382
|
/**
|
|
369
383
|
* Get the fault-tolerant reader for a unit, throwing if it isn't open.
|
|
370
384
|
*/
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type SunspecInverterControls, type SunspecInverterData, type SunspecInverterSettings, type SunspecMeterData, type SunspecModel, type SunspecMPPTData, type SunspecBatteryData, type SunspecBatteryBaseData, type SunspecBatteryControls, SunspecStorageMode } from "./sunspec-interfaces.cjs";
|
|
20
20
|
import { EnergyAppModbusDataType, IConnectionHealth } from "@enyo-energy/energy-app-sdk/dist/implementations/modbus/interfaces.js";
|
|
21
|
+
import { EnergyAppModbusInstance } from "@enyo-energy/energy-app-sdk/dist/packages/energy-app-modbus.js";
|
|
21
22
|
import { EnergyApp } from "@enyo-energy/energy-app-sdk";
|
|
22
23
|
/**
|
|
23
24
|
* Get (or create) the singleton SunspecModbusClient for this network device.
|
|
@@ -121,6 +122,18 @@ export declare class SunspecModbusClient {
|
|
|
121
122
|
* Get the EnergyAppModbusInstance for a unit, throwing if it isn't open.
|
|
122
123
|
*/
|
|
123
124
|
private getInstance;
|
|
125
|
+
/**
|
|
126
|
+
* Expose this client's open Modbus connection for a unit so a co-located driver can
|
|
127
|
+
* share the SAME TCP socket instead of opening a second one. This matters for devices
|
|
128
|
+
* behind single-connection bridges (e.g. the Solax ESP32 Pocket WiFi dongle, which
|
|
129
|
+
* resets the link when a second Modbus-TCP client connects): the driver reads its own
|
|
130
|
+
* function codes (e.g. FC04 input registers) over this socket.
|
|
131
|
+
*
|
|
132
|
+
* Throws if the unit isn't open. The connection's lifecycle stays owned by this client —
|
|
133
|
+
* borrowers MUST NOT call disconnect() on the returned instance; release it via
|
|
134
|
+
* disconnectUnit(unitId) / releaseSunspecClient() as usual.
|
|
135
|
+
*/
|
|
136
|
+
getModbusInstance(unitId: number): EnergyAppModbusInstance;
|
|
124
137
|
/**
|
|
125
138
|
* Get the fault-tolerant reader for a unit, throwing if it isn't open.
|
|
126
139
|
*/
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -9,7 +9,7 @@ exports.getSdkVersion = getSdkVersion;
|
|
|
9
9
|
/**
|
|
10
10
|
* Current version of the enyo Energy App SDK.
|
|
11
11
|
*/
|
|
12
|
-
exports.SDK_VERSION = '0.0.
|
|
12
|
+
exports.SDK_VERSION = '0.0.86';
|
|
13
13
|
/**
|
|
14
14
|
* Gets the current SDK version.
|
|
15
15
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type SunspecInverterControls, type SunspecInverterData, type SunspecInverterSettings, type SunspecMeterData, type SunspecModel, type SunspecMPPTData, type SunspecBatteryData, type SunspecBatteryBaseData, type SunspecBatteryControls, SunspecStorageMode } from "./sunspec-interfaces.js";
|
|
20
20
|
import { EnergyAppModbusDataType, IConnectionHealth } from "@enyo-energy/energy-app-sdk/dist/implementations/modbus/interfaces.js";
|
|
21
|
+
import { EnergyAppModbusInstance } from "@enyo-energy/energy-app-sdk/dist/packages/energy-app-modbus.js";
|
|
21
22
|
import { EnergyApp } from "@enyo-energy/energy-app-sdk";
|
|
22
23
|
/**
|
|
23
24
|
* Get (or create) the singleton SunspecModbusClient for this network device.
|
|
@@ -121,6 +122,18 @@ export declare class SunspecModbusClient {
|
|
|
121
122
|
* Get the EnergyAppModbusInstance for a unit, throwing if it isn't open.
|
|
122
123
|
*/
|
|
123
124
|
private getInstance;
|
|
125
|
+
/**
|
|
126
|
+
* Expose this client's open Modbus connection for a unit so a co-located driver can
|
|
127
|
+
* share the SAME TCP socket instead of opening a second one. This matters for devices
|
|
128
|
+
* behind single-connection bridges (e.g. the Solax ESP32 Pocket WiFi dongle, which
|
|
129
|
+
* resets the link when a second Modbus-TCP client connects): the driver reads its own
|
|
130
|
+
* function codes (e.g. FC04 input registers) over this socket.
|
|
131
|
+
*
|
|
132
|
+
* Throws if the unit isn't open. The connection's lifecycle stays owned by this client —
|
|
133
|
+
* borrowers MUST NOT call disconnect() on the returned instance; release it via
|
|
134
|
+
* disconnectUnit(unitId) / releaseSunspecClient() as usual.
|
|
135
|
+
*/
|
|
136
|
+
getModbusInstance(unitId: number): EnergyAppModbusInstance;
|
|
124
137
|
/**
|
|
125
138
|
* Get the fault-tolerant reader for a unit, throwing if it isn't open.
|
|
126
139
|
*/
|
|
@@ -360,6 +360,20 @@ export class SunspecModbusClient {
|
|
|
360
360
|
throw new Error(`Modbus instance for unit ${unitId} not initialized — call connect(host, port, ${unitId}) first`);
|
|
361
361
|
return inst;
|
|
362
362
|
}
|
|
363
|
+
/**
|
|
364
|
+
* Expose this client's open Modbus connection for a unit so a co-located driver can
|
|
365
|
+
* share the SAME TCP socket instead of opening a second one. This matters for devices
|
|
366
|
+
* behind single-connection bridges (e.g. the Solax ESP32 Pocket WiFi dongle, which
|
|
367
|
+
* resets the link when a second Modbus-TCP client connects): the driver reads its own
|
|
368
|
+
* function codes (e.g. FC04 input registers) over this socket.
|
|
369
|
+
*
|
|
370
|
+
* Throws if the unit isn't open. The connection's lifecycle stays owned by this client —
|
|
371
|
+
* borrowers MUST NOT call disconnect() on the returned instance; release it via
|
|
372
|
+
* disconnectUnit(unitId) / releaseSunspecClient() as usual.
|
|
373
|
+
*/
|
|
374
|
+
getModbusInstance(unitId) {
|
|
375
|
+
return this.getInstance(unitId);
|
|
376
|
+
}
|
|
363
377
|
/**
|
|
364
378
|
* Get the fault-tolerant reader for a unit, throwing if it isn't open.
|
|
365
379
|
*/
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED