feat: add Web Serial API integration to read live weight from MERK scale directly into POS cart items
This commit is contained in:
parent
33e5df92d8
commit
886df44ae0
@ -6448,10 +6448,10 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
const decoder = new TextDecoder('utf-8');
|
||||
let readCount = 0;
|
||||
|
||||
while (readCount < 30) {
|
||||
while (readCount < 100) {
|
||||
const { value, done } = await Promise.race([
|
||||
reader.read(),
|
||||
new Promise((_, reject) => setTimeout(() => reject(new Error('Timeout')), 1000))
|
||||
new Promise((_, reject) => setTimeout(() => reject(new Error('Timeout')), 500))
|
||||
]).catch(e => ({ done: true, value: null }));
|
||||
|
||||
if (done) break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user