I'm working with an OPOS device and I've noticed that if something fails before my code gets the chance to release/close the device, that ClaimDevice fails from there forward (usually error 101). Even if I shut down the app. or physically power off the device, the call to ClaimDevice still fails. I physically have to reboot the machine to get it to start working on.
While I can code to make sure I always release/close it, this really scares me since in a production environment since I have no way of gracefully recovering from this.
Even worse, I've seen cases where after this failure and after shutting down the app. and restarting the API calls don't return errors, but definitely don't work anymore.
Is there any better way of handling this?