Closed jonnylamb closed 6 months ago
Yes, this is intended. The Application class takes hold of this in the init function. Might be able to work around this by using del
on the first object before creating a new one. But only one Application object is intended to be used during the liftetime of the program. That doesn't stop one from using multiple channels and similar of course.
del a
before creating b
does not work.
How do you suggest I create another connection in the same process after the first one has disconnected then?
Yeah, that is a good question - and something I haven't tried yet. I'll experiment a bit with this and see if I can find a good solution for this.
Thanks, would be incredible to get a good solution to this.
Relatedly, after swapping the dev.set_configuration()
and dev.reset()
calls in ant/base/driver.py
I found I could make multiple Application
instances (to the same device) but only after receiving a Resource busy
exception first, as quoted above.
I expect the main solution here will be gracely close the channel.
Will be possible with Pull #54.
Also see examples for this.
I get
usb.core.USBError: [Errno 16] Resource busy
when creating anotherant.fs.manager.Application
instance using the same device:With this test script I get the following traceback. https://gist.github.com/jonnylamb/a794c732bff1e1883d1a