there's some information about 'field' type in some owfs directory, when i
done this json i didn't done many work doing it 'exactly' what should be
ie, temperature should be a float field... 'temperature':1234, and not a
string "          1234"
i don't see problems here, but i didn't found where to get this field
information (binary,float,integer,text,etc..) inside owhttpd source code

maybe a new patch could do this work, but i have no idea how to do this,
since field information is placed at owserver (or owhttp) side, and not at
owhttp (client side)

in a php ownet library i done a http get to this structure to check what
type of field we are getting and casting it with the right type, but it is
too expensive (2 gets instead of only one), well maybe a better type cast
could be nice, just somework to do it right


2013/5/13 Paul Alfille <[email protected]>

> So here is a typical entry for http://localhost:4444/text/10.401D54000800
>
> address 10401D54000800BE
> alias
> crc8 BE
> errata
> family 10
> id 401D54000800
> locator FFFFFFFFFFFFFFFF
> power 0
> r_address BE000800541D4010
> r_id 000800541D40
> r_locator FFFFFFFFFFFFFFFF
> scratchpad 2D004B28FFFF03106E
> temperature       22.625
> temphigh           75
> templow           40
> type DS18S20
>
> And here for http://localhost:4444/json/10.401D54000800
>
> {
> "address":"10401D54000800BE",
> "alias":"",
> "crc8":"BE",
> "errata":[],
> "family":"10",
> "id":"401D54000800",
> "locator":"FFFFFFFFFFFFFFFF",
> "power":"false",
> "r_address":"BE000800541D4010",
> "r_id":"000800541D40",
> "r_locator":"FFFFFFFFFFFFFFFF",
> "scratchpad":"2D004B28FFFF03106E",
> "temperature":"     22.5625",
> "temphigh":"          75",
> "templow":"          40",
> "type":"DS18S20",
> }
>
> Should it be?
> {
> "address":"10401D54000800BE",
> "alias":"",
> "crc8":"BE",
> "errata":[],
> "family":"10",
> "id":"401D54000800",
> "locator":"FFFFFFFFFFFFFFFF",
> "power":false,
> "r_address":"BE000800541D4010",
> "r_id":"000800541D40",
> "r_locator":"FFFFFFFFFFFFFFFF",
> "scratchpad":"2D004B28FFFF03106E",
> "temperature":     22.5625,
> "temphigh":          75,
> "templow":          40,
> "type":"DS18S20",
> }
>
>
>
> On Mon, May 13, 2013 at 12:50 AM, Andrew Elwell 
> <[email protected]>wrote:
>
>> > Thank you -- applied your patches. Will be in the next release.
>>
>> No problem - Do you have any suggestions how to tackle the tougher
>> issue - that of removing the quotes from numerical values and
>> true/false (apart from parsing and regexp matching). The advantage of
>> owfs is that it's fairly simple - I'm reluctant to bugger around with
>> it to add extra complexity in the json presentation.
>>
>> Once my DS2482-100's arrive I'll be able to code and test, but right
>> now I'm limited to fake values
>>
>>
>> Andrew
>>
>>
>> ------------------------------------------------------------------------------
>> Learn Graph Databases - Download FREE O'Reilly Book
>> "Graph Databases" is the definitive new guide to graph databases and
>> their applications. This 200-page book is written by three acclaimed
>> leaders in the field. The early access version is available now.
>> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
>> _______________________________________________
>> Owfs-developers mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>>
>
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
>


-- 
Roberto Spadim
SPAEmpresarial
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to