On 11/05/2011 09:17 AM, Colin Law wrote:
> On 5 November 2011 12:33, Roberto Spadim<[email protected]> wrote:
>> [ snip of ideas for how owfs could produce more intelligent output ]
>>
>> well i think that´s enought to don´t work with external bash scripts, right?
>
> I don't agree. OWFS should be just about producing the data. It has
> to be kept as light as possible as it must run on kit with very low
> resources. Any further sophistication should be built *on top of*
> owfs, not built *into* it.
Okay, fair enough; I can agree with this (up to a certain point). owlib
already does format conversion for most data read from 1-Wire sensors,
though. For example, when reading a temperature from a DS18B20 sensor,
owlib receives a 12-bit number. When you access the temperature file,
however, you obtain an nicely formatted number that is human readable.
So, where do you draw the line between "just give me a binary number"
and "give me nicely formatted data"?
In terms of efficiency, retrieving the following structure:
struct environs {
uint16_t rh;
uint16_t temp;
uint8_t luminosity;
}
in a single bus operation is more efficient than going through 3
separate bus operations to obtain the same 5 bytes of data. From a
microcontroller code point of view, it is also a bit easier and more
efficient to write the code to do a single 5-byte data transfer than it
is to do two separate 2-byte and one 1-byte transfers. Sometimes,
especially when you are tight on flash memory space on the
microcontroller, small optimizations like this do make a difference.
Having said this, I am not aware of any device supported by owlib, and
that offers more than one measured variable, that can be accessed via
OWFS in a way that produces all the measured variables in a single file
access operation. That's why I asked how one would go about it. But
thinking about this some more, this is just a memory read operation, and
there are plenty of examples of that in owlib (I've even implemented
this for the multi-sensor I'm developing, so I think I should be set).
Cheers,
Eloy Paris.-
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers