desionlab / node-cashcode-bv

Library for working with "CashCode" Bill Validator devices from Node.js app.
MIT License
11 stars 8 forks source link

How do I change default timeout before bill acceptor return banknote, if not invoking stack method #7

Open scorpioRED opened 5 years ago

scorpioRED commented 5 years ago

Hi! Thanks for your great project! In my case when bill acceptor got a banknote, I send an HTTP request to the server

 device.on('escrow', async function (bill) {
    doRequest.then(result => {
        if(result == 'ok'){
           device.stack();
       }else {
            device.retrieve();
       }
    })
})

So, sometimes when system lost internet connection and the HTTP request is still pending, after about 11 seconds the bill acceptor starting return banknote (automatic) before I got HTTP response. How do I change or remove this timeout?

fenixphp commented 5 years ago

This is a feature of the device and it can not be changed (see the official documentation). I can advise at 9 seconds the device translates into a "hold" mode, but there are some pitfalls here.