m-bus-parser-wasm-pack 0.6.1 → 0.7.0

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.
@@ -25,3 +25,5 @@ export function m_bus_parse(data: string, format: string): string;
25
25
  * Compatibility wrapper returning errors as text. Prefer `m_bus_render`.
26
26
  */
27
27
  export function m_bus_parse_with_key(data: string, format: string, key_hex: string): string;
28
+ export function m_bus_decode_tls(data: string, session_json: string): any;
29
+ export function m_bus_render_tls(data: string, format: string, session_json: string, width: number | null | undefined, application_only: boolean): string;
@@ -301,6 +301,56 @@ export function m_bus_parse_with_key(data, format, key_hex) {
301
301
  }
302
302
  }
303
303
 
304
+ /**
305
+ * @param {string} data
306
+ * @param {string} session_json
307
+ * @returns {any}
308
+ */
309
+ export function m_bus_decode_tls(data, session_json) {
310
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
311
+ const len0 = WASM_VECTOR_LEN;
312
+ const ptr1 = passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
313
+ const len1 = WASM_VECTOR_LEN;
314
+ const ret = wasm.m_bus_decode_tls(ptr0, len0, ptr1, len1);
315
+ if (ret[2]) {
316
+ throw takeFromExternrefTable0(ret[1]);
317
+ }
318
+ return takeFromExternrefTable0(ret[0]);
319
+ }
320
+
321
+ /**
322
+ * @param {string} data
323
+ * @param {string} format
324
+ * @param {string} session_json
325
+ * @param {number | null | undefined} width
326
+ * @param {boolean} application_only
327
+ * @returns {string}
328
+ */
329
+ export function m_bus_render_tls(data, format, session_json, width, application_only) {
330
+ let deferred5_0;
331
+ let deferred5_1;
332
+ try {
333
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
+ const len0 = WASM_VECTOR_LEN;
335
+ const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
336
+ const len1 = WASM_VECTOR_LEN;
337
+ const ptr2 = passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
338
+ const len2 = WASM_VECTOR_LEN;
339
+ const ret = wasm.m_bus_render_tls(ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(width) ? 0x100000001 : (width) >>> 0, application_only);
340
+ var ptr4 = ret[0];
341
+ var len4 = ret[1];
342
+ if (ret[3]) {
343
+ ptr4 = 0; len4 = 0;
344
+ throw takeFromExternrefTable0(ret[2]);
345
+ }
346
+ deferred5_0 = ptr4;
347
+ deferred5_1 = len4;
348
+ return getStringFromWasm0(ptr4, len4);
349
+ } finally {
350
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
351
+ }
352
+ }
353
+
304
354
  export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
305
355
  const ret = Error(getStringFromWasm0(arg0, arg1));
306
356
  return ret;
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Michael Aebli"
6
6
  ],
7
7
  "description": "A wasm-pack to use the library for parsing M-Bus frames",
8
- "version": "0.6.1",
8
+ "version": "0.7.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",