modbus-rs-wasm 0.14.0 → 0.14.1

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/README.md CHANGED
@@ -18,44 +18,41 @@ No custom resolver aliases or configuration workarounds are required starting in
18
18
  When loading the package in browser environments without a bundler, import the web entry point and await the initialization promise:
19
19
 
20
20
  ```javascript
21
- import init, { WasmModbusClient } from 'modbus-rs-wasm/dist/web/modbus-rs.js';
21
+ import init, { WasmTcpTransport } from 'modbus-rs-wasm/dist/web/modbus-rs.js';
22
22
 
23
23
  await init();
24
- const client = new WasmModbusClient('ws://localhost:8502', 1, 5000, 3, 20);
24
+ const transport = new WasmTcpTransport('ws://localhost:8502', {
25
+ responseTimeoutMs: 5000,
26
+ retryAttempts: 3,
27
+ tickIntervalMs: 20
28
+ });
29
+ const client = transport.create_client({ unitId: 1 });
25
30
  ```
26
31
 
27
32
  ### Bundlers & Frameworks (Vite, SvelteKit, Next.js, etc.)
28
33
  When using modern bundlers, the root import automatically maps to the bundler target:
29
34
 
30
35
  ```javascript
31
- import { WasmModbusClient } from 'modbus-rs-wasm';
36
+ import { WasmTcpTransport } from 'modbus-rs-wasm';
32
37
  ```
33
38
  *(Make sure your bundler is configured to load WebAssembly, e.g., using `vite-plugin-wasm` and `vite-plugin-top-level-await` in Vite).*
34
39
 
40
+ ## Quick Start
35
41
 
36
- ## Quick Start (Modbus TCP via WebSocket Gateway)
37
-
38
- First, run the gateway [modbus-gateway](https://github.com/Raghava-Ch/modbus-gateway).
39
-
40
- ```javascript
41
- import { WasmModbusClient } from 'modbus-rs-wasm';
42
+ ### Examples
43
+ Ready-to-run HTML examples demonstrating both Modbus client and server functionality in the browser:
42
44
 
43
- async function readRegisters() {
44
- // Connect to a WebSocket proxy that forwards to a Modbus TCP device
45
- // (e.g. ws_url, unit_id, response_timeout_ms, retries, tick_interval_ms)
46
- const client = new WasmModbusClient('ws://localhost:8502', 1, 5000, 3, 20);
45
+ - **[wasm_client/network_smoke.html](./examples/wasm_client/network_smoke.html)**: WebSocket Modbus TCP client example.
46
+ - **[wasm_client/serial_smoke.html](./examples/wasm_client/serial_smoke.html)**: Web Serial Modbus RTU client example.
47
+ - **[wasm_server/network_smoke.html](./examples/wasm_server/network_smoke.html)**: WebSocket Modbus TCP server example.
48
+ - **[wasm_server/serial_smoke.html](./examples/wasm_server/serial_smoke.html)**: Web Serial Modbus RTU server example.
47
49
 
48
- try {
49
- // Read 10 holding registers starting at address 0
50
- const registers = await client.read_holding_registers(0, 10);
51
- console.log('Holding registers:', registers); // Uint16Array
52
- } catch (error) {
53
- console.error('Failed to read registers:', error);
54
- }
55
- }
50
+ To run the examples locally:
51
+ ```bash
52
+ npx serve examples/
56
53
  ```
57
54
 
58
- ## Quick Start (Modbus RTU via Web Serial)
55
+ ### Modbus RTU via Web Serial
59
56
 
60
57
  *Web Serial requires a Chromium-based browser (Chrome, Edge, Opera) and must be initiated by a user gesture (e.g., button click).*
61
58
 
@@ -64,19 +61,29 @@ If you are using modbus-rs on Node.js, you can use the native [`modbus-rs`](http
64
61
  If you have limitation on serial port using browser, then you may be interested in connecting serial port over ws/tcp so you can use the gateway application [modbus-gateway](https://github.com/Raghava-Ch/modbus-gateway).
65
62
 
66
63
  ```javascript
67
- import { request_serial_port, WasmSerialModbusClient } from 'modbus-rs-wasm';
64
+ import { request_serial_port, WasmSerialTransport } from 'modbus-rs-wasm';
68
65
 
69
66
  document.getElementById('connect-btn').addEventListener('click', async () => {
70
67
  try {
71
68
  // 1. Prompt user to select a serial port
72
69
  const portHandle = await request_serial_port();
73
70
 
74
- // 2. Connect client (handle, unit_id, mode, baud, data_bits, stop_bits, parity, timeout, retries, tick)
75
- const client = new WasmSerialModbusClient(
76
- portHandle, 1, 'rtu', 19200, 8, 1, 'even', 1000, 3, 20
77
- );
78
-
79
- // 3. Read coils
71
+ // 2. Create RTU Transport
72
+ const transport = new WasmSerialTransport(portHandle, {
73
+ mode: 'rtu',
74
+ baudRate: 19200,
75
+ dataBits: 8,
76
+ stopBits: 1,
77
+ parity: 'even',
78
+ responseTimeoutMs: 1000,
79
+ retryAttempts: 3,
80
+ tickIntervalMs: 20
81
+ });
82
+
83
+ // 3. Spawn a client for a specific slave (Unit ID)
84
+ const client = transport.create_client({ unitId: 10 });
85
+
86
+ // 4. Read coils
80
87
  const coils = await client.read_coils(0, 8);
81
88
  console.log('Coils:', coils); // Uint8Array
82
89
 
@@ -86,6 +93,101 @@ document.getElementById('connect-btn').addEventListener('click', async () => {
86
93
  });
87
94
  ```
88
95
 
96
+ ### Modbus TCP via WebSocket Gateway
97
+ First, run the gateway [modbus-gateway](https://github.com/Raghava-Ch/modbus-gateway).
98
+
99
+ ```javascript
100
+ import { WasmTcpTransport } from 'modbus-rs-wasm';
101
+
102
+ async function readRegisters() {
103
+ // 1. Connect to a WebSocket proxy that forwards to a Modbus TCP device
104
+ const transport = new WasmTcpTransport('ws://localhost:8502', {
105
+ responseTimeoutMs: 5000,
106
+ retryAttempts: 3,
107
+ tickIntervalMs: 20
108
+ });
109
+
110
+ // 2. Spawn a client attached to Unit ID 1
111
+ const client = transport.create_client({ unitId: 1 });
112
+
113
+ try {
114
+ // 3. Read 10 holding registers starting at address 0
115
+ const registers = await client.read_holding_registers(0, 10);
116
+ console.log('Holding registers:', registers); // Uint16Array
117
+ } catch (error) {
118
+ console.error('Failed to read registers:', error);
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### Modbus server demo with modbus-rs-wasm
124
+
125
+ The `modbus-rs-wasm` package also provides building blocks for server simulation inside the browser. You can instantiate a `WasmTcpServer` or `WasmSerialServer` by providing a configuration and a JavaScript callback to process incoming requests.
126
+
127
+ Here is a quick example of setting up a simulated server via a WebSocket TCP gateway:
128
+
129
+ ```javascript
130
+ import { WasmTcpGatewayConfig, WasmTcpServer } from 'modbus-rs-wasm';
131
+
132
+ async function simulateServer() {
133
+ // 1. Configure the server (e.g., pointing to a WebSocket gateway)
134
+ const config = new WasmTcpGatewayConfig("ws://localhost:8080");
135
+
136
+ // 2. Create the server and define the request handler
137
+ const server = new WasmTcpServer(config, async (request) => {
138
+ console.log("Received Modbus request:", request);
139
+
140
+ // Simulate processing the request
141
+ // The handler can be fully asynchronous and return a Promise
142
+ return {
143
+ // Return appropriate response fields based on the request
144
+ success: true,
145
+ data: [100, 200, 300]
146
+ };
147
+ });
148
+
149
+ // 3. Start the server
150
+ server.start();
151
+
152
+ // Observe the server status
153
+ console.log("Server running:", server.is_running());
154
+ console.log("Server status:", server.status_snapshot());
155
+ }
156
+ ```
157
+
158
+ ### Serial Server Simulation
159
+
160
+ You can also create a simulated serial server (RTU or ASCII) and attach a browser `SerialPort` to it using the Web Serial API:
161
+
162
+ ```javascript
163
+ import { WasmSerialServerConfig, WasmSerialServer } from 'modbus-rs-wasm';
164
+
165
+ async function simulateSerialServer() {
166
+ // 1. Request a serial port from the user (requires user gesture)
167
+ const port = await navigator.serial.requestPort();
168
+
169
+ // 2. Configure the server for RTU or ASCII mode
170
+ const config = WasmSerialServerConfig.rtu(); // or .ascii()
171
+
172
+ // 3. Create the server with a request handler callback
173
+ const server = new WasmSerialServer(config, async (request) => {
174
+ console.log("Received Modbus request via Serial:", request);
175
+ return {
176
+ success: true,
177
+ data: [100, 200, 300]
178
+ };
179
+ });
180
+
181
+ // 4. Attach the browser serial port
182
+ server.attach_serial_port(port);
183
+
184
+ // 5. Start the server
185
+ server.start();
186
+
187
+ console.log("Serial Server running:", server.is_running());
188
+ }
189
+ ```
190
+
89
191
  ## License
90
192
 
91
193
  GPL-3.0-only — see [LICENSE](./LICENSE). A commercial license is available for proprietary use.
@@ -1437,37 +1437,37 @@ export function request_serial_port() {
1437
1437
  const ret = wasm.request_serial_port();
1438
1438
  return ret;
1439
1439
  }
1440
- export function __wbg___wbindgen_boolean_get_1a45e2c38d4d41b9(arg0) {
1440
+ export function __wbg___wbindgen_boolean_get_b131b2f36d6b2f55(arg0) {
1441
1441
  const v = arg0;
1442
1442
  const ret = typeof(v) === 'boolean' ? v : undefined;
1443
1443
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1444
1444
  }
1445
- export function __wbg___wbindgen_debug_string_0accd80f45e5faa2(arg0, arg1) {
1445
+ export function __wbg___wbindgen_debug_string_56c147eb1a51f0c4(arg0, arg1) {
1446
1446
  const ret = debugString(arg1);
1447
1447
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1448
1448
  const len1 = WASM_VECTOR_LEN;
1449
1449
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1450
1450
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1451
1451
  }
1452
- export function __wbg___wbindgen_is_function_754e9f305ff6029e(arg0) {
1452
+ export function __wbg___wbindgen_is_function_147961669f068cd4(arg0) {
1453
1453
  const ret = typeof(arg0) === 'function';
1454
1454
  return ret;
1455
1455
  }
1456
- export function __wbg___wbindgen_is_null_87c3bfe968c6a5ad(arg0) {
1456
+ export function __wbg___wbindgen_is_null_ced4761460071341(arg0) {
1457
1457
  const ret = arg0 === null;
1458
1458
  return ret;
1459
1459
  }
1460
- export function __wbg___wbindgen_is_undefined_67b456be8673d3d7(arg0) {
1460
+ export function __wbg___wbindgen_is_undefined_4410e3c20a99fa97(arg0) {
1461
1461
  const ret = arg0 === undefined;
1462
1462
  return ret;
1463
1463
  }
1464
- export function __wbg___wbindgen_number_get_9bb1761122181af2(arg0, arg1) {
1464
+ export function __wbg___wbindgen_number_get_588ed6b97f0d7e14(arg0, arg1) {
1465
1465
  const obj = arg1;
1466
1466
  const ret = typeof(obj) === 'number' ? obj : undefined;
1467
1467
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1468
1468
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1469
1469
  }
1470
- export function __wbg___wbindgen_string_get_72bdf95d3ae505b1(arg0, arg1) {
1470
+ export function __wbg___wbindgen_string_get_fa2687d531ed17a5(arg0, arg1) {
1471
1471
  const obj = arg1;
1472
1472
  const ret = typeof(obj) === 'string' ? obj : undefined;
1473
1473
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1475,17 +1475,17 @@ export function __wbg___wbindgen_string_get_72bdf95d3ae505b1(arg0, arg1) {
1475
1475
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1476
1476
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1477
1477
  }
1478
- export function __wbg___wbindgen_throw_1506f2235d1bdba0(arg0, arg1) {
1478
+ export function __wbg___wbindgen_throw_bbadd78c1bac3a77(arg0, arg1) {
1479
1479
  throw new Error(getStringFromWasm0(arg0, arg1));
1480
1480
  }
1481
- export function __wbg__wbg_cb_unref_61db23ac97f16c31(arg0) {
1481
+ export function __wbg__wbg_cb_unref_c2301a3c9b78104b(arg0) {
1482
1482
  arg0._wbg_cb_unref();
1483
1483
  }
1484
- export function __wbg_call_8a89609d89f6608a() { return handleError(function (arg0, arg1) {
1484
+ export function __wbg_call_91f00ddc43e01490() { return handleError(function (arg0, arg1) {
1485
1485
  const ret = arg0.call(arg1);
1486
1486
  return ret;
1487
1487
  }, arguments); }
1488
- export function __wbg_call_9c758de292015997() { return handleError(function (arg0, arg1, arg2) {
1488
+ export function __wbg_call_ec09a4cf93377d3a() { return handleError(function (arg0, arg1, arg2) {
1489
1489
  const ret = arg0.call(arg1, arg2);
1490
1490
  return ret;
1491
1491
  }, arguments); }
@@ -1493,18 +1493,18 @@ export function __wbg_clearTimeout_113b1cde814ec762(arg0) {
1493
1493
  const ret = clearTimeout(arg0);
1494
1494
  return ret;
1495
1495
  }
1496
- export function __wbg_close_9acc00cbca310439() { return handleError(function (arg0) {
1496
+ export function __wbg_close_296263cfe1bb2999() { return handleError(function (arg0) {
1497
1497
  arg0.close();
1498
1498
  }, arguments); }
1499
- export function __wbg_data_bd354b70c783c66e(arg0) {
1499
+ export function __wbg_data_8a04443c1e5a8cd3(arg0) {
1500
1500
  const ret = arg0.data;
1501
1501
  return ret;
1502
1502
  }
1503
- export function __wbg_get_de6a0f7d4d18a304() { return handleError(function (arg0, arg1) {
1503
+ export function __wbg_get_52a8a619f7b88df6() { return handleError(function (arg0, arg1) {
1504
1504
  const ret = Reflect.get(arg0, arg1);
1505
1505
  return ret;
1506
1506
  }, arguments); }
1507
- export function __wbg_instanceof_ArrayBuffer_8f49811467741499(arg0) {
1507
+ export function __wbg_instanceof_ArrayBuffer_a581da923203f29f(arg0) {
1508
1508
  let result;
1509
1509
  try {
1510
1510
  result = arg0 instanceof ArrayBuffer;
@@ -1514,7 +1514,7 @@ export function __wbg_instanceof_ArrayBuffer_8f49811467741499(arg0) {
1514
1514
  const ret = result;
1515
1515
  return ret;
1516
1516
  }
1517
- export function __wbg_instanceof_Promise_d0db99486956c8e8(arg0) {
1517
+ export function __wbg_instanceof_Promise_aa24ea31000d4ee6(arg0) {
1518
1518
  let result;
1519
1519
  try {
1520
1520
  result = arg0 instanceof Promise;
@@ -1524,22 +1524,34 @@ export function __wbg_instanceof_Promise_d0db99486956c8e8(arg0) {
1524
1524
  const ret = result;
1525
1525
  return ret;
1526
1526
  }
1527
- export function __wbg_length_4a591ecaa01354d9(arg0) {
1527
+ export function __wbg_length_68a9d5278d084f4f(arg0) {
1528
1528
  const ret = arg0.length;
1529
1529
  return ret;
1530
1530
  }
1531
- export function __wbg_new_578aeef4b6b94378(arg0) {
1531
+ export function __wbg_new_0b303268aa395a38() {
1532
+ const ret = new Array();
1533
+ return ret;
1534
+ }
1535
+ export function __wbg_new_20b778a4c5c691c3() {
1536
+ const ret = new Object();
1537
+ return ret;
1538
+ }
1539
+ export function __wbg_new_a3e5112401a82338() { return handleError(function (arg0, arg1) {
1540
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1541
+ return ret;
1542
+ }, arguments); }
1543
+ export function __wbg_new_b06772b280cc6e52(arg0) {
1532
1544
  const ret = new Uint8Array(arg0);
1533
1545
  return ret;
1534
1546
  }
1535
- export function __wbg_new_b682b81e8eaaf027(arg0, arg1) {
1547
+ export function __wbg_new_b3334f9cd9f51d36(arg0, arg1) {
1536
1548
  try {
1537
1549
  var state0 = {a: arg0, b: arg1};
1538
1550
  var cb0 = (arg0, arg1) => {
1539
1551
  const a = state0.a;
1540
1552
  state0.a = 0;
1541
1553
  try {
1542
- return wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c(a, state0.b, arg0, arg1);
1554
+ return wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(a, state0.b, arg0, arg1);
1543
1555
  } finally {
1544
1556
  state0.a = a;
1545
1557
  }
@@ -1550,34 +1562,22 @@ export function __wbg_new_b682b81e8eaaf027(arg0, arg1) {
1550
1562
  state0.a = 0;
1551
1563
  }
1552
1564
  }
1553
- export function __wbg_new_ce1ab61c1c2b300d() {
1554
- const ret = new Object();
1555
- return ret;
1556
- }
1557
- export function __wbg_new_d7e476b433a26bea() { return handleError(function (arg0, arg1) {
1558
- const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1559
- return ret;
1560
- }, arguments); }
1561
- export function __wbg_new_d90091b82fdf5b91() {
1562
- const ret = new Array();
1565
+ export function __wbg_new_from_slice_ba57951b532accf0(arg0, arg1) {
1566
+ const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
1563
1567
  return ret;
1564
1568
  }
1565
- export function __wbg_new_from_slice_18fa1f71286d66b8(arg0, arg1) {
1569
+ export function __wbg_new_from_slice_bb2d1778c0b87eb1(arg0, arg1) {
1566
1570
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1567
1571
  return ret;
1568
1572
  }
1569
- export function __wbg_new_from_slice_a0009695698d1671(arg0, arg1) {
1570
- const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
1571
- return ret;
1572
- }
1573
- export function __wbg_new_typed_bf31d18f92484486(arg0, arg1) {
1573
+ export function __wbg_new_typed_90c3f6c29ba36d19(arg0, arg1) {
1574
1574
  try {
1575
1575
  var state0 = {a: arg0, b: arg1};
1576
1576
  var cb0 = (arg0, arg1) => {
1577
1577
  const a = state0.a;
1578
1578
  state0.a = 0;
1579
1579
  try {
1580
- return wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c(a, state0.b, arg0, arg1);
1580
+ return wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(a, state0.b, arg0, arg1);
1581
1581
  } finally {
1582
1582
  state0.a = a;
1583
1583
  }
@@ -1588,83 +1588,83 @@ export function __wbg_new_typed_bf31d18f92484486(arg0, arg1) {
1588
1588
  state0.a = 0;
1589
1589
  }
1590
1590
  }
1591
- export function __wbg_new_with_length_8f9278dbad0d5670(arg0) {
1591
+ export function __wbg_new_with_length_a5c14e4ca7b3d0b3(arg0) {
1592
1592
  const ret = new Uint16Array(arg0 >>> 0);
1593
1593
  return ret;
1594
1594
  }
1595
- export function __wbg_now_190933fa139cc119() {
1595
+ export function __wbg_now_bce4dc999095ea77() {
1596
1596
  const ret = Date.now();
1597
1597
  return ret;
1598
1598
  }
1599
- export function __wbg_prototypesetcall_3249fc62a0fafa30(arg0, arg1, arg2) {
1599
+ export function __wbg_prototypesetcall_956c7493c68e29b4(arg0, arg1, arg2) {
1600
1600
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1601
1601
  }
1602
- export function __wbg_push_a6822215aa43e71c(arg0, arg1) {
1602
+ export function __wbg_push_ceb8ef046afb2041(arg0, arg1) {
1603
1603
  const ret = arg0.push(arg1);
1604
1604
  return ret;
1605
1605
  }
1606
- export function __wbg_queueMicrotask_35c611f4a14830b2(arg0) {
1606
+ export function __wbg_queueMicrotask_4698f900840e3286(arg0) {
1607
1607
  queueMicrotask(arg0);
1608
1608
  }
1609
- export function __wbg_queueMicrotask_404ed0a58e0b63cc(arg0) {
1609
+ export function __wbg_queueMicrotask_477a5533c7100338(arg0) {
1610
1610
  const ret = arg0.queueMicrotask;
1611
1611
  return ret;
1612
1612
  }
1613
- export function __wbg_readyState_490503c1fa8f8dd6(arg0) {
1613
+ export function __wbg_readyState_25243ad6ce649774(arg0) {
1614
1614
  const ret = arg0.readyState;
1615
1615
  return ret;
1616
1616
  }
1617
- export function __wbg_resolve_25a7e548d5881dca(arg0) {
1617
+ export function __wbg_resolve_0183de2e8c6b1d54(arg0) {
1618
1618
  const ret = Promise.resolve(arg0);
1619
1619
  return ret;
1620
1620
  }
1621
- export function __wbg_send_4a773f523104d75e() { return handleError(function (arg0, arg1, arg2) {
1621
+ export function __wbg_send_99d049cae69c53cc() { return handleError(function (arg0, arg1, arg2) {
1622
1622
  arg0.send(getArrayU8FromWasm0(arg1, arg2));
1623
1623
  }, arguments); }
1624
1624
  export function __wbg_setTimeout_ef24d2fc3ad97385() { return handleError(function (arg0, arg1) {
1625
1625
  const ret = setTimeout(arg0, arg1);
1626
1626
  return ret;
1627
1627
  }, arguments); }
1628
- export function __wbg_set_6e30c9374c26414c() { return handleError(function (arg0, arg1, arg2) {
1628
+ export function __wbg_set_a6ba3ac0e634b822() { return handleError(function (arg0, arg1, arg2) {
1629
1629
  const ret = Reflect.set(arg0, arg1, arg2);
1630
1630
  return ret;
1631
1631
  }, arguments); }
1632
- export function __wbg_set_binaryType_41994c453b95bdd2(arg0, arg1) {
1632
+ export function __wbg_set_binaryType_8c2dd2cf1cfc2e28(arg0, arg1) {
1633
1633
  arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1634
1634
  }
1635
- export function __wbg_set_onclose_13787fb31ae8aefd(arg0, arg1) {
1635
+ export function __wbg_set_onclose_9cb5c3372e16c192(arg0, arg1) {
1636
1636
  arg0.onclose = arg1;
1637
1637
  }
1638
- export function __wbg_set_onerror_5a45265839edf1b1(arg0, arg1) {
1638
+ export function __wbg_set_onerror_190fe67e911ebf28(arg0, arg1) {
1639
1639
  arg0.onerror = arg1;
1640
1640
  }
1641
- export function __wbg_set_onmessage_9c6b4cb14e244b7f(arg0, arg1) {
1641
+ export function __wbg_set_onmessage_96337495f0bfb796(arg0, arg1) {
1642
1642
  arg0.onmessage = arg1;
1643
1643
  }
1644
- export function __wbg_set_onopen_db452f4233e99d7d(arg0, arg1) {
1644
+ export function __wbg_set_onopen_3e2bf6b11d434c2d(arg0, arg1) {
1645
1645
  arg0.onopen = arg1;
1646
1646
  }
1647
- export function __wbg_static_accessor_GLOBAL_9d53f2689e622ca1() {
1647
+ export function __wbg_static_accessor_GLOBAL_60a4124bab7dcc9a() {
1648
1648
  const ret = typeof global === 'undefined' ? null : global;
1649
1649
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1650
1650
  }
1651
- export function __wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a() {
1651
+ export function __wbg_static_accessor_GLOBAL_THIS_95ca6460658b5d13() {
1652
1652
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
1653
1653
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1654
1654
  }
1655
- export function __wbg_static_accessor_SELF_4c59f6c7ea29a144() {
1655
+ export function __wbg_static_accessor_SELF_4c95f759a91e9aae() {
1656
1656
  const ret = typeof self === 'undefined' ? null : self;
1657
1657
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1658
1658
  }
1659
- export function __wbg_static_accessor_WINDOW_e70ae9f2eb052253() {
1659
+ export function __wbg_static_accessor_WINDOW_44b435597f9e9ee7() {
1660
1660
  const ret = typeof window === 'undefined' ? null : window;
1661
1661
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1662
1662
  }
1663
- export function __wbg_then_18f476d590e58992(arg0, arg1, arg2) {
1663
+ export function __wbg_then_254bab9b266a77a5(arg0, arg1, arg2) {
1664
1664
  const ret = arg0.then(arg1, arg2);
1665
1665
  return ret;
1666
1666
  }
1667
- export function __wbg_then_ac7b025999b52837(arg0, arg1) {
1667
+ export function __wbg_then_3ea18602c6a5123b(arg0, arg1) {
1668
1668
  const ret = arg0.then(arg1);
1669
1669
  return ret;
1670
1670
  }
@@ -1674,32 +1674,32 @@ export function __wbg_wasmserialporthandle_new(arg0) {
1674
1674
  }
1675
1675
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
1676
1676
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 103, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1677
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d);
1677
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad);
1678
1678
  return ret;
1679
1679
  }
1680
1680
  export function __wbindgen_cast_0000000000000002(arg0, arg1) {
1681
1681
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1682
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746);
1682
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b);
1683
1683
  return ret;
1684
1684
  }
1685
1685
  export function __wbindgen_cast_0000000000000003(arg0, arg1) {
1686
1686
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1687
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2);
1687
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2);
1688
1688
  return ret;
1689
1689
  }
1690
1690
  export function __wbindgen_cast_0000000000000004(arg0, arg1) {
1691
1691
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1692
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3);
1692
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3);
1693
1693
  return ret;
1694
1694
  }
1695
1695
  export function __wbindgen_cast_0000000000000005(arg0, arg1) {
1696
1696
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1697
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4);
1697
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4);
1698
1698
  return ret;
1699
1699
  }
1700
1700
  export function __wbindgen_cast_0000000000000006(arg0, arg1) {
1701
1701
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 98, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1702
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251);
1702
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618);
1703
1703
  return ret;
1704
1704
  }
1705
1705
  export function __wbindgen_cast_0000000000000007(arg0) {
@@ -1721,35 +1721,35 @@ export function __wbindgen_init_externref_table() {
1721
1721
  table.set(offset + 2, true);
1722
1722
  table.set(offset + 3, false);
1723
1723
  }
1724
- function wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251(arg0, arg1) {
1725
- wasm.wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251(arg0, arg1);
1724
+ function wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618(arg0, arg1) {
1725
+ wasm.wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618(arg0, arg1);
1726
1726
  }
1727
1727
 
1728
- function wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746(arg0, arg1, arg2) {
1729
- wasm.wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746(arg0, arg1, arg2);
1728
+ function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b(arg0, arg1, arg2) {
1729
+ wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b(arg0, arg1, arg2);
1730
1730
  }
1731
1731
 
1732
- function wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2(arg0, arg1, arg2) {
1733
- wasm.wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2(arg0, arg1, arg2);
1732
+ function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2(arg0, arg1, arg2) {
1733
+ wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2(arg0, arg1, arg2);
1734
1734
  }
1735
1735
 
1736
- function wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3(arg0, arg1, arg2) {
1737
- wasm.wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3(arg0, arg1, arg2);
1736
+ function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3(arg0, arg1, arg2) {
1737
+ wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3(arg0, arg1, arg2);
1738
1738
  }
1739
1739
 
1740
- function wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4(arg0, arg1, arg2) {
1741
- wasm.wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4(arg0, arg1, arg2);
1740
+ function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4(arg0, arg1, arg2) {
1741
+ wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4(arg0, arg1, arg2);
1742
1742
  }
1743
1743
 
1744
- function wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d(arg0, arg1, arg2) {
1745
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d(arg0, arg1, arg2);
1744
+ function wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad(arg0, arg1, arg2) {
1745
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad(arg0, arg1, arg2);
1746
1746
  if (ret[1]) {
1747
1747
  throw takeFromExternrefTable0(ret[0]);
1748
1748
  }
1749
1749
  }
1750
1750
 
1751
- function wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c(arg0, arg1, arg2, arg3) {
1752
- wasm.wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c(arg0, arg1, arg2, arg3);
1751
+ function wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(arg0, arg1, arg2, arg3) {
1752
+ wasm.wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(arg0, arg1, arg2, arg3);
1753
1753
  }
1754
1754
 
1755
1755
 
Binary file
@@ -122,13 +122,13 @@ export const wasmtcptransport_has_pending_requests: (a: number) => number;
122
122
  export const wasmtcptransport_is_connected: (a: number) => number;
123
123
  export const wasmtcptransport_new: (a: number, b: number, c: number) => [number, number, number];
124
124
  export const wasmtcptransport_reconnect: (a: number) => number;
125
- export const wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d: (a: number, b: number, c: any) => [number, number];
126
- export const wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c: (a: number, b: number, c: any, d: any) => void;
127
- export const wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746: (a: number, b: number, c: any) => void;
128
- export const wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2: (a: number, b: number, c: any) => void;
129
- export const wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3: (a: number, b: number, c: any) => void;
130
- export const wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4: (a: number, b: number, c: any) => void;
131
- export const wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251: (a: number, b: number) => void;
125
+ export const wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad: (a: number, b: number, c: any) => [number, number];
126
+ export const wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd: (a: number, b: number, c: any, d: any) => void;
127
+ export const wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b: (a: number, b: number, c: any) => void;
128
+ export const wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2: (a: number, b: number, c: any) => void;
129
+ export const wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3: (a: number, b: number, c: any) => void;
130
+ export const wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4: (a: number, b: number, c: any) => void;
131
+ export const wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618: (a: number, b: number) => void;
132
132
  export const __wbindgen_malloc: (a: number, b: number) => number;
133
133
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
134
134
  export const __wbindgen_exn_store: (a: number) => void;
@@ -834,13 +834,13 @@ export interface InitOutput {
834
834
  readonly wasmtcptransport_is_connected: (a: number) => number;
835
835
  readonly wasmtcptransport_new: (a: number, b: number, c: number) => [number, number, number];
836
836
  readonly wasmtcptransport_reconnect: (a: number) => number;
837
- readonly wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d: (a: number, b: number, c: any) => [number, number];
838
- readonly wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c: (a: number, b: number, c: any, d: any) => void;
839
- readonly wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746: (a: number, b: number, c: any) => void;
840
- readonly wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2: (a: number, b: number, c: any) => void;
841
- readonly wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3: (a: number, b: number, c: any) => void;
842
- readonly wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4: (a: number, b: number, c: any) => void;
843
- readonly wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251: (a: number, b: number) => void;
837
+ readonly wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad: (a: number, b: number, c: any) => [number, number];
838
+ readonly wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd: (a: number, b: number, c: any, d: any) => void;
839
+ readonly wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b: (a: number, b: number, c: any) => void;
840
+ readonly wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2: (a: number, b: number, c: any) => void;
841
+ readonly wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3: (a: number, b: number, c: any) => void;
842
+ readonly wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4: (a: number, b: number, c: any) => void;
843
+ readonly wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618: (a: number, b: number) => void;
844
844
  readonly __wbindgen_malloc: (a: number, b: number) => number;
845
845
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
846
846
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -1442,37 +1442,37 @@ export function request_serial_port() {
1442
1442
  function __wbg_get_imports() {
1443
1443
  const import0 = {
1444
1444
  __proto__: null,
1445
- __wbg___wbindgen_boolean_get_1a45e2c38d4d41b9: function(arg0) {
1445
+ __wbg___wbindgen_boolean_get_b131b2f36d6b2f55: function(arg0) {
1446
1446
  const v = arg0;
1447
1447
  const ret = typeof(v) === 'boolean' ? v : undefined;
1448
1448
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1449
1449
  },
1450
- __wbg___wbindgen_debug_string_0accd80f45e5faa2: function(arg0, arg1) {
1450
+ __wbg___wbindgen_debug_string_56c147eb1a51f0c4: function(arg0, arg1) {
1451
1451
  const ret = debugString(arg1);
1452
1452
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1453
1453
  const len1 = WASM_VECTOR_LEN;
1454
1454
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1455
1455
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1456
1456
  },
1457
- __wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
1457
+ __wbg___wbindgen_is_function_147961669f068cd4: function(arg0) {
1458
1458
  const ret = typeof(arg0) === 'function';
1459
1459
  return ret;
1460
1460
  },
1461
- __wbg___wbindgen_is_null_87c3bfe968c6a5ad: function(arg0) {
1461
+ __wbg___wbindgen_is_null_ced4761460071341: function(arg0) {
1462
1462
  const ret = arg0 === null;
1463
1463
  return ret;
1464
1464
  },
1465
- __wbg___wbindgen_is_undefined_67b456be8673d3d7: function(arg0) {
1465
+ __wbg___wbindgen_is_undefined_4410e3c20a99fa97: function(arg0) {
1466
1466
  const ret = arg0 === undefined;
1467
1467
  return ret;
1468
1468
  },
1469
- __wbg___wbindgen_number_get_9bb1761122181af2: function(arg0, arg1) {
1469
+ __wbg___wbindgen_number_get_588ed6b97f0d7e14: function(arg0, arg1) {
1470
1470
  const obj = arg1;
1471
1471
  const ret = typeof(obj) === 'number' ? obj : undefined;
1472
1472
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1473
1473
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1474
1474
  },
1475
- __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
1475
+ __wbg___wbindgen_string_get_fa2687d531ed17a5: function(arg0, arg1) {
1476
1476
  const obj = arg1;
1477
1477
  const ret = typeof(obj) === 'string' ? obj : undefined;
1478
1478
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1480,17 +1480,17 @@ function __wbg_get_imports() {
1480
1480
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1481
1481
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1482
1482
  },
1483
- __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
1483
+ __wbg___wbindgen_throw_bbadd78c1bac3a77: function(arg0, arg1) {
1484
1484
  throw new Error(getStringFromWasm0(arg0, arg1));
1485
1485
  },
1486
- __wbg__wbg_cb_unref_61db23ac97f16c31: function(arg0) {
1486
+ __wbg__wbg_cb_unref_c2301a3c9b78104b: function(arg0) {
1487
1487
  arg0._wbg_cb_unref();
1488
1488
  },
1489
- __wbg_call_8a89609d89f6608a: function() { return handleError(function (arg0, arg1) {
1489
+ __wbg_call_91f00ddc43e01490: function() { return handleError(function (arg0, arg1) {
1490
1490
  const ret = arg0.call(arg1);
1491
1491
  return ret;
1492
1492
  }, arguments); },
1493
- __wbg_call_9c758de292015997: function() { return handleError(function (arg0, arg1, arg2) {
1493
+ __wbg_call_ec09a4cf93377d3a: function() { return handleError(function (arg0, arg1, arg2) {
1494
1494
  const ret = arg0.call(arg1, arg2);
1495
1495
  return ret;
1496
1496
  }, arguments); },
@@ -1498,18 +1498,18 @@ function __wbg_get_imports() {
1498
1498
  const ret = clearTimeout(arg0);
1499
1499
  return ret;
1500
1500
  },
1501
- __wbg_close_9acc00cbca310439: function() { return handleError(function (arg0) {
1501
+ __wbg_close_296263cfe1bb2999: function() { return handleError(function (arg0) {
1502
1502
  arg0.close();
1503
1503
  }, arguments); },
1504
- __wbg_data_bd354b70c783c66e: function(arg0) {
1504
+ __wbg_data_8a04443c1e5a8cd3: function(arg0) {
1505
1505
  const ret = arg0.data;
1506
1506
  return ret;
1507
1507
  },
1508
- __wbg_get_de6a0f7d4d18a304: function() { return handleError(function (arg0, arg1) {
1508
+ __wbg_get_52a8a619f7b88df6: function() { return handleError(function (arg0, arg1) {
1509
1509
  const ret = Reflect.get(arg0, arg1);
1510
1510
  return ret;
1511
1511
  }, arguments); },
1512
- __wbg_instanceof_ArrayBuffer_8f49811467741499: function(arg0) {
1512
+ __wbg_instanceof_ArrayBuffer_a581da923203f29f: function(arg0) {
1513
1513
  let result;
1514
1514
  try {
1515
1515
  result = arg0 instanceof ArrayBuffer;
@@ -1519,7 +1519,7 @@ function __wbg_get_imports() {
1519
1519
  const ret = result;
1520
1520
  return ret;
1521
1521
  },
1522
- __wbg_instanceof_Promise_d0db99486956c8e8: function(arg0) {
1522
+ __wbg_instanceof_Promise_aa24ea31000d4ee6: function(arg0) {
1523
1523
  let result;
1524
1524
  try {
1525
1525
  result = arg0 instanceof Promise;
@@ -1529,22 +1529,34 @@ function __wbg_get_imports() {
1529
1529
  const ret = result;
1530
1530
  return ret;
1531
1531
  },
1532
- __wbg_length_4a591ecaa01354d9: function(arg0) {
1532
+ __wbg_length_68a9d5278d084f4f: function(arg0) {
1533
1533
  const ret = arg0.length;
1534
1534
  return ret;
1535
1535
  },
1536
- __wbg_new_578aeef4b6b94378: function(arg0) {
1536
+ __wbg_new_0b303268aa395a38: function() {
1537
+ const ret = new Array();
1538
+ return ret;
1539
+ },
1540
+ __wbg_new_20b778a4c5c691c3: function() {
1541
+ const ret = new Object();
1542
+ return ret;
1543
+ },
1544
+ __wbg_new_a3e5112401a82338: function() { return handleError(function (arg0, arg1) {
1545
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1546
+ return ret;
1547
+ }, arguments); },
1548
+ __wbg_new_b06772b280cc6e52: function(arg0) {
1537
1549
  const ret = new Uint8Array(arg0);
1538
1550
  return ret;
1539
1551
  },
1540
- __wbg_new_b682b81e8eaaf027: function(arg0, arg1) {
1552
+ __wbg_new_b3334f9cd9f51d36: function(arg0, arg1) {
1541
1553
  try {
1542
1554
  var state0 = {a: arg0, b: arg1};
1543
1555
  var cb0 = (arg0, arg1) => {
1544
1556
  const a = state0.a;
1545
1557
  state0.a = 0;
1546
1558
  try {
1547
- return wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c(a, state0.b, arg0, arg1);
1559
+ return wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(a, state0.b, arg0, arg1);
1548
1560
  } finally {
1549
1561
  state0.a = a;
1550
1562
  }
@@ -1555,34 +1567,22 @@ function __wbg_get_imports() {
1555
1567
  state0.a = 0;
1556
1568
  }
1557
1569
  },
1558
- __wbg_new_ce1ab61c1c2b300d: function() {
1559
- const ret = new Object();
1560
- return ret;
1561
- },
1562
- __wbg_new_d7e476b433a26bea: function() { return handleError(function (arg0, arg1) {
1563
- const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1564
- return ret;
1565
- }, arguments); },
1566
- __wbg_new_d90091b82fdf5b91: function() {
1567
- const ret = new Array();
1570
+ __wbg_new_from_slice_ba57951b532accf0: function(arg0, arg1) {
1571
+ const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
1568
1572
  return ret;
1569
1573
  },
1570
- __wbg_new_from_slice_18fa1f71286d66b8: function(arg0, arg1) {
1574
+ __wbg_new_from_slice_bb2d1778c0b87eb1: function(arg0, arg1) {
1571
1575
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1572
1576
  return ret;
1573
1577
  },
1574
- __wbg_new_from_slice_a0009695698d1671: function(arg0, arg1) {
1575
- const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
1576
- return ret;
1577
- },
1578
- __wbg_new_typed_bf31d18f92484486: function(arg0, arg1) {
1578
+ __wbg_new_typed_90c3f6c29ba36d19: function(arg0, arg1) {
1579
1579
  try {
1580
1580
  var state0 = {a: arg0, b: arg1};
1581
1581
  var cb0 = (arg0, arg1) => {
1582
1582
  const a = state0.a;
1583
1583
  state0.a = 0;
1584
1584
  try {
1585
- return wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c(a, state0.b, arg0, arg1);
1585
+ return wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(a, state0.b, arg0, arg1);
1586
1586
  } finally {
1587
1587
  state0.a = a;
1588
1588
  }
@@ -1593,83 +1593,83 @@ function __wbg_get_imports() {
1593
1593
  state0.a = 0;
1594
1594
  }
1595
1595
  },
1596
- __wbg_new_with_length_8f9278dbad0d5670: function(arg0) {
1596
+ __wbg_new_with_length_a5c14e4ca7b3d0b3: function(arg0) {
1597
1597
  const ret = new Uint16Array(arg0 >>> 0);
1598
1598
  return ret;
1599
1599
  },
1600
- __wbg_now_190933fa139cc119: function() {
1600
+ __wbg_now_bce4dc999095ea77: function() {
1601
1601
  const ret = Date.now();
1602
1602
  return ret;
1603
1603
  },
1604
- __wbg_prototypesetcall_3249fc62a0fafa30: function(arg0, arg1, arg2) {
1604
+ __wbg_prototypesetcall_956c7493c68e29b4: function(arg0, arg1, arg2) {
1605
1605
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1606
1606
  },
1607
- __wbg_push_a6822215aa43e71c: function(arg0, arg1) {
1607
+ __wbg_push_ceb8ef046afb2041: function(arg0, arg1) {
1608
1608
  const ret = arg0.push(arg1);
1609
1609
  return ret;
1610
1610
  },
1611
- __wbg_queueMicrotask_35c611f4a14830b2: function(arg0) {
1611
+ __wbg_queueMicrotask_4698f900840e3286: function(arg0) {
1612
1612
  queueMicrotask(arg0);
1613
1613
  },
1614
- __wbg_queueMicrotask_404ed0a58e0b63cc: function(arg0) {
1614
+ __wbg_queueMicrotask_477a5533c7100338: function(arg0) {
1615
1615
  const ret = arg0.queueMicrotask;
1616
1616
  return ret;
1617
1617
  },
1618
- __wbg_readyState_490503c1fa8f8dd6: function(arg0) {
1618
+ __wbg_readyState_25243ad6ce649774: function(arg0) {
1619
1619
  const ret = arg0.readyState;
1620
1620
  return ret;
1621
1621
  },
1622
- __wbg_resolve_25a7e548d5881dca: function(arg0) {
1622
+ __wbg_resolve_0183de2e8c6b1d54: function(arg0) {
1623
1623
  const ret = Promise.resolve(arg0);
1624
1624
  return ret;
1625
1625
  },
1626
- __wbg_send_4a773f523104d75e: function() { return handleError(function (arg0, arg1, arg2) {
1626
+ __wbg_send_99d049cae69c53cc: function() { return handleError(function (arg0, arg1, arg2) {
1627
1627
  arg0.send(getArrayU8FromWasm0(arg1, arg2));
1628
1628
  }, arguments); },
1629
1629
  __wbg_setTimeout_ef24d2fc3ad97385: function() { return handleError(function (arg0, arg1) {
1630
1630
  const ret = setTimeout(arg0, arg1);
1631
1631
  return ret;
1632
1632
  }, arguments); },
1633
- __wbg_set_6e30c9374c26414c: function() { return handleError(function (arg0, arg1, arg2) {
1633
+ __wbg_set_a6ba3ac0e634b822: function() { return handleError(function (arg0, arg1, arg2) {
1634
1634
  const ret = Reflect.set(arg0, arg1, arg2);
1635
1635
  return ret;
1636
1636
  }, arguments); },
1637
- __wbg_set_binaryType_41994c453b95bdd2: function(arg0, arg1) {
1637
+ __wbg_set_binaryType_8c2dd2cf1cfc2e28: function(arg0, arg1) {
1638
1638
  arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1639
1639
  },
1640
- __wbg_set_onclose_13787fb31ae8aefd: function(arg0, arg1) {
1640
+ __wbg_set_onclose_9cb5c3372e16c192: function(arg0, arg1) {
1641
1641
  arg0.onclose = arg1;
1642
1642
  },
1643
- __wbg_set_onerror_5a45265839edf1b1: function(arg0, arg1) {
1643
+ __wbg_set_onerror_190fe67e911ebf28: function(arg0, arg1) {
1644
1644
  arg0.onerror = arg1;
1645
1645
  },
1646
- __wbg_set_onmessage_9c6b4cb14e244b7f: function(arg0, arg1) {
1646
+ __wbg_set_onmessage_96337495f0bfb796: function(arg0, arg1) {
1647
1647
  arg0.onmessage = arg1;
1648
1648
  },
1649
- __wbg_set_onopen_db452f4233e99d7d: function(arg0, arg1) {
1649
+ __wbg_set_onopen_3e2bf6b11d434c2d: function(arg0, arg1) {
1650
1650
  arg0.onopen = arg1;
1651
1651
  },
1652
- __wbg_static_accessor_GLOBAL_9d53f2689e622ca1: function() {
1652
+ __wbg_static_accessor_GLOBAL_60a4124bab7dcc9a: function() {
1653
1653
  const ret = typeof global === 'undefined' ? null : global;
1654
1654
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1655
1655
  },
1656
- __wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a: function() {
1656
+ __wbg_static_accessor_GLOBAL_THIS_95ca6460658b5d13: function() {
1657
1657
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
1658
1658
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1659
1659
  },
1660
- __wbg_static_accessor_SELF_4c59f6c7ea29a144: function() {
1660
+ __wbg_static_accessor_SELF_4c95f759a91e9aae: function() {
1661
1661
  const ret = typeof self === 'undefined' ? null : self;
1662
1662
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1663
1663
  },
1664
- __wbg_static_accessor_WINDOW_e70ae9f2eb052253: function() {
1664
+ __wbg_static_accessor_WINDOW_44b435597f9e9ee7: function() {
1665
1665
  const ret = typeof window === 'undefined' ? null : window;
1666
1666
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1667
1667
  },
1668
- __wbg_then_18f476d590e58992: function(arg0, arg1, arg2) {
1668
+ __wbg_then_254bab9b266a77a5: function(arg0, arg1, arg2) {
1669
1669
  const ret = arg0.then(arg1, arg2);
1670
1670
  return ret;
1671
1671
  },
1672
- __wbg_then_ac7b025999b52837: function(arg0, arg1) {
1672
+ __wbg_then_3ea18602c6a5123b: function(arg0, arg1) {
1673
1673
  const ret = arg0.then(arg1);
1674
1674
  return ret;
1675
1675
  },
@@ -1679,32 +1679,32 @@ function __wbg_get_imports() {
1679
1679
  },
1680
1680
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1681
1681
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 103, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1682
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d);
1682
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad);
1683
1683
  return ret;
1684
1684
  },
1685
1685
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1686
1686
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1687
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746);
1687
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b);
1688
1688
  return ret;
1689
1689
  },
1690
1690
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1691
1691
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1692
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2);
1692
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2);
1693
1693
  return ret;
1694
1694
  },
1695
1695
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1696
1696
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1697
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3);
1697
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3);
1698
1698
  return ret;
1699
1699
  },
1700
1700
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1701
1701
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1702
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4);
1702
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4);
1703
1703
  return ret;
1704
1704
  },
1705
1705
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
1706
1706
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 98, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1707
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251);
1707
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618);
1708
1708
  return ret;
1709
1709
  },
1710
1710
  __wbindgen_cast_0000000000000007: function(arg0) {
@@ -1733,35 +1733,35 @@ function __wbg_get_imports() {
1733
1733
  };
1734
1734
  }
1735
1735
 
1736
- function wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251(arg0, arg1) {
1737
- wasm.wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251(arg0, arg1);
1736
+ function wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618(arg0, arg1) {
1737
+ wasm.wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618(arg0, arg1);
1738
1738
  }
1739
1739
 
1740
- function wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746(arg0, arg1, arg2) {
1741
- wasm.wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746(arg0, arg1, arg2);
1740
+ function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b(arg0, arg1, arg2) {
1741
+ wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b(arg0, arg1, arg2);
1742
1742
  }
1743
1743
 
1744
- function wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2(arg0, arg1, arg2) {
1745
- wasm.wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2(arg0, arg1, arg2);
1744
+ function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2(arg0, arg1, arg2) {
1745
+ wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2(arg0, arg1, arg2);
1746
1746
  }
1747
1747
 
1748
- function wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3(arg0, arg1, arg2) {
1749
- wasm.wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3(arg0, arg1, arg2);
1748
+ function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3(arg0, arg1, arg2) {
1749
+ wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3(arg0, arg1, arg2);
1750
1750
  }
1751
1751
 
1752
- function wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4(arg0, arg1, arg2) {
1753
- wasm.wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4(arg0, arg1, arg2);
1752
+ function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4(arg0, arg1, arg2) {
1753
+ wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4(arg0, arg1, arg2);
1754
1754
  }
1755
1755
 
1756
- function wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d(arg0, arg1, arg2) {
1757
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d(arg0, arg1, arg2);
1756
+ function wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad(arg0, arg1, arg2) {
1757
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad(arg0, arg1, arg2);
1758
1758
  if (ret[1]) {
1759
1759
  throw takeFromExternrefTable0(ret[0]);
1760
1760
  }
1761
1761
  }
1762
1762
 
1763
- function wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c(arg0, arg1, arg2, arg3) {
1764
- wasm.wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c(arg0, arg1, arg2, arg3);
1763
+ function wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(arg0, arg1, arg2, arg3) {
1764
+ wasm.wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(arg0, arg1, arg2, arg3);
1765
1765
  }
1766
1766
 
1767
1767
 
Binary file
@@ -122,13 +122,13 @@ export const wasmtcptransport_has_pending_requests: (a: number) => number;
122
122
  export const wasmtcptransport_is_connected: (a: number) => number;
123
123
  export const wasmtcptransport_new: (a: number, b: number, c: number) => [number, number, number];
124
124
  export const wasmtcptransport_reconnect: (a: number) => number;
125
- export const wasm_bindgen__convert__closures_____invoke__hf07654e0f145fb5d: (a: number, b: number, c: any) => [number, number];
126
- export const wasm_bindgen__convert__closures_____invoke__h240b3defeec1c60c: (a: number, b: number, c: any, d: any) => void;
127
- export const wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746: (a: number, b: number, c: any) => void;
128
- export const wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_2: (a: number, b: number, c: any) => void;
129
- export const wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_3: (a: number, b: number, c: any) => void;
130
- export const wasm_bindgen__convert__closures_____invoke__h569333d9b62c9746_4: (a: number, b: number, c: any) => void;
131
- export const wasm_bindgen__convert__closures_____invoke__h6a5fa606c6af7251: (a: number, b: number) => void;
125
+ export const wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad: (a: number, b: number, c: any) => [number, number];
126
+ export const wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd: (a: number, b: number, c: any, d: any) => void;
127
+ export const wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b: (a: number, b: number, c: any) => void;
128
+ export const wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2: (a: number, b: number, c: any) => void;
129
+ export const wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3: (a: number, b: number, c: any) => void;
130
+ export const wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4: (a: number, b: number, c: any) => void;
131
+ export const wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618: (a: number, b: number) => void;
132
132
  export const __wbindgen_malloc: (a: number, b: number) => number;
133
133
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
134
134
  export const __wbindgen_exn_store: (a: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modbus-rs-wasm",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Modbus TCP/RTU/ASCII client & server for the browser, powered by Rust + WebAssembly",
5
5
  "type": "module",
6
6
  "exports": {