Subject: Re: envsys(4), envstat(8) and detachable sensors.
To: Jeff Rizzo <riz@tastylime.net>
From: Thomas E. Spanjaard <tgen@netphreax.net>
List: tech-kern
Date: 04/16/2006 12:35:37
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig50494E6F7C055A8B68812667
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Jeff Rizzo wrote:
> At the very least, the code in envstat(8) doesn't handle this - the
> first sensor number that doesn't have ENVSYS_FVALID set causes the
> counting code to stop - so if sensor 0 is removed, no more sensors.  My
> question here is, is there some bit of the API I've missed which allows
> the kernel to return how many sensors there are, and/or what sensor
> numbers userland should request?   If not, does adding such an ioctl
> seem like the best approach to this problem?

I think it's better to distinguish with flags between sensor numbers 
that have been detached and sensor numbers that haven't been attached, 
and have the code check for that instead (and ignore detached sensor 
numbers). However, another thing I find weird, if you have a machine 
running for a long time with a sensor disconnecting and connecting at 
some interval, say, a mobile sensor that passes a wireless readout 
station every once in a while, the sensor number would eventually go 
through the roof; isn't that a bit ugly?

Cheers,
-- 
         Thomas E. Spanjaard
         tgen@netphreax.net

--------------enig50494E6F7C055A8B68812667
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)

iD8DBQFEQjoZ6xCMwBJ+1+sRA6gzAJ42pEZ+MTxxxr0PD3cFqG2NdqH49ACgggRW
II0eZfabu5tai8Vkjt8/xYI=
=GwX+
-----END PGP SIGNATURE-----

--------------enig50494E6F7C055A8B68812667--