On Sun, Mar 18, 2018 at 02:13:14AM +0200, Artturi Alm wrote:
> On Fri, Mar 09, 2018 at 11:51:20AM +0200, Artturi Alm wrote:
> > On Wed, Mar 07, 2018 at 06:26:15AM +0200, Artturi Alm wrote:
> > > Hi,
> > > 
> > > i tested gpioow on beaglebone black a few days ago, and when i was lazy
> > > to fix the 'cables' my sensors were attached to, console was spammed
> > > over night by some of the sensors.
> > > i found the hotplug spam+disappearing sensors annoying.
> > > 
> > > if i read gpioctl(8) correctly, i should be able to pass these flags like
> > > "gpioctl gpio1 attach gpioow 16 0x01 [flags]" ?
> > > 
> > > yet untested diff below showing what i think i'm missing,
> > > and for which any input would be much appreciated by those familiar with
> > > gpioow(4)i/sensors frsmrwork, or anyone w/comments generally :)
> > > 
> > > -Artturi
> > > 
> > 
> > so this does lower the bar for owtemp(4) to be more easily usable/reliable
> > via sysctl(8) alone in some simple script or w/e(sensor will be there,
> > and w/timedelta one can decide whether to use the value or not).
> > 
> > besides the obvious copy-paste-bugs in the previous draft,
> > i missed how gpioow(4) didn't pass the flags to onewire(4) oba_flags.
> > 
> > diff below does work good enough for my use, and i don't care about the
> > inherent 5sec 'lag' on timedelta enough to make the diff any bigger.
> > 
> > rc.securelevel:
> > gpioctl gpio1 attach gpioow 16 1 12
> > 
> > root@av7bbb:~ # sysctl hw.sensors
> > hw.sensors.owtemp0.temp0=30.56 degC (sn 0000025f07aa)
> > hw.sensors.owtemp0.timedelta0=5.000000 secs (LastUpdate)
> > hw.sensors.owtemp1.temp0=30.88 degC (sn 0000025ecdb5)
> > hw.sensors.owtemp1.timedelta0=5.000000 secs (LastUpdate)
> > hw.sensors.owtemp2.temp0=30.50 degC (sn 0000025f13ad)
> > hw.sensors.owtemp2.timedelta0=5.000000 secs (LastUpdate)
> > 
> > -Artturi
> > 
> 
> Hi,
> 
> admittedly my last diff was funny, and hardly worth of any comments:D
> 
> maybe this one would be more acceptable? no fake-sensors/lag involved,
> as sysctl(8) does make use of s->tv.tv_sec, if provided i found out.
> 
> -Artturi
> 
> 

forgot this from the last diff..:

diff --git sys/dev/gpio/gpioow.c sys/dev/gpio/gpioow.c
index 64d79ab0cb8..f7b7eb83e4b 100644
--- sys/dev/gpio/gpioow.c
+++ sys/dev/gpio/gpioow.c
@@ -147,6 +147,7 @@ gpioow_attach(struct device *parent, struct device *self, 
void *aux)
 
        bzero(&oba, sizeof(oba));
        oba.oba_bus = &sc->sc_ow_bus;
+       oba.oba_flags = ga->ga_flags;
        sc->sc_ow_dev = config_found(self, &oba, onewirebus_print);
 
        return;

Reply via email to