Hi Paul, On 11/06/2011 08:13 AM, Paul Alfille wrote:
> Eloy, > > You can set up an "array" -- a property that have several (indexed) > values. Assuming that you are reading data that is all the same type > (floating point in this case) and you keep track of the position of the > values, and you ignore the automatic temperature scale conversion this > would work well. When you read eloy.ALL you would get "27.3,90.2,1003" I like the .ALL approach although I do not think it would work in the case of my multi-sensor device since each variable is stored internally in different formats -- some values are integers that need to be divided by 10 to get the final value, another one is a 16-bit number that needs to be multiplied by .0625 (a DS18B20 temperature), another is just an 8-bit unsigned integer. > A bigger question is why you want this? The cost of the "file commands" > is very low -- there is no actual file activity -- these are all > virtual FUSE files. I was mainly thinking about ease of implementation on the microcontroller side, i.e. one 1-Wire transaction that brings in all the environmental variables, and also about ease of getting values from an application that uses owlib services. Based on received feedback, though, I have desisted from using this approach, and I just implemented different files for each environmental variable (temperature, humidity, luminosity). It was actually not too difficult to implement on the microcontroller side. Cheers, Eloy Paris.- > On Sat, Nov 5, 2011 at 7:41 AM, Eloy Paris <pe...@chapus.net > <mailto:pe...@chapus.net>> wrote: > > Hello developers, > > I am working on a 1-Wire device that provides multi-sensor data, i.e. > temperature, humidity, luminosity. I'd like to be able to have an OWFS > file that allows me to do this: > > $ cat /owfs2/uncached/99.010203040506/environs; echo > temp=25.2 RH=48% light=252 > > This would allow for easy parsing of environmental data without having > to access different files, i.e. one file for temperature, another for > humidity, etc. > > I am not sure about how to best set up the struct filetype entry to > accomplish this. In particular, what should I use for the suglen and > format fields? > > In looking at the possibilities, it seems to me like ft_vascii for the > format is something that could work, but then I am not sure about what > to use for the suglen field (I guess I could use the largest length that > could be produced). > > Any thoughts on the approach I am considering or if there is a better > way to do this? > > Thanks in advance. > > 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 Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers