lkml.org 
[lkml]   [2013]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: how to represent sequence of brightnesses in /sys (was Re: [PATCH] Add the LED burst trigger)
On Sat 2013-12-28 13:50:42, Greg KH wrote:
> On Sat, Dec 28, 2013 at 10:25:23PM +0100, Pavel Machek wrote:
> > Hi!
> >
> > > >> Sysfs is meant to be human-readable/writable, so please use plain ASCII
> > > >> numbers in strings instead.
> > > >
> > > > Actually, sysfs is meant to be one value per file, and it is
> > >
> > > Ideally, yes.
> > >
> > > > understood that data that are "natively blob" are just passed as
> > > > blob. (I believe this qualifies).
> > >
> > > But it doesn't buy us much here, does it? It will make e.g. shell scripts
> > > needlessly complicated.
> >
> > echo -ne '\012' is not that bad, and parsing array of integers from
> > kernel will be an ugly piece of code.
>
> Ick, no. What are you trying to do here? Have the kernel intrepret a
> sequence of bytes to flash an LED? I thought we have frameworks in
> userspace already to handle this type of thing. Please don't invent new
> ways of doing stuff...

Idea would be "sequence of brigtnesses" (one file) and "delay between
changes" (second file).

Reason to do it in kernel is that some machines actually have
"coprocessor" on i2c that can do it while main CPU is suspended. (For
more reasons, see beggining of thread).

Binary attribute with array of bytes should be acceptable, rights?

(IOW write(..., buf, size) )

Ascii array of decimal integers -- no so, right?

(IOW printf("%d %d ..", buf[0], buf[1]) )

Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2013-12-29 01:21    [W:0.074 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site