modbus-rs-wasm 0.14.1 → 0.14.2

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
@@ -12,13 +12,13 @@ npm install modbus-rs-wasm
12
12
 
13
13
  ## Integration & Frameworks (Vite, Svelte, React, etc.)
14
14
 
15
- No custom resolver aliases or configuration workarounds are required starting in `v0.14.0`. Standard package entry points are resolved automatically based on your builder/bundler targets.
15
+ No custom resolver aliases are required. Standard package entry points are resolved automatically based on your builder/bundler targets.
16
16
 
17
17
  ### Web (Direct / HTML / Vanilla JS)
18
- When loading the package in browser environments without a bundler, import the web entry point and await the initialization promise:
18
+ When loading the package in browser environments without a bundler (e.g. from CDNs like unpkg or jsDelivr), import the web entry point and await the initialization promise:
19
19
 
20
20
  ```javascript
21
- import init, { WasmTcpTransport } from 'modbus-rs-wasm/dist/web/modbus-rs.js';
21
+ import init, { WasmTcpTransport } from 'modbus-rs-wasm/web';
22
22
 
23
23
  await init();
24
24
  const transport = new WasmTcpTransport('ws://localhost:8502', {
@@ -29,27 +29,86 @@ const transport = new WasmTcpTransport('ws://localhost:8502', {
29
29
  const client = transport.create_client({ unitId: 1 });
30
30
  ```
31
31
 
32
- ### Bundlers & Frameworks (Vite, SvelteKit, Next.js, etc.)
33
- When using modern bundlers, the root import automatically maps to the bundler target:
32
+ ### Bundlers & Modern Frameworks
33
+
34
+ When using modern bundlers (Vite, Webpack, Next.js, etc.), the root import maps to the bundler target where WebAssembly is loaded automatically:
34
35
 
35
36
  ```javascript
36
37
  import { WasmTcpTransport } from 'modbus-rs-wasm';
37
38
  ```
38
- *(Make sure your bundler is configured to load WebAssembly, e.g., using `vite-plugin-wasm` and `vite-plugin-top-level-await` in Vite).*
39
+
40
+ Because WASM is an asynchronous module dependency, you must configure your bundler to support WASM loader options:
41
+
42
+ #### 1. Vite (React, Svelte, Vue, SolidJS, etc. via Vite)
43
+ Vite requires helper plugins to support WebAssembly. Install `vite-plugin-wasm` and `vite-plugin-top-level-await`:
44
+
45
+ ```bash
46
+ npm install -D vite-plugin-wasm vite-plugin-top-level-await
47
+ ```
48
+
49
+ In your `vite.config.ts`, register the plugins and **exclude** `modbus-rs-wasm` from dependency pre-bundling (to prevent Esbuild from trying to optimize the WASM module):
50
+
51
+ ```typescript
52
+ import { defineConfig } from 'vite';
53
+ import wasm from 'vite-plugin-wasm';
54
+ import topLevelAwait from 'vite-plugin-top-level-await';
55
+
56
+ export default defineConfig({
57
+ plugins: [wasm(), topLevelAwait()],
58
+ optimizeDeps: {
59
+ exclude: ['modbus-rs-wasm']
60
+ }
61
+ });
62
+ ```
63
+
64
+ #### 2. Webpack 5 (React, Angular, or custom Webpack setups)
65
+ Webpack 5 supports WebAssembly natively but it is disabled by default. You need to enable the `asyncWebAssembly` experiment in your `webpack.config.js`:
66
+
67
+ ```javascript
68
+ module.exports = {
69
+ // ...
70
+ experiments: {
71
+ asyncWebAssembly: true,
72
+ },
73
+ };
74
+ ```
75
+
76
+ #### 3. Next.js (Webpack mode)
77
+ Configure `next.config.js` to enable WebAssembly support inside Next.js's internal Webpack runner:
78
+
79
+ ```javascript
80
+ /** @type {import('next').NextConfig} */
81
+ const nextConfig = {
82
+ webpack(config) {
83
+ config.experiments = {
84
+ ...config.experiments,
85
+ asyncWebAssembly: true,
86
+ };
87
+ return config;
88
+ },
89
+ };
90
+
91
+ module.exports = nextConfig;
92
+ ```
39
93
 
40
94
  ## Quick Start
41
95
 
42
96
  ### Examples
43
97
  Ready-to-run HTML examples demonstrating both Modbus client and server functionality in the browser:
44
98
 
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.
99
+ - **[wasm_client/network_smoke.html](https://github.com/Raghava-Ch/modbus-rs/blob/main/mbus-ffi/wasm/examples/wasm_client/network_smoke.html)**: WebSocket Modbus TCP client example.
100
+ - **[wasm_client/serial_smoke.html](https://github.com/Raghava-Ch/modbus-rs/blob/main/mbus-ffi/wasm/examples/wasm_client/serial_smoke.html)**: Web Serial Modbus RTU client example.
101
+ - **[wasm_server/network_smoke.html](https://github.com/Raghava-Ch/modbus-rs/blob/main/mbus-ffi/wasm/examples/wasm_server/network_smoke.html)**: WebSocket Modbus TCP server example.
102
+ - **[wasm_server/serial_smoke.html](https://github.com/Raghava-Ch/modbus-rs/blob/main/mbus-ffi/wasm/examples/wasm_server/serial_smoke.html)**: Web Serial Modbus RTU server example.
103
+ - **[real world example](https://github.com/Raghava-Ch/modbus-lab)**: Comes with demo web client and tauri based desktop client and server simulators with source code.
49
104
 
50
105
  To run the examples locally:
51
106
  ```bash
52
- npx serve examples/
107
+ # clone the repo
108
+ cd modbus-rs/mbus-ffi/wasm
109
+ npx serve ./
110
+ # Navigate to example folder with chromium based web browser run the examples.
111
+ # you can also use the tauri desktop client and server simulator.
53
112
  ```
54
113
 
55
114
  ### Modbus RTU via Web Serial
@@ -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_b131b2f36d6b2f55(arg0) {
1440
+ export function __wbg___wbindgen_boolean_get_edaed31a367ce1bd(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_56c147eb1a51f0c4(arg0, arg1) {
1445
+ export function __wbg___wbindgen_debug_string_8a447059637473e2(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_147961669f068cd4(arg0) {
1452
+ export function __wbg___wbindgen_is_function_acc5528be2b923f2(arg0) {
1453
1453
  const ret = typeof(arg0) === 'function';
1454
1454
  return ret;
1455
1455
  }
1456
- export function __wbg___wbindgen_is_null_ced4761460071341(arg0) {
1456
+ export function __wbg___wbindgen_is_null_6d937fbfb6478470(arg0) {
1457
1457
  const ret = arg0 === null;
1458
1458
  return ret;
1459
1459
  }
1460
- export function __wbg___wbindgen_is_undefined_4410e3c20a99fa97(arg0) {
1460
+ export function __wbg___wbindgen_is_undefined_721f8decd50c87a3(arg0) {
1461
1461
  const ret = arg0 === undefined;
1462
1462
  return ret;
1463
1463
  }
1464
- export function __wbg___wbindgen_number_get_588ed6b97f0d7e14(arg0, arg1) {
1464
+ export function __wbg___wbindgen_number_get_1cc01dd708740256(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_fa2687d531ed17a5(arg0, arg1) {
1470
+ export function __wbg___wbindgen_string_get_71bb4348194e31f0(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,36 +1475,36 @@ export function __wbg___wbindgen_string_get_fa2687d531ed17a5(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_bbadd78c1bac3a77(arg0, arg1) {
1478
+ export function __wbg___wbindgen_throw_ea4887a5f8f9a9db(arg0, arg1) {
1479
1479
  throw new Error(getStringFromWasm0(arg0, arg1));
1480
1480
  }
1481
- export function __wbg__wbg_cb_unref_c2301a3c9b78104b(arg0) {
1481
+ export function __wbg__wbg_cb_unref_33c39e13d73b25f6(arg0) {
1482
1482
  arg0._wbg_cb_unref();
1483
1483
  }
1484
- export function __wbg_call_91f00ddc43e01490() { return handleError(function (arg0, arg1) {
1485
- const ret = arg0.call(arg1);
1484
+ export function __wbg_call_5575218572ead796() { return handleError(function (arg0, arg1, arg2) {
1485
+ const ret = arg0.call(arg1, arg2);
1486
1486
  return ret;
1487
1487
  }, arguments); }
1488
- export function __wbg_call_ec09a4cf93377d3a() { return handleError(function (arg0, arg1, arg2) {
1489
- const ret = arg0.call(arg1, arg2);
1488
+ export function __wbg_call_8e98ed2f3c86c4b5() { return handleError(function (arg0, arg1) {
1489
+ const ret = arg0.call(arg1);
1490
1490
  return ret;
1491
1491
  }, arguments); }
1492
1492
  export function __wbg_clearTimeout_113b1cde814ec762(arg0) {
1493
1493
  const ret = clearTimeout(arg0);
1494
1494
  return ret;
1495
1495
  }
1496
- export function __wbg_close_296263cfe1bb2999() { return handleError(function (arg0) {
1496
+ export function __wbg_close_26aa343c0d729303() { return handleError(function (arg0) {
1497
1497
  arg0.close();
1498
1498
  }, arguments); }
1499
- export function __wbg_data_8a04443c1e5a8cd3(arg0) {
1499
+ export function __wbg_data_4a7f1308dbd33a21(arg0) {
1500
1500
  const ret = arg0.data;
1501
1501
  return ret;
1502
1502
  }
1503
- export function __wbg_get_52a8a619f7b88df6() { return handleError(function (arg0, arg1) {
1503
+ export function __wbg_get_dddb90ff5d27a080() { 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_a581da923203f29f(arg0) {
1507
+ export function __wbg_instanceof_ArrayBuffer_2a7bb09fee70c2da(arg0) {
1508
1508
  let result;
1509
1509
  try {
1510
1510
  result = arg0 instanceof ArrayBuffer;
@@ -1514,7 +1514,7 @@ export function __wbg_instanceof_ArrayBuffer_a581da923203f29f(arg0) {
1514
1514
  const ret = result;
1515
1515
  return ret;
1516
1516
  }
1517
- export function __wbg_instanceof_Promise_aa24ea31000d4ee6(arg0) {
1517
+ export function __wbg_instanceof_Promise_4614a0df6220bf3f(arg0) {
1518
1518
  let result;
1519
1519
  try {
1520
1520
  result = arg0 instanceof Promise;
@@ -1524,34 +1524,34 @@ export function __wbg_instanceof_Promise_aa24ea31000d4ee6(arg0) {
1524
1524
  const ret = result;
1525
1525
  return ret;
1526
1526
  }
1527
- export function __wbg_length_68a9d5278d084f4f(arg0) {
1527
+ export function __wbg_length_589238bdcf171f0e(arg0) {
1528
1528
  const ret = arg0.length;
1529
1529
  return ret;
1530
1530
  }
1531
- export function __wbg_new_0b303268aa395a38() {
1532
- const ret = new Array();
1531
+ export function __wbg_new_2e117a478906f062() {
1532
+ const ret = new Object();
1533
1533
  return ret;
1534
1534
  }
1535
- export function __wbg_new_20b778a4c5c691c3() {
1536
- const ret = new Object();
1535
+ export function __wbg_new_36e147a8ced3c6e0() {
1536
+ const ret = new Array();
1537
1537
  return ret;
1538
1538
  }
1539
- export function __wbg_new_a3e5112401a82338() { return handleError(function (arg0, arg1) {
1539
+ export function __wbg_new_5a19eef57e9178b5() { return handleError(function (arg0, arg1) {
1540
1540
  const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1541
1541
  return ret;
1542
1542
  }, arguments); }
1543
- export function __wbg_new_b06772b280cc6e52(arg0) {
1543
+ export function __wbg_new_81880fb5002cb255(arg0) {
1544
1544
  const ret = new Uint8Array(arg0);
1545
1545
  return ret;
1546
1546
  }
1547
- export function __wbg_new_b3334f9cd9f51d36(arg0, arg1) {
1547
+ export function __wbg_new_f85beb941dc6d8aa(arg0, arg1) {
1548
1548
  try {
1549
1549
  var state0 = {a: arg0, b: arg1};
1550
1550
  var cb0 = (arg0, arg1) => {
1551
1551
  const a = state0.a;
1552
1552
  state0.a = 0;
1553
1553
  try {
1554
- return wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(a, state0.b, arg0, arg1);
1554
+ return wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f(a, state0.b, arg0, arg1);
1555
1555
  } finally {
1556
1556
  state0.a = a;
1557
1557
  }
@@ -1562,22 +1562,22 @@ export function __wbg_new_b3334f9cd9f51d36(arg0, arg1) {
1562
1562
  state0.a = 0;
1563
1563
  }
1564
1564
  }
1565
- export function __wbg_new_from_slice_ba57951b532accf0(arg0, arg1) {
1566
- const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
1565
+ export function __wbg_new_from_slice_543b875b27789a8f(arg0, arg1) {
1566
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1567
1567
  return ret;
1568
1568
  }
1569
- export function __wbg_new_from_slice_bb2d1778c0b87eb1(arg0, arg1) {
1570
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1569
+ export function __wbg_new_from_slice_8a37759f20de1131(arg0, arg1) {
1570
+ const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
1571
1571
  return ret;
1572
1572
  }
1573
- export function __wbg_new_typed_90c3f6c29ba36d19(arg0, arg1) {
1573
+ export function __wbg_new_typed_00a409eb4ec4f2d9(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__h079668e3d7708ddd(a, state0.b, arg0, arg1);
1580
+ return wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f(a, state0.b, arg0, arg1);
1581
1581
  } finally {
1582
1582
  state0.a = a;
1583
1583
  }
@@ -1588,83 +1588,83 @@ export function __wbg_new_typed_90c3f6c29ba36d19(arg0, arg1) {
1588
1588
  state0.a = 0;
1589
1589
  }
1590
1590
  }
1591
- export function __wbg_new_with_length_a5c14e4ca7b3d0b3(arg0) {
1591
+ export function __wbg_new_with_length_66ae39fdd9da8c1f(arg0) {
1592
1592
  const ret = new Uint16Array(arg0 >>> 0);
1593
1593
  return ret;
1594
1594
  }
1595
- export function __wbg_now_bce4dc999095ea77() {
1595
+ export function __wbg_now_d2e0afbad4edbe82() {
1596
1596
  const ret = Date.now();
1597
1597
  return ret;
1598
1598
  }
1599
- export function __wbg_prototypesetcall_956c7493c68e29b4(arg0, arg1, arg2) {
1599
+ export function __wbg_prototypesetcall_d721637c7ca66eb8(arg0, arg1, arg2) {
1600
1600
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1601
1601
  }
1602
- export function __wbg_push_ceb8ef046afb2041(arg0, arg1) {
1602
+ export function __wbg_push_f724b5db8acf89d2(arg0, arg1) {
1603
1603
  const ret = arg0.push(arg1);
1604
1604
  return ret;
1605
1605
  }
1606
- export function __wbg_queueMicrotask_4698f900840e3286(arg0) {
1607
- queueMicrotask(arg0);
1608
- }
1609
- export function __wbg_queueMicrotask_477a5533c7100338(arg0) {
1606
+ export function __wbg_queueMicrotask_1c9b3800e321a967(arg0) {
1610
1607
  const ret = arg0.queueMicrotask;
1611
1608
  return ret;
1612
1609
  }
1613
- export function __wbg_readyState_25243ad6ce649774(arg0) {
1610
+ export function __wbg_queueMicrotask_311744e534a929a3(arg0) {
1611
+ queueMicrotask(arg0);
1612
+ }
1613
+ export function __wbg_readyState_97951098f8995393(arg0) {
1614
1614
  const ret = arg0.readyState;
1615
1615
  return ret;
1616
1616
  }
1617
- export function __wbg_resolve_0183de2e8c6b1d54(arg0) {
1617
+ export function __wbg_resolve_d82363d90af6928a(arg0) {
1618
1618
  const ret = Promise.resolve(arg0);
1619
1619
  return ret;
1620
1620
  }
1621
- export function __wbg_send_99d049cae69c53cc() { return handleError(function (arg0, arg1, arg2) {
1621
+ export function __wbg_send_982c819b9a1b34a5() { 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_a6ba3ac0e634b822() { return handleError(function (arg0, arg1, arg2) {
1628
+ export function __wbg_set_4564f7dc44fcb0c9() { 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_8c2dd2cf1cfc2e28(arg0, arg1) {
1632
+ export function __wbg_set_binaryType_148427b11a8e6551(arg0, arg1) {
1633
1633
  arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1634
1634
  }
1635
- export function __wbg_set_onclose_9cb5c3372e16c192(arg0, arg1) {
1635
+ export function __wbg_set_onclose_8134952b2a9ec104(arg0, arg1) {
1636
1636
  arg0.onclose = arg1;
1637
1637
  }
1638
- export function __wbg_set_onerror_190fe67e911ebf28(arg0, arg1) {
1638
+ export function __wbg_set_onerror_3f68563f77d362f1(arg0, arg1) {
1639
1639
  arg0.onerror = arg1;
1640
1640
  }
1641
- export function __wbg_set_onmessage_96337495f0bfb796(arg0, arg1) {
1641
+ export function __wbg_set_onmessage_397a79f643011142(arg0, arg1) {
1642
1642
  arg0.onmessage = arg1;
1643
1643
  }
1644
- export function __wbg_set_onopen_3e2bf6b11d434c2d(arg0, arg1) {
1644
+ export function __wbg_set_onopen_ca8d311fe5282041(arg0, arg1) {
1645
1645
  arg0.onopen = arg1;
1646
1646
  }
1647
- export function __wbg_static_accessor_GLOBAL_60a4124bab7dcc9a() {
1648
- const ret = typeof global === 'undefined' ? null : global;
1647
+ export function __wbg_static_accessor_GLOBAL_THIS_2fee5048bcca5938() {
1648
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1649
1649
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1650
1650
  }
1651
- export function __wbg_static_accessor_GLOBAL_THIS_95ca6460658b5d13() {
1652
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1651
+ export function __wbg_static_accessor_GLOBAL_ce44e66a4935da8c() {
1652
+ const ret = typeof global === 'undefined' ? null : global;
1653
1653
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1654
1654
  }
1655
- export function __wbg_static_accessor_SELF_4c95f759a91e9aae() {
1655
+ export function __wbg_static_accessor_SELF_44f6e0cb5e67cdad() {
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_44b435597f9e9ee7() {
1659
+ export function __wbg_static_accessor_WINDOW_168f178805d978fe() {
1660
1660
  const ret = typeof window === 'undefined' ? null : window;
1661
1661
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1662
1662
  }
1663
- export function __wbg_then_254bab9b266a77a5(arg0, arg1, arg2) {
1663
+ export function __wbg_then_05edfc8a4fea5106(arg0, arg1, arg2) {
1664
1664
  const ret = arg0.then(arg1, arg2);
1665
1665
  return ret;
1666
1666
  }
1667
- export function __wbg_then_3ea18602c6a5123b(arg0, arg1) {
1667
+ export function __wbg_then_591b6b3a75ee817a(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__h683dea504854e4ad);
1677
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e);
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__h606a97e945b85c5b);
1682
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88);
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__h606a97e945b85c5b_2);
1687
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_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__h606a97e945b85c5b_3);
1692
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_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__h606a97e945b85c5b_4);
1697
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_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__h6de2c3ce706f5618);
1702
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9);
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__h6de2c3ce706f5618(arg0, arg1) {
1725
- wasm.wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618(arg0, arg1);
1724
+ function wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9(arg0, arg1) {
1725
+ wasm.wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9(arg0, arg1);
1726
1726
  }
1727
1727
 
1728
- function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b(arg0, arg1, arg2) {
1729
- wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b(arg0, arg1, arg2);
1728
+ function wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88(arg0, arg1, arg2) {
1729
+ wasm.wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88(arg0, arg1, arg2);
1730
1730
  }
1731
1731
 
1732
- function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2(arg0, arg1, arg2) {
1733
- wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2(arg0, arg1, arg2);
1732
+ function wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_2(arg0, arg1, arg2) {
1733
+ wasm.wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_2(arg0, arg1, arg2);
1734
1734
  }
1735
1735
 
1736
- function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3(arg0, arg1, arg2) {
1737
- wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3(arg0, arg1, arg2);
1736
+ function wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_3(arg0, arg1, arg2) {
1737
+ wasm.wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_3(arg0, arg1, arg2);
1738
1738
  }
1739
1739
 
1740
- function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4(arg0, arg1, arg2) {
1741
- wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4(arg0, arg1, arg2);
1740
+ function wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_4(arg0, arg1, arg2) {
1741
+ wasm.wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_4(arg0, arg1, arg2);
1742
1742
  }
1743
1743
 
1744
- function wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad(arg0, arg1, arg2) {
1745
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad(arg0, arg1, arg2);
1744
+ function wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e(arg0, arg1, arg2) {
1745
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e(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__h079668e3d7708ddd(arg0, arg1, arg2, arg3) {
1752
- wasm.wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(arg0, arg1, arg2, arg3);
1751
+ function wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f(arg0, arg1, arg2, arg3) {
1752
+ wasm.wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f(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__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;
125
+ export const wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e: (a: number, b: number, c: any) => [number, number];
126
+ export const wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f: (a: number, b: number, c: any, d: any) => void;
127
+ export const wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88: (a: number, b: number, c: any) => void;
128
+ export const wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_2: (a: number, b: number, c: any) => void;
129
+ export const wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_3: (a: number, b: number, c: any) => void;
130
+ export const wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_4: (a: number, b: number, c: any) => void;
131
+ export const wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9: (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__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;
837
+ readonly wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e: (a: number, b: number, c: any) => [number, number];
838
+ readonly wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f: (a: number, b: number, c: any, d: any) => void;
839
+ readonly wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88: (a: number, b: number, c: any) => void;
840
+ readonly wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_2: (a: number, b: number, c: any) => void;
841
+ readonly wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_3: (a: number, b: number, c: any) => void;
842
+ readonly wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_4: (a: number, b: number, c: any) => void;
843
+ readonly wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9: (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_b131b2f36d6b2f55: function(arg0) {
1445
+ __wbg___wbindgen_boolean_get_edaed31a367ce1bd: 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_56c147eb1a51f0c4: function(arg0, arg1) {
1450
+ __wbg___wbindgen_debug_string_8a447059637473e2: 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_147961669f068cd4: function(arg0) {
1457
+ __wbg___wbindgen_is_function_acc5528be2b923f2: function(arg0) {
1458
1458
  const ret = typeof(arg0) === 'function';
1459
1459
  return ret;
1460
1460
  },
1461
- __wbg___wbindgen_is_null_ced4761460071341: function(arg0) {
1461
+ __wbg___wbindgen_is_null_6d937fbfb6478470: function(arg0) {
1462
1462
  const ret = arg0 === null;
1463
1463
  return ret;
1464
1464
  },
1465
- __wbg___wbindgen_is_undefined_4410e3c20a99fa97: function(arg0) {
1465
+ __wbg___wbindgen_is_undefined_721f8decd50c87a3: function(arg0) {
1466
1466
  const ret = arg0 === undefined;
1467
1467
  return ret;
1468
1468
  },
1469
- __wbg___wbindgen_number_get_588ed6b97f0d7e14: function(arg0, arg1) {
1469
+ __wbg___wbindgen_number_get_1cc01dd708740256: 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_fa2687d531ed17a5: function(arg0, arg1) {
1475
+ __wbg___wbindgen_string_get_71bb4348194e31f0: 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,36 +1480,36 @@ 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_bbadd78c1bac3a77: function(arg0, arg1) {
1483
+ __wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
1484
1484
  throw new Error(getStringFromWasm0(arg0, arg1));
1485
1485
  },
1486
- __wbg__wbg_cb_unref_c2301a3c9b78104b: function(arg0) {
1486
+ __wbg__wbg_cb_unref_33c39e13d73b25f6: function(arg0) {
1487
1487
  arg0._wbg_cb_unref();
1488
1488
  },
1489
- __wbg_call_91f00ddc43e01490: function() { return handleError(function (arg0, arg1) {
1490
- const ret = arg0.call(arg1);
1489
+ __wbg_call_5575218572ead796: function() { return handleError(function (arg0, arg1, arg2) {
1490
+ const ret = arg0.call(arg1, arg2);
1491
1491
  return ret;
1492
1492
  }, arguments); },
1493
- __wbg_call_ec09a4cf93377d3a: function() { return handleError(function (arg0, arg1, arg2) {
1494
- const ret = arg0.call(arg1, arg2);
1493
+ __wbg_call_8e98ed2f3c86c4b5: function() { return handleError(function (arg0, arg1) {
1494
+ const ret = arg0.call(arg1);
1495
1495
  return ret;
1496
1496
  }, arguments); },
1497
1497
  __wbg_clearTimeout_113b1cde814ec762: function(arg0) {
1498
1498
  const ret = clearTimeout(arg0);
1499
1499
  return ret;
1500
1500
  },
1501
- __wbg_close_296263cfe1bb2999: function() { return handleError(function (arg0) {
1501
+ __wbg_close_26aa343c0d729303: function() { return handleError(function (arg0) {
1502
1502
  arg0.close();
1503
1503
  }, arguments); },
1504
- __wbg_data_8a04443c1e5a8cd3: function(arg0) {
1504
+ __wbg_data_4a7f1308dbd33a21: function(arg0) {
1505
1505
  const ret = arg0.data;
1506
1506
  return ret;
1507
1507
  },
1508
- __wbg_get_52a8a619f7b88df6: function() { return handleError(function (arg0, arg1) {
1508
+ __wbg_get_dddb90ff5d27a080: 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_a581da923203f29f: function(arg0) {
1512
+ __wbg_instanceof_ArrayBuffer_2a7bb09fee70c2da: 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_aa24ea31000d4ee6: function(arg0) {
1522
+ __wbg_instanceof_Promise_4614a0df6220bf3f: function(arg0) {
1523
1523
  let result;
1524
1524
  try {
1525
1525
  result = arg0 instanceof Promise;
@@ -1529,34 +1529,34 @@ function __wbg_get_imports() {
1529
1529
  const ret = result;
1530
1530
  return ret;
1531
1531
  },
1532
- __wbg_length_68a9d5278d084f4f: function(arg0) {
1532
+ __wbg_length_589238bdcf171f0e: function(arg0) {
1533
1533
  const ret = arg0.length;
1534
1534
  return ret;
1535
1535
  },
1536
- __wbg_new_0b303268aa395a38: function() {
1537
- const ret = new Array();
1536
+ __wbg_new_2e117a478906f062: function() {
1537
+ const ret = new Object();
1538
1538
  return ret;
1539
1539
  },
1540
- __wbg_new_20b778a4c5c691c3: function() {
1541
- const ret = new Object();
1540
+ __wbg_new_36e147a8ced3c6e0: function() {
1541
+ const ret = new Array();
1542
1542
  return ret;
1543
1543
  },
1544
- __wbg_new_a3e5112401a82338: function() { return handleError(function (arg0, arg1) {
1544
+ __wbg_new_5a19eef57e9178b5: function() { return handleError(function (arg0, arg1) {
1545
1545
  const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1546
1546
  return ret;
1547
1547
  }, arguments); },
1548
- __wbg_new_b06772b280cc6e52: function(arg0) {
1548
+ __wbg_new_81880fb5002cb255: function(arg0) {
1549
1549
  const ret = new Uint8Array(arg0);
1550
1550
  return ret;
1551
1551
  },
1552
- __wbg_new_b3334f9cd9f51d36: function(arg0, arg1) {
1552
+ __wbg_new_f85beb941dc6d8aa: function(arg0, arg1) {
1553
1553
  try {
1554
1554
  var state0 = {a: arg0, b: arg1};
1555
1555
  var cb0 = (arg0, arg1) => {
1556
1556
  const a = state0.a;
1557
1557
  state0.a = 0;
1558
1558
  try {
1559
- return wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(a, state0.b, arg0, arg1);
1559
+ return wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f(a, state0.b, arg0, arg1);
1560
1560
  } finally {
1561
1561
  state0.a = a;
1562
1562
  }
@@ -1567,22 +1567,22 @@ function __wbg_get_imports() {
1567
1567
  state0.a = 0;
1568
1568
  }
1569
1569
  },
1570
- __wbg_new_from_slice_ba57951b532accf0: function(arg0, arg1) {
1571
- const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
1570
+ __wbg_new_from_slice_543b875b27789a8f: function(arg0, arg1) {
1571
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1572
1572
  return ret;
1573
1573
  },
1574
- __wbg_new_from_slice_bb2d1778c0b87eb1: function(arg0, arg1) {
1575
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1574
+ __wbg_new_from_slice_8a37759f20de1131: function(arg0, arg1) {
1575
+ const ret = new Uint16Array(getArrayU16FromWasm0(arg0, arg1));
1576
1576
  return ret;
1577
1577
  },
1578
- __wbg_new_typed_90c3f6c29ba36d19: function(arg0, arg1) {
1578
+ __wbg_new_typed_00a409eb4ec4f2d9: 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__h079668e3d7708ddd(a, state0.b, arg0, arg1);
1585
+ return wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f(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_a5c14e4ca7b3d0b3: function(arg0) {
1596
+ __wbg_new_with_length_66ae39fdd9da8c1f: function(arg0) {
1597
1597
  const ret = new Uint16Array(arg0 >>> 0);
1598
1598
  return ret;
1599
1599
  },
1600
- __wbg_now_bce4dc999095ea77: function() {
1600
+ __wbg_now_d2e0afbad4edbe82: function() {
1601
1601
  const ret = Date.now();
1602
1602
  return ret;
1603
1603
  },
1604
- __wbg_prototypesetcall_956c7493c68e29b4: function(arg0, arg1, arg2) {
1604
+ __wbg_prototypesetcall_d721637c7ca66eb8: function(arg0, arg1, arg2) {
1605
1605
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1606
1606
  },
1607
- __wbg_push_ceb8ef046afb2041: function(arg0, arg1) {
1607
+ __wbg_push_f724b5db8acf89d2: function(arg0, arg1) {
1608
1608
  const ret = arg0.push(arg1);
1609
1609
  return ret;
1610
1610
  },
1611
- __wbg_queueMicrotask_4698f900840e3286: function(arg0) {
1612
- queueMicrotask(arg0);
1613
- },
1614
- __wbg_queueMicrotask_477a5533c7100338: function(arg0) {
1611
+ __wbg_queueMicrotask_1c9b3800e321a967: function(arg0) {
1615
1612
  const ret = arg0.queueMicrotask;
1616
1613
  return ret;
1617
1614
  },
1618
- __wbg_readyState_25243ad6ce649774: function(arg0) {
1615
+ __wbg_queueMicrotask_311744e534a929a3: function(arg0) {
1616
+ queueMicrotask(arg0);
1617
+ },
1618
+ __wbg_readyState_97951098f8995393: function(arg0) {
1619
1619
  const ret = arg0.readyState;
1620
1620
  return ret;
1621
1621
  },
1622
- __wbg_resolve_0183de2e8c6b1d54: function(arg0) {
1622
+ __wbg_resolve_d82363d90af6928a: function(arg0) {
1623
1623
  const ret = Promise.resolve(arg0);
1624
1624
  return ret;
1625
1625
  },
1626
- __wbg_send_99d049cae69c53cc: function() { return handleError(function (arg0, arg1, arg2) {
1626
+ __wbg_send_982c819b9a1b34a5: 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_a6ba3ac0e634b822: function() { return handleError(function (arg0, arg1, arg2) {
1633
+ __wbg_set_4564f7dc44fcb0c9: 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_8c2dd2cf1cfc2e28: function(arg0, arg1) {
1637
+ __wbg_set_binaryType_148427b11a8e6551: function(arg0, arg1) {
1638
1638
  arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1639
1639
  },
1640
- __wbg_set_onclose_9cb5c3372e16c192: function(arg0, arg1) {
1640
+ __wbg_set_onclose_8134952b2a9ec104: function(arg0, arg1) {
1641
1641
  arg0.onclose = arg1;
1642
1642
  },
1643
- __wbg_set_onerror_190fe67e911ebf28: function(arg0, arg1) {
1643
+ __wbg_set_onerror_3f68563f77d362f1: function(arg0, arg1) {
1644
1644
  arg0.onerror = arg1;
1645
1645
  },
1646
- __wbg_set_onmessage_96337495f0bfb796: function(arg0, arg1) {
1646
+ __wbg_set_onmessage_397a79f643011142: function(arg0, arg1) {
1647
1647
  arg0.onmessage = arg1;
1648
1648
  },
1649
- __wbg_set_onopen_3e2bf6b11d434c2d: function(arg0, arg1) {
1649
+ __wbg_set_onopen_ca8d311fe5282041: function(arg0, arg1) {
1650
1650
  arg0.onopen = arg1;
1651
1651
  },
1652
- __wbg_static_accessor_GLOBAL_60a4124bab7dcc9a: function() {
1653
- const ret = typeof global === 'undefined' ? null : global;
1652
+ __wbg_static_accessor_GLOBAL_THIS_2fee5048bcca5938: function() {
1653
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1654
1654
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1655
1655
  },
1656
- __wbg_static_accessor_GLOBAL_THIS_95ca6460658b5d13: function() {
1657
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1656
+ __wbg_static_accessor_GLOBAL_ce44e66a4935da8c: function() {
1657
+ const ret = typeof global === 'undefined' ? null : global;
1658
1658
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1659
1659
  },
1660
- __wbg_static_accessor_SELF_4c95f759a91e9aae: function() {
1660
+ __wbg_static_accessor_SELF_44f6e0cb5e67cdad: 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_44b435597f9e9ee7: function() {
1664
+ __wbg_static_accessor_WINDOW_168f178805d978fe: function() {
1665
1665
  const ret = typeof window === 'undefined' ? null : window;
1666
1666
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1667
1667
  },
1668
- __wbg_then_254bab9b266a77a5: function(arg0, arg1, arg2) {
1668
+ __wbg_then_05edfc8a4fea5106: function(arg0, arg1, arg2) {
1669
1669
  const ret = arg0.then(arg1, arg2);
1670
1670
  return ret;
1671
1671
  },
1672
- __wbg_then_3ea18602c6a5123b: function(arg0, arg1) {
1672
+ __wbg_then_591b6b3a75ee817a: 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__h683dea504854e4ad);
1682
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e);
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__h606a97e945b85c5b);
1687
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88);
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__h606a97e945b85c5b_2);
1692
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_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__h606a97e945b85c5b_3);
1697
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_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__h606a97e945b85c5b_4);
1702
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_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__h6de2c3ce706f5618);
1707
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9);
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__h6de2c3ce706f5618(arg0, arg1) {
1737
- wasm.wasm_bindgen__convert__closures_____invoke__h6de2c3ce706f5618(arg0, arg1);
1736
+ function wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9(arg0, arg1) {
1737
+ wasm.wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9(arg0, arg1);
1738
1738
  }
1739
1739
 
1740
- function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b(arg0, arg1, arg2) {
1741
- wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b(arg0, arg1, arg2);
1740
+ function wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88(arg0, arg1, arg2) {
1741
+ wasm.wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88(arg0, arg1, arg2);
1742
1742
  }
1743
1743
 
1744
- function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2(arg0, arg1, arg2) {
1745
- wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_2(arg0, arg1, arg2);
1744
+ function wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_2(arg0, arg1, arg2) {
1745
+ wasm.wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_2(arg0, arg1, arg2);
1746
1746
  }
1747
1747
 
1748
- function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3(arg0, arg1, arg2) {
1749
- wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_3(arg0, arg1, arg2);
1748
+ function wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_3(arg0, arg1, arg2) {
1749
+ wasm.wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_3(arg0, arg1, arg2);
1750
1750
  }
1751
1751
 
1752
- function wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4(arg0, arg1, arg2) {
1753
- wasm.wasm_bindgen__convert__closures_____invoke__h606a97e945b85c5b_4(arg0, arg1, arg2);
1752
+ function wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_4(arg0, arg1, arg2) {
1753
+ wasm.wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_4(arg0, arg1, arg2);
1754
1754
  }
1755
1755
 
1756
- function wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad(arg0, arg1, arg2) {
1757
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h683dea504854e4ad(arg0, arg1, arg2);
1756
+ function wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e(arg0, arg1, arg2) {
1757
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e(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__h079668e3d7708ddd(arg0, arg1, arg2, arg3) {
1764
- wasm.wasm_bindgen__convert__closures_____invoke__h079668e3d7708ddd(arg0, arg1, arg2, arg3);
1763
+ function wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f(arg0, arg1, arg2, arg3) {
1764
+ wasm.wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f(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__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;
125
+ export const wasm_bindgen__convert__closures_____invoke__h70d0e0a898258d9e: (a: number, b: number, c: any) => [number, number];
126
+ export const wasm_bindgen__convert__closures_____invoke__h2ccf26eb3569624f: (a: number, b: number, c: any, d: any) => void;
127
+ export const wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88: (a: number, b: number, c: any) => void;
128
+ export const wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_2: (a: number, b: number, c: any) => void;
129
+ export const wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_3: (a: number, b: number, c: any) => void;
130
+ export const wasm_bindgen__convert__closures_____invoke__h39c08e4c1f0d3f88_4: (a: number, b: number, c: any) => void;
131
+ export const wasm_bindgen__convert__closures_____invoke__hb1e87795906a82e9: (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,16 +1,19 @@
1
1
  {
2
2
  "name": "modbus-rs-wasm",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "description": "Modbus TCP/RTU/ASCII client & server for the browser, powered by Rust + WebAssembly",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
8
- "browser": "./dist/web/modbus-rs.js",
9
8
  "node": "./dist/bundler/modbus-rs.js",
10
9
  "import": "./dist/bundler/modbus-rs.js",
11
10
  "require": "./dist/bundler/modbus-rs.js",
12
11
  "types": "./dist/bundler/modbus-rs.d.ts"
13
12
  },
13
+ "./web": {
14
+ "import": "./dist/web/modbus-rs.js",
15
+ "types": "./dist/web/modbus-rs.d.ts"
16
+ },
14
17
  "./dist/bundler/*": "./dist/bundler/*",
15
18
  "./dist/web/*": "./dist/web/*"
16
19
  },
@@ -45,6 +48,7 @@
45
48
  "web-serial",
46
49
  "modbus-tcp",
47
50
  "modbus-rtu",
51
+ "modbus-ascii",
48
52
  "scada",
49
53
  "plc",
50
54
  "industrial",