> -----Original Message-----
> From: Jan Kandziora [mailto:j...@gmx.de]
> Sent: Saturday, 11 February 2017 11:08 AM
> To: OWFS (One-wire file system) discussion and help <owfs-
> develop...@lists.sourceforge.net>
> Subject: Re: [Owfs-developers] Hiding incompatible device variants
> 
> Am 10.02.2017 um 22:04 schrieb Alastair D'Silva:
> > Hi folks,
> >
> > I've written a 1Wire slave implementation for ARM (which I will be
> > open sourcing), in order to implement some functionality that does not
> > exist in the 1Wire world (multichannel RGBW control).
> >
> > Given the small amount of address space available in the family, I
> > figured the best course of action for further implementations would be
> > to keep the family code, and add a command to allow the master to
> > query the device specifics.
> >
> What is your device emulating? A DS2408? There is some code inside OWFS'

I do have a working DS2408 emulation, but that was more to test that I have
the low level protocol correct. This is a new device, with new commands.

> DS2408 codebase which handles the various HD44780 displays connected to
> the DS2408. It's ugly, it's error-prone and it's hard to debug.
> Please don't require us to put even more quirks into the existing driver
> sources.

Agreed, what I was thinking of was adding an init/term function and a struct
that represents a device instance (rather than a whole family of devices),
and adding a DeviceEntryExtended2 to set that up. That way, the driver can
query the device when inited, find out it's real type, and pass the
appropriate filetype table (probably from a separate .c file), so we don't
have the horrible overloading that exists in the DS2408 driver.

What I'm stuck on is that none of the existing infrastructure seems to have
a concept of a device instance, only types of devices, and I'm not sure it
can be easily retrofitted.

Regardless of whether I have a second level of device types, I don't think I
can do without a struct to have device instance state. My use case is this:
- The implementation library allows an arbitrary number of channels
- I have a command which returns the number of channels
- I would only like to display files for the permitted channels
- I would like to avoid querying the device every time a directory listing
is done

If you have any ideas, I'm all ears. Maybe querying the device for it's
state when necessary wouldn't be disastrous...

> If you make your own device, please give it its own family code and create
> your own driver source file in the owlib tree. We are going to face at
most
> twenty fundamentally different designs of homebrewn devices and there's
> plenty of unused address space for that.

That feels a lot like "640kb ought to be enough for everyone"... 

<later>
> By the way, if you do an onewire LED driver, the feature I adore most is
> synchronous control over a whole bus. So multiple LED units can be pre-
> programmed to dim in a controlled fashion starting at a single point in
time.
> 
> You had to implement a new command similar to "Convert T" to achieve this.
> That would break any existing driver but is extremly simple to implement
in
> your own driver (and the simultanenous code, of course).

That sounds like a great idea, thanks.

These are the commands I have implemented currently:
ALL_OFF         (sets all the channels on the device off, maybe a candidate
for a simultaneous command?)
COUNT_CHANNELS  returns the number of available channels to the master
SET_CHANNEL             fades a channel to a specified RGBW value over a
specified time
GET_CHANNEL             gets the current RGBW value of a channel, and the
fade time remaining

It should be relatively straightforward to add a COMMIT command which only
starts fading the requested channels once received.

Do you have any other suggestions?





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to