tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Patch: rfcomm_sppd + openpty



> What is your use case for this?
(It has been a year since I wrote the patch so my memory is a bit foggy.)
I'm using rfcomm_sppd to establish a bluetooth connection to a GPS
receiver, which is then used by gpsd.

Now, the problem was that I couldn't a-priori find an unused /dev/ttyp?
device to be used for that connection, there was something weird with
the 16 of those devices being equivalent to or preferred over /dev/pts/*,
so the first sixteen, say, xterms I opened would used /dev/ttyp* and only
then start using /dev/pts/N with N >16.  Or so I think to remember, anyway.

Or put differently, with more than sixteen such devices in use, using
rfcomm_sppd without openpty(3) became impossible at all.

There's also the chance that I just misunderstood how rfcomm_sppd is
supposed to be used.  My script essentially does:
>	gpsd -bnN $(rfcomm_sppd -a 00:0d:b5:82:e9:30 -d ubt0 -t auto)
Anything odd about that (apart from lack of error checking)?


> personally in a style way, I don't like to overload functions or options 
> in this way, perhaps better to use a separate function and -T flag ?
Digging in my shell history shows that I indeed did it first with -T.
I'm not sure why I changed it later on, but probably because it meant
less code duplication somewhere.  I generally agree though, it's a fair
point.


Home | Main Index | Thread Index | Old Index