Hi Paul, On 07/07/2011 04:26 PM, Paul Alfille wrote:
> owq is filled by the "read" command -- i.e. a filesystem read has size > and offset as part of the call. Buffer (for the result) is allocated as > well. You don't need to worry about how it's filled in, that comes from > the OW_read routines (or OW_write). Ah, yes -- this all makes sense. What was confusing me is that I was looking at all this from a command line point of view. You just don't have a read offset and read size when you use "cat" to read files ;-) I think the above simple explanation is what made me understand what I was dealing with. > Those MACROs: OWQ_buffer, OWQ_size, OWQ_offset call the relevant fields > from the structure. Yup. I saw the macros in the corresponding header file. I just was not seeing how the owq structures was supposed to get filled when accessing the file from the command line with an utility like "cat". The answer is that it doesn't get filled if you use "cat". > OW_r_mem, in this case, takes those parameters, and knows what 1-wire > commands to send to the device to read the memory. Yup; once you explained everything made sense and all pieces fell into place. The rest is just microcontroller code. > In the case of BAE, as I recall, there was the added "complexity" that > the chip and memory read is designed as a long linear address space, > while the various fields exposed (EEPROM, user mem, variables) are > subsets of that space. We remap the start to correspond to the correct > chip address space while keeping the bounds checking correct. I have not reached this point yet with my own device but I think that at some point I will. > All this is a thin object-oriented layer written in C. owq stands for > one-wire-query, and hold the field's size, offset, data buffer, and all > the flags and parsed path information. This way we use a similar data > structure independent of the data type (float, integer, boolean, data, > memory). Yup; thanks for the explanation. It's easier to understand things now after your explanation. Cheers, Eloy Paris.- ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers