lebai_sdk 0.2.1 → 0.2.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/lebai_sdk.d.ts CHANGED
@@ -12,6 +12,15 @@ export function connect(ip: string, simu: boolean): Promise<Robot>;
12
12
  */
13
13
  export function discover_devices(time: number): Promise<any>;
14
14
  /**
15
+ * @param {any} ms
16
+ * @returns {Promise<void>}
17
+ */
18
+ export function sleep_ms(ms: any): Promise<void>;
19
+ /**
20
+ * @returns {any}
21
+ */
22
+ export function timestamp(): any;
23
+ /**
15
24
  * @returns {string}
16
25
  */
17
26
  export function version(): string;
@@ -526,6 +535,10 @@ export class Robot {
526
535
  */
527
536
  get_robot_state(): Promise<any>;
528
537
  /**
538
+ * @returns {Promise<any>}
539
+ */
540
+ get_phy_data(): Promise<any>;
541
+ /**
529
542
  * @param {string} name
530
543
  * @param {string | undefined} [dir]
531
544
  * @returns {Promise<any>}
package/lebai_sdk_bg.js CHANGED
@@ -4,14 +4,43 @@ export function __wbg_set_wasm(val) {
4
4
  }
5
5
 
6
6
 
7
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
8
+
9
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
10
+
11
+ cachedTextDecoder.decode();
12
+
13
+ let cachedUint8Memory0 = null;
14
+
15
+ function getUint8Memory0() {
16
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
17
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
18
+ }
19
+ return cachedUint8Memory0;
20
+ }
21
+
22
+ function getStringFromWasm0(ptr, len) {
23
+ ptr = ptr >>> 0;
24
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
25
+ }
26
+
7
27
  const heap = new Array(128).fill(undefined);
8
28
 
9
29
  heap.push(undefined, null, true, false);
10
30
 
11
- function getObject(idx) { return heap[idx]; }
12
-
13
31
  let heap_next = heap.length;
14
32
 
33
+ function addHeapObject(obj) {
34
+ if (heap_next === heap.length) heap.push(heap.length + 1);
35
+ const idx = heap_next;
36
+ heap_next = heap[idx];
37
+
38
+ heap[idx] = obj;
39
+ return idx;
40
+ }
41
+
42
+ function getObject(idx) { return heap[idx]; }
43
+
15
44
  function dropObject(idx) {
16
45
  if (idx < 132) return;
17
46
  heap[idx] = heap_next;
@@ -26,15 +55,6 @@ function takeObject(idx) {
26
55
 
27
56
  let WASM_VECTOR_LEN = 0;
28
57
 
29
- let cachedUint8Memory0 = null;
30
-
31
- function getUint8Memory0() {
32
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
33
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
34
- }
35
- return cachedUint8Memory0;
36
- }
37
-
38
58
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
39
59
 
40
60
  let cachedTextEncoder = new lTextEncoder('utf-8');
@@ -103,26 +123,6 @@ function getInt32Memory0() {
103
123
  return cachedInt32Memory0;
104
124
  }
105
125
 
106
- function addHeapObject(obj) {
107
- if (heap_next === heap.length) heap.push(heap.length + 1);
108
- const idx = heap_next;
109
- heap_next = heap[idx];
110
-
111
- heap[idx] = obj;
112
- return idx;
113
- }
114
-
115
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
116
-
117
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
118
-
119
- cachedTextDecoder.decode();
120
-
121
- function getStringFromWasm0(ptr, len) {
122
- ptr = ptr >>> 0;
123
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
124
- }
125
-
126
126
  let cachedFloat64Memory0 = null;
127
127
 
128
128
  function getFloat64Memory0() {
@@ -282,6 +282,34 @@ export function discover_devices(time) {
282
282
  return takeObject(ret);
283
283
  }
284
284
 
285
+ /**
286
+ * @param {any} ms
287
+ * @returns {Promise<void>}
288
+ */
289
+ export function sleep_ms(ms) {
290
+ const ret = wasm.sleep_ms(addHeapObject(ms));
291
+ return takeObject(ret);
292
+ }
293
+
294
+ /**
295
+ * @returns {any}
296
+ */
297
+ export function timestamp() {
298
+ try {
299
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
300
+ wasm.timestamp(retptr);
301
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
302
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
303
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
304
+ if (r2) {
305
+ throw takeObject(r1);
306
+ }
307
+ return takeObject(r0);
308
+ } finally {
309
+ wasm.__wbindgen_add_to_stack_pointer(16);
310
+ }
311
+ }
312
+
285
313
  /**
286
314
  * @returns {string}
287
315
  */
@@ -322,7 +350,7 @@ function getArrayU8FromWasm0(ptr, len) {
322
350
  ptr = ptr >>> 0;
323
351
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
324
352
  }
325
- function __wbg_adapter_246(arg0, arg1, arg2, arg3) {
353
+ function __wbg_adapter_249(arg0, arg1, arg2, arg3) {
326
354
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h1c52eb2f9f0daf09(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
327
355
  }
328
356
 
@@ -1201,6 +1229,13 @@ export class Robot {
1201
1229
  return takeObject(ret);
1202
1230
  }
1203
1231
  /**
1232
+ * @returns {Promise<any>}
1233
+ */
1234
+ get_phy_data() {
1235
+ const ret = wasm.robot_get_phy_data(this.__wbg_ptr);
1236
+ return takeObject(ret);
1237
+ }
1238
+ /**
1204
1239
  * @param {string} name
1205
1240
  * @param {string | undefined} [dir]
1206
1241
  * @returns {Promise<any>}
@@ -1277,10 +1312,20 @@ export class RobotSubscription {
1277
1312
  }
1278
1313
  }
1279
1314
 
1315
+ export function __wbindgen_string_new(arg0, arg1) {
1316
+ const ret = getStringFromWasm0(arg0, arg1);
1317
+ return addHeapObject(ret);
1318
+ };
1319
+
1280
1320
  export function __wbindgen_object_drop_ref(arg0) {
1281
1321
  takeObject(arg0);
1282
1322
  };
1283
1323
 
1324
+ export function __wbindgen_number_new(arg0) {
1325
+ const ret = arg0;
1326
+ return addHeapObject(ret);
1327
+ };
1328
+
1284
1329
  export function __wbindgen_string_get(arg0, arg1) {
1285
1330
  const obj = getObject(arg1);
1286
1331
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -1290,38 +1335,13 @@ export function __wbindgen_string_get(arg0, arg1) {
1290
1335
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
1291
1336
  };
1292
1337
 
1293
- export function __wbindgen_number_new(arg0) {
1294
- const ret = arg0;
1295
- return addHeapObject(ret);
1296
- };
1297
-
1298
- export function __wbindgen_string_new(arg0, arg1) {
1299
- const ret = getStringFromWasm0(arg0, arg1);
1300
- return addHeapObject(ret);
1301
- };
1302
-
1303
- export function __wbg_robot_new(arg0) {
1304
- const ret = Robot.__wrap(arg0);
1305
- return addHeapObject(ret);
1306
- };
1307
-
1308
1338
  export function __wbg_robotsubscription_new(arg0) {
1309
1339
  const ret = RobotSubscription.__wrap(arg0);
1310
1340
  return addHeapObject(ret);
1311
1341
  };
1312
1342
 
1313
- export function __wbindgen_cb_drop(arg0) {
1314
- const obj = takeObject(arg0).original;
1315
- if (obj.cnt-- == 1) {
1316
- obj.a = 0;
1317
- return true;
1318
- }
1319
- const ret = false;
1320
- return ret;
1321
- };
1322
-
1323
- export function __wbindgen_error_new(arg0, arg1) {
1324
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1343
+ export function __wbg_robot_new(arg0) {
1344
+ const ret = Robot.__wrap(arg0);
1325
1345
  return addHeapObject(ret);
1326
1346
  };
1327
1347
 
@@ -1374,6 +1394,21 @@ export function __wbindgen_bigint_from_u64(arg0) {
1374
1394
  return addHeapObject(ret);
1375
1395
  };
1376
1396
 
1397
+ export function __wbindgen_cb_drop(arg0) {
1398
+ const obj = takeObject(arg0).original;
1399
+ if (obj.cnt-- == 1) {
1400
+ obj.a = 0;
1401
+ return true;
1402
+ }
1403
+ const ret = false;
1404
+ return ret;
1405
+ };
1406
+
1407
+ export function __wbindgen_error_new(arg0, arg1) {
1408
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1409
+ return addHeapObject(ret);
1410
+ };
1411
+
1377
1412
  export function __wbindgen_object_clone_ref(arg0) {
1378
1413
  const ret = getObject(arg0);
1379
1414
  return addHeapObject(ret);
@@ -1641,7 +1676,7 @@ export function __wbg_new_60f57089c7563e81(arg0, arg1) {
1641
1676
  const a = state0.a;
1642
1677
  state0.a = 0;
1643
1678
  try {
1644
- return __wbg_adapter_246(a, state0.b, arg0, arg1);
1679
+ return __wbg_adapter_249(a, state0.b, arg0, arg1);
1645
1680
  } finally {
1646
1681
  state0.a = a;
1647
1682
  }
@@ -1722,33 +1757,33 @@ export function __wbindgen_memory() {
1722
1757
  return addHeapObject(ret);
1723
1758
  };
1724
1759
 
1725
- export function __wbindgen_closure_wrapper1703(arg0, arg1, arg2) {
1726
- const ret = makeMutClosure(arg0, arg1, 684, __wbg_adapter_48);
1760
+ export function __wbindgen_closure_wrapper1731(arg0, arg1, arg2) {
1761
+ const ret = makeMutClosure(arg0, arg1, 701, __wbg_adapter_48);
1727
1762
  return addHeapObject(ret);
1728
1763
  };
1729
1764
 
1730
- export function __wbindgen_closure_wrapper1705(arg0, arg1, arg2) {
1731
- const ret = makeMutClosure(arg0, arg1, 684, __wbg_adapter_48);
1765
+ export function __wbindgen_closure_wrapper1733(arg0, arg1, arg2) {
1766
+ const ret = makeMutClosure(arg0, arg1, 701, __wbg_adapter_48);
1732
1767
  return addHeapObject(ret);
1733
1768
  };
1734
1769
 
1735
- export function __wbindgen_closure_wrapper1707(arg0, arg1, arg2) {
1736
- const ret = makeMutClosure(arg0, arg1, 684, __wbg_adapter_53);
1770
+ export function __wbindgen_closure_wrapper1735(arg0, arg1, arg2) {
1771
+ const ret = makeMutClosure(arg0, arg1, 701, __wbg_adapter_53);
1737
1772
  return addHeapObject(ret);
1738
1773
  };
1739
1774
 
1740
- export function __wbindgen_closure_wrapper1709(arg0, arg1, arg2) {
1741
- const ret = makeMutClosure(arg0, arg1, 684, __wbg_adapter_48);
1775
+ export function __wbindgen_closure_wrapper1737(arg0, arg1, arg2) {
1776
+ const ret = makeMutClosure(arg0, arg1, 701, __wbg_adapter_48);
1742
1777
  return addHeapObject(ret);
1743
1778
  };
1744
1779
 
1745
- export function __wbindgen_closure_wrapper2442(arg0, arg1, arg2) {
1746
- const ret = makeMutClosure(arg0, arg1, 794, __wbg_adapter_58);
1780
+ export function __wbindgen_closure_wrapper2471(arg0, arg1, arg2) {
1781
+ const ret = makeMutClosure(arg0, arg1, 811, __wbg_adapter_58);
1747
1782
  return addHeapObject(ret);
1748
1783
  };
1749
1784
 
1750
- export function __wbindgen_closure_wrapper2491(arg0, arg1, arg2) {
1751
- const ret = makeMutClosure(arg0, arg1, 813, __wbg_adapter_61);
1785
+ export function __wbindgen_closure_wrapper2520(arg0, arg1, arg2) {
1786
+ const ret = makeMutClosure(arg0, arg1, 830, __wbg_adapter_61);
1752
1787
  return addHeapObject(ret);
1753
1788
  };
1754
1789
 
package/lebai_sdk_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "rise0chen<rise0chen@163.com>"
5
5
  ],
6
6
  "description": "lebai_sdk",
7
- "version": "0.2.1",
7
+ "version": "0.2.2",
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "repository": {
10
10
  "type": "git",