> thats exactly what pyowfs does ... via the owcapi library ... > > so if you create the connection, libowcapi gets initialised > > if you scan for devices libcapi gets queried about devices ... > > if the devices dont disappear i suspect that you would get the same > bahaviour if you use libcapi directly - but i dont know if libcapi is > used in e.g. owserver ... ?!?!? > > you should definitely > > root.use_cache (False) > > otherwise ... ;) > > but there exists functionality in libcapi.py (used by pyowfs) to close > and or reinitialise libcapi - but this is not exposed in pyowfs - > however you could try the following: > > > root = pyowfs.Connection (...) > > while True : > root.capi.reinit () > s = root.find (...) > > > if there is demand for providing a "close" method in the Connection > object i can add it ... for now you must call > > root.capi.finish () > > regards, > marcus. > > > To solve the problem, I have owfs mounted and I am reading the devices from its file structure right now. It looks it is a bit faster with the passive RS232 adapter. Because of that I can not provide feedback right now.
But what you propose looks exactly what I wanted, when I was trying to write the code using the pyowfs. For devices, that are not connected to the bus permanently (like iButton for example), there is a need to reinit() the bus repeatedly, otherwise new devices are not discovered. I guess the finish() is not necessary to use, when new instance of the root object is not created repeatedly over and over again. Anyway, IMHO, the new instance of the same object (root) has to kill (delete) the old object (Python works this way) and, because of that, all connections to /dev/ttySx have to be closed. +1 for all new proposed methods anyway Regards Per
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers