lebai_sdk 0.1.9 → 0.1.10

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
@@ -240,11 +240,23 @@ export class Robot {
240
240
  set_signal(index: number, value: number): Promise<void>;
241
241
  /**
242
242
  * @param {number} index
243
+ * @param {any} values
244
+ * @returns {Promise<void>}
245
+ */
246
+ set_signals(index: number, values: any): Promise<void>;
247
+ /**
248
+ * @param {number} index
243
249
  * @returns {Promise<number>}
244
250
  */
245
251
  get_signal(index: number): Promise<number>;
246
252
  /**
247
253
  * @param {number} index
254
+ * @param {number} len
255
+ * @returns {Promise<any>}
256
+ */
257
+ get_signals(index: number, len: number): Promise<any>;
258
+ /**
259
+ * @param {number} index
248
260
  * @param {number} value
249
261
  * @returns {Promise<void>}
250
262
  */
@@ -261,10 +273,21 @@ export class Robot {
261
273
  /**
262
274
  * @param {number | undefined} id
263
275
  * @returns {Promise<string>}
276
+ */
277
+ wait_task(id?: number): Promise<string>;
278
+ /**
279
+ * @param {number | undefined} id
280
+ * @returns {Promise<string>}
264
281
  */
265
282
  get_task_state(id?: number): Promise<string>;
266
283
  /**
267
284
  * @param {string} device
285
+ * @param {number} timeout
286
+ * @returns {Promise<void>}
287
+ */
288
+ set_serial_timeout(device: string, timeout: number): Promise<void>;
289
+ /**
290
+ * @param {string} device
268
291
  * @param {number} baud_rate
269
292
  * @returns {Promise<void>}
270
293
  */
@@ -289,6 +312,12 @@ export class Robot {
289
312
  read_serial(device: string, len: number): Promise<any>;
290
313
  /**
291
314
  * @param {string} device
315
+ * @param {number} timeout
316
+ * @returns {Promise<void>}
317
+ */
318
+ set_modbus_timeout(device: string, timeout: number): Promise<void>;
319
+ /**
320
+ * @param {string} device
292
321
  * @param {string} pin
293
322
  * @param {boolean} value
294
323
  * @returns {Promise<void>}
@@ -344,6 +373,11 @@ export class Robot {
344
373
  */
345
374
  read_input_registers(device: string, pin: string, count: number): Promise<any>;
346
375
  /**
376
+ * @param {boolean | undefined} force
377
+ * @returns {Promise<void>}
378
+ */
379
+ init_claw(force?: boolean): Promise<void>;
380
+ /**
347
381
  * @param {number | undefined} force
348
382
  * @param {number | undefined} amplitude
349
383
  * @returns {Promise<void>}
@@ -431,6 +465,14 @@ export class Robot {
431
465
  */
432
466
  get_velocity_factor(): Promise<number>;
433
467
  /**
468
+ * @returns {Promise<any>}
469
+ */
470
+ get_kin_data(): Promise<any>;
471
+ /**
472
+ * @returns {Promise<any>}
473
+ */
474
+ get_robot_state(): Promise<any>;
475
+ /**
434
476
  * @param {string} name
435
477
  * @param {string | undefined} dir
436
478
  * @returns {Promise<any>}
package/lebai_sdk_bg.js CHANGED
@@ -24,28 +24,6 @@ function takeObject(idx) {
24
24
  return ret;
25
25
  }
26
26
 
27
- function isLikeNone(x) {
28
- return x === undefined || x === null;
29
- }
30
-
31
- let cachedFloat64Memory0 = null;
32
-
33
- function getFloat64Memory0() {
34
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
35
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
36
- }
37
- return cachedFloat64Memory0;
38
- }
39
-
40
- let cachedInt32Memory0 = null;
41
-
42
- function getInt32Memory0() {
43
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
44
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
45
- }
46
- return cachedInt32Memory0;
47
- }
48
-
49
27
  let WASM_VECTOR_LEN = 0;
50
28
 
51
29
  let cachedUint8Memory0 = null;
@@ -112,13 +90,17 @@ function passStringToWasm0(arg, malloc, realloc) {
112
90
  return ptr;
113
91
  }
114
92
 
115
- function addHeapObject(obj) {
116
- if (heap_next === heap.length) heap.push(heap.length + 1);
117
- const idx = heap_next;
118
- heap_next = heap[idx];
93
+ function isLikeNone(x) {
94
+ return x === undefined || x === null;
95
+ }
119
96
 
120
- heap[idx] = obj;
121
- return idx;
97
+ let cachedInt32Memory0 = null;
98
+
99
+ function getInt32Memory0() {
100
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
101
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
102
+ }
103
+ return cachedInt32Memory0;
122
104
  }
123
105
 
124
106
  const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
@@ -132,6 +114,24 @@ function getStringFromWasm0(ptr, len) {
132
114
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
133
115
  }
134
116
 
117
+ function addHeapObject(obj) {
118
+ if (heap_next === heap.length) heap.push(heap.length + 1);
119
+ const idx = heap_next;
120
+ heap_next = heap[idx];
121
+
122
+ heap[idx] = obj;
123
+ return idx;
124
+ }
125
+
126
+ let cachedFloat64Memory0 = null;
127
+
128
+ function getFloat64Memory0() {
129
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
130
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
131
+ }
132
+ return cachedFloat64Memory0;
133
+ }
134
+
135
135
  let cachedBigInt64Memory0 = null;
136
136
 
137
137
  function getBigInt64Memory0() {
@@ -231,19 +231,19 @@ function makeMutClosure(arg0, arg1, dtor, f) {
231
231
  return real;
232
232
  }
233
233
  function __wbg_adapter_48(arg0, arg1, arg2) {
234
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h591085db9e83f904(arg0, arg1, addHeapObject(arg2));
234
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h320f8689b9e2fb21(arg0, arg1, addHeapObject(arg2));
235
235
  }
236
236
 
237
- function __wbg_adapter_55(arg0, arg1) {
238
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h84dcb03881894fab(arg0, arg1);
237
+ function __wbg_adapter_53(arg0, arg1) {
238
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h997c007119b10a6c(arg0, arg1);
239
239
  }
240
240
 
241
241
  function __wbg_adapter_58(arg0, arg1, arg2) {
242
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf05c1ef7b6113485(arg0, arg1, addHeapObject(arg2));
242
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfd59a92c9507ac6c(arg0, arg1, addHeapObject(arg2));
243
243
  }
244
244
 
245
245
  function __wbg_adapter_61(arg0, arg1) {
246
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb0748eb214c10bca(arg0, arg1);
246
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hac13e1f13aca36fa(arg0, arg1);
247
247
  }
248
248
 
249
249
  let cachedUint32Memory0 = null;
@@ -322,8 +322,8 @@ function getArrayU8FromWasm0(ptr, len) {
322
322
  ptr = ptr >>> 0;
323
323
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
324
324
  }
325
- function __wbg_adapter_221(arg0, arg1, arg2, arg3) {
326
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h0410428e43c38f3f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
325
+ function __wbg_adapter_229(arg0, arg1, arg2, arg3) {
326
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h16f5953fde5af953(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
327
327
  }
328
328
 
329
329
  /**
@@ -688,6 +688,15 @@ export class Robot {
688
688
  }
689
689
  /**
690
690
  * @param {number} index
691
+ * @param {any} values
692
+ * @returns {Promise<void>}
693
+ */
694
+ set_signals(index, values) {
695
+ const ret = wasm.robot_set_signals(this.__wbg_ptr, index, addHeapObject(values));
696
+ return takeObject(ret);
697
+ }
698
+ /**
699
+ * @param {number} index
691
700
  * @returns {Promise<number>}
692
701
  */
693
702
  get_signal(index) {
@@ -696,6 +705,15 @@ export class Robot {
696
705
  }
697
706
  /**
698
707
  * @param {number} index
708
+ * @param {number} len
709
+ * @returns {Promise<any>}
710
+ */
711
+ get_signals(index, len) {
712
+ const ret = wasm.robot_get_signals(this.__wbg_ptr, index, len);
713
+ return takeObject(ret);
714
+ }
715
+ /**
716
+ * @param {number} index
699
717
  * @param {number} value
700
718
  * @returns {Promise<void>}
701
719
  */
@@ -723,12 +741,31 @@ export class Robot {
723
741
  * @param {number | undefined} id
724
742
  * @returns {Promise<string>}
725
743
  */
744
+ wait_task(id) {
745
+ const ret = wasm.robot_wait_task(this.__wbg_ptr, !isLikeNone(id), isLikeNone(id) ? 0 : id);
746
+ return takeObject(ret);
747
+ }
748
+ /**
749
+ * @param {number | undefined} id
750
+ * @returns {Promise<string>}
751
+ */
726
752
  get_task_state(id) {
727
753
  const ret = wasm.robot_get_task_state(this.__wbg_ptr, !isLikeNone(id), isLikeNone(id) ? 0 : id);
728
754
  return takeObject(ret);
729
755
  }
730
756
  /**
731
757
  * @param {string} device
758
+ * @param {number} timeout
759
+ * @returns {Promise<void>}
760
+ */
761
+ set_serial_timeout(device, timeout) {
762
+ const ptr0 = passStringToWasm0(device, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
763
+ const len0 = WASM_VECTOR_LEN;
764
+ const ret = wasm.robot_set_serial_timeout(this.__wbg_ptr, ptr0, len0, timeout);
765
+ return takeObject(ret);
766
+ }
767
+ /**
768
+ * @param {string} device
732
769
  * @param {number} baud_rate
733
770
  * @returns {Promise<void>}
734
771
  */
@@ -773,6 +810,17 @@ export class Robot {
773
810
  }
774
811
  /**
775
812
  * @param {string} device
813
+ * @param {number} timeout
814
+ * @returns {Promise<void>}
815
+ */
816
+ set_modbus_timeout(device, timeout) {
817
+ const ptr0 = passStringToWasm0(device, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
818
+ const len0 = WASM_VECTOR_LEN;
819
+ const ret = wasm.robot_set_modbus_timeout(this.__wbg_ptr, ptr0, len0, timeout);
820
+ return takeObject(ret);
821
+ }
822
+ /**
823
+ * @param {string} device
776
824
  * @param {string} pin
777
825
  * @param {boolean} value
778
826
  * @returns {Promise<void>}
@@ -884,6 +932,14 @@ export class Robot {
884
932
  return takeObject(ret);
885
933
  }
886
934
  /**
935
+ * @param {boolean | undefined} force
936
+ * @returns {Promise<void>}
937
+ */
938
+ init_claw(force) {
939
+ const ret = wasm.robot_init_claw(this.__wbg_ptr, isLikeNone(force) ? 0xFFFFFF : force ? 1 : 0);
940
+ return takeObject(ret);
941
+ }
942
+ /**
887
943
  * @param {number | undefined} force
888
944
  * @param {number | undefined} amplitude
889
945
  * @returns {Promise<void>}
@@ -1035,6 +1091,20 @@ export class Robot {
1035
1091
  return takeObject(ret);
1036
1092
  }
1037
1093
  /**
1094
+ * @returns {Promise<any>}
1095
+ */
1096
+ get_kin_data() {
1097
+ const ret = wasm.robot_get_kin_data(this.__wbg_ptr);
1098
+ return takeObject(ret);
1099
+ }
1100
+ /**
1101
+ * @returns {Promise<any>}
1102
+ */
1103
+ get_robot_state() {
1104
+ const ret = wasm.robot_get_robot_state(this.__wbg_ptr);
1105
+ return takeObject(ret);
1106
+ }
1107
+ /**
1038
1108
  * @param {string} name
1039
1109
  * @param {string | undefined} dir
1040
1110
  * @returns {Promise<any>}
@@ -1115,19 +1185,6 @@ export function __wbindgen_object_drop_ref(arg0) {
1115
1185
  takeObject(arg0);
1116
1186
  };
1117
1187
 
1118
- export function __wbindgen_number_get(arg0, arg1) {
1119
- const obj = getObject(arg1);
1120
- const ret = typeof(obj) === 'number' ? obj : undefined;
1121
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1122
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1123
- };
1124
-
1125
- export function __wbindgen_boolean_get(arg0) {
1126
- const v = getObject(arg0);
1127
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1128
- return ret;
1129
- };
1130
-
1131
1188
  export function __wbindgen_string_get(arg0, arg1) {
1132
1189
  const obj = getObject(arg1);
1133
1190
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -1137,11 +1194,17 @@ export function __wbindgen_string_get(arg0, arg1) {
1137
1194
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
1138
1195
  };
1139
1196
 
1140
- export function __wbindgen_number_new(arg0) {
1141
- const ret = arg0;
1197
+ export function __wbindgen_string_new(arg0, arg1) {
1198
+ const ret = getStringFromWasm0(arg0, arg1);
1142
1199
  return addHeapObject(ret);
1143
1200
  };
1144
1201
 
1202
+ export function __wbindgen_boolean_get(arg0) {
1203
+ const v = getObject(arg0);
1204
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1205
+ return ret;
1206
+ };
1207
+
1145
1208
  export function __wbg_robotsubscription_new(arg0) {
1146
1209
  const ret = RobotSubscription.__wrap(arg0);
1147
1210
  return addHeapObject(ret);
@@ -1152,14 +1215,21 @@ export function __wbg_robot_new(arg0) {
1152
1215
  return addHeapObject(ret);
1153
1216
  };
1154
1217
 
1218
+ export function __wbindgen_number_get(arg0, arg1) {
1219
+ const obj = getObject(arg1);
1220
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1221
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1222
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1223
+ };
1224
+
1155
1225
  export function __wbindgen_is_object(arg0) {
1156
1226
  const val = getObject(arg0);
1157
1227
  const ret = typeof(val) === 'object' && val !== null;
1158
1228
  return ret;
1159
1229
  };
1160
1230
 
1161
- export function __wbindgen_string_new(arg0, arg1) {
1162
- const ret = getStringFromWasm0(arg0, arg1);
1231
+ export function __wbindgen_number_new(arg0) {
1232
+ const ret = arg0;
1163
1233
  return addHeapObject(ret);
1164
1234
  };
1165
1235
 
@@ -1173,16 +1243,6 @@ export function __wbindgen_cb_drop(arg0) {
1173
1243
  return ret;
1174
1244
  };
1175
1245
 
1176
- export function __wbindgen_is_undefined(arg0) {
1177
- const ret = getObject(arg0) === undefined;
1178
- return ret;
1179
- };
1180
-
1181
- export function __wbindgen_in(arg0, arg1) {
1182
- const ret = getObject(arg0) in getObject(arg1);
1183
- return ret;
1184
- };
1185
-
1186
1246
  export function __wbindgen_is_bigint(arg0) {
1187
1247
  const ret = typeof(getObject(arg0)) === 'bigint';
1188
1248
  return ret;
@@ -1198,11 +1258,21 @@ export function __wbindgen_jsval_eq(arg0, arg1) {
1198
1258
  return ret;
1199
1259
  };
1200
1260
 
1261
+ export function __wbindgen_in(arg0, arg1) {
1262
+ const ret = getObject(arg0) in getObject(arg1);
1263
+ return ret;
1264
+ };
1265
+
1201
1266
  export function __wbindgen_bigint_from_u64(arg0) {
1202
1267
  const ret = BigInt.asUintN(64, arg0);
1203
1268
  return addHeapObject(ret);
1204
1269
  };
1205
1270
 
1271
+ export function __wbindgen_is_undefined(arg0) {
1272
+ const ret = getObject(arg0) === undefined;
1273
+ return ret;
1274
+ };
1275
+
1206
1276
  export function __wbindgen_error_new(arg0, arg1) {
1207
1277
  const ret = new Error(getStringFromWasm0(arg0, arg1));
1208
1278
  return addHeapObject(ret);
@@ -1441,7 +1511,7 @@ export function __wbg_new_2b55e405e4af4986(arg0, arg1) {
1441
1511
  const a = state0.a;
1442
1512
  state0.a = 0;
1443
1513
  try {
1444
- return __wbg_adapter_221(a, state0.b, arg0, arg1);
1514
+ return __wbg_adapter_229(a, state0.b, arg0, arg1);
1445
1515
  } finally {
1446
1516
  state0.a = a;
1447
1517
  }
@@ -1522,33 +1592,33 @@ export function __wbindgen_memory() {
1522
1592
  return addHeapObject(ret);
1523
1593
  };
1524
1594
 
1525
- export function __wbindgen_closure_wrapper1552(arg0, arg1, arg2) {
1526
- const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_48);
1595
+ export function __wbindgen_closure_wrapper1685(arg0, arg1, arg2) {
1596
+ const ret = makeMutClosure(arg0, arg1, 631, __wbg_adapter_48);
1527
1597
  return addHeapObject(ret);
1528
1598
  };
1529
1599
 
1530
- export function __wbindgen_closure_wrapper1554(arg0, arg1, arg2) {
1531
- const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_48);
1600
+ export function __wbindgen_closure_wrapper1687(arg0, arg1, arg2) {
1601
+ const ret = makeMutClosure(arg0, arg1, 631, __wbg_adapter_48);
1532
1602
  return addHeapObject(ret);
1533
1603
  };
1534
1604
 
1535
- export function __wbindgen_closure_wrapper1556(arg0, arg1, arg2) {
1536
- const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_48);
1605
+ export function __wbindgen_closure_wrapper1689(arg0, arg1, arg2) {
1606
+ const ret = makeMutClosure(arg0, arg1, 631, __wbg_adapter_53);
1537
1607
  return addHeapObject(ret);
1538
1608
  };
1539
1609
 
1540
- export function __wbindgen_closure_wrapper1558(arg0, arg1, arg2) {
1541
- const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_55);
1610
+ export function __wbindgen_closure_wrapper1691(arg0, arg1, arg2) {
1611
+ const ret = makeMutClosure(arg0, arg1, 631, __wbg_adapter_48);
1542
1612
  return addHeapObject(ret);
1543
1613
  };
1544
1614
 
1545
- export function __wbindgen_closure_wrapper2026(arg0, arg1, arg2) {
1546
- const ret = makeMutClosure(arg0, arg1, 663, __wbg_adapter_58);
1615
+ export function __wbindgen_closure_wrapper2166(arg0, arg1, arg2) {
1616
+ const ret = makeMutClosure(arg0, arg1, 706, __wbg_adapter_58);
1547
1617
  return addHeapObject(ret);
1548
1618
  };
1549
1619
 
1550
- export function __wbindgen_closure_wrapper2061(arg0, arg1, arg2) {
1551
- const ret = makeMutClosure(arg0, arg1, 677, __wbg_adapter_61);
1620
+ export function __wbindgen_closure_wrapper2201(arg0, arg1, arg2) {
1621
+ const ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_61);
1552
1622
  return addHeapObject(ret);
1553
1623
  };
1554
1624
 
package/lebai_sdk_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lebai_sdk",
3
3
  "description": "lebai_sdk",
4
- "version": "0.1.9",
4
+ "version": "0.1.10",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
7
7
  "type": "git",