On Thu, Aug 4, 2011 at 12:41 PM, Mark Richards
<[email protected]>wrote:

> Three questions:
>
> 1. Using the C API for OWFS, I would like a function that would return
> the full path to a specific ID.  My program would then store the path in
> a structure for later use.
>
> It seemed at first glance that FS_devicefind() might to, but in passing
> an empty structure and a device ID, I get nothing in the passed structure:
>
>     struct parsedname pn;
>     FS_devicefind("28.CFB8C0000000", &pn);
>
> I am using the python example to get a listing of all devices, but would
> rather do this within C rather than calling external tools.
>
> Maybe I am dabbling too deeply here...
>
>
I'm a little confused by the "complete path". "28.CFB8C0000000" is the
complete path, unless you want specific bus or you are using DS2409
microhubs.

If you really want to delve into the details,
FS_Parsedname( "28.CFB8C0000000" ) will find the device and fill in the
parsename structure. (You have to then clean up with FS_ParsedName_destroy
).

I think an easier way would be to do a complete directory traversal (i.e.
GET("/") and get of every directory 1F.nnnn/main|aux ) to generate a list. I
think most of the data is revealed at a high level (get/put or
read/write/dir) than having to user low-level functions.


> 2. Does a OW_get() to a device in the uncached/ directory force, for
> example with temperature sensors, an immediate conversion or must I
> touch the temperature12 file before doing OW_get?
>
>
It's the "uncached" in the path that forces a conversion. "touch" does
nothing. If you look at the FUSE interface, only read, write and readdir
(and fstat) are actually implemented. open, close and all the rest are
ignored.


> 3. Where is the conversion time stored?  Or is it logged?  It is
> important (to my application) to know when the result I am reading in,
> for example temperature12, was converted.
>
> Everything is done "on demand" so the reading is done when you call read
the value. If you want to avoid the caching, just use "uncached."

The technical answer is that the timestamp for the reading is kept in the
cache hash table and isn't exposed to the rest of the program.



> /m
>
>
> ------------------------------------------------------------------------------
> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to