lkml.org 
[lkml]   [2015]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/2] w1: slaves: w1_therm: Add sysfs entry for current temperature
Am 06.01.2015 um 17:12 schrieb Mariusz Gorski:
> On Tue, Jan 06, 2015 at 04:01:47PM +0100, Richard Weinberger wrote:
>> On Tue, Jan 6, 2015 at 3:29 PM, Mariusz Gorski <marius.gorski@gmail.com> wrote:
>>> DS18B20 and it's brothers are pretty popular in the RaspberryPi world
>>> when it comes to temperature measurement. All tutorials on the Internet
>>> use the same way of parsing the output of the w1_slave sysfs file.
>>> These patches add a dedicated sysfs entry called 'temp' whose only job
>>> is to output the current temperature.
>>
>> And what is the benefit of this patches?
>
> Well, instead of having to parse the output of w1_slave:
>
> $ cat w1_slave
> 4d 01 55 00 7f ff 0c 10 fd : crc=fd YES
> 4d 01 55 00 7f ff 0c 10 fd t=20812
>
> the userspace program gets only the interesting information,
> which usually is the current temparture:

A sane user would also check the CRC.

IMHO it is up to the user to format the output for its needs.
Some may want "20812", some "20.8", some else maybe "20.8°C".
Let it up to the user.
Any trivial awk/cut/etc... oneliner would do it.

Thanks,
//richard


\
 
 \ /
  Last update: 2015-01-06 18:01    [W:0.072 / U:3.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site