Presently, if the command line argument --device is empty, Lircd uses the default device /dev/lirc0, also if a sensible default is given in the driver. Possible fix
I definitely agree that the driver should be able/allowed to dynamically select the device name. For example, FTDI based devices get device names of the type /dev/ttyUSBn where n = 0,1,2,3,... (the lowest possible); Arduino (most types except Nano) and IrToy use /dev/ACMn with n as before.
My proposition in the ticket is that if --device is not given, Lircd should not force its "/dev/lirc0" to a driver, unless its device is NULL. Thinking about it, also the "unless"-clause is unnecessary: A driver that wants /dev/lirc0 as default can state so itself in its code. This would mean skipping the second part of the path.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have added your initial patch (more or less) in [252a83] to master. There are some drawbacks with this approach, but to solve it properly we need to update the API. Which we will do, changes are pending in the api branch, but not now.
Closing, short term fix in master, long term in api branch
[ooops, pressed Save to fast...]
Possible fix to lircd.c
Basically agreed. But while we're on it: shouldn't the driver code have a chance to compute/autodetect a default device? I think so.
I definitely agree that the driver should be able/allowed to dynamically select the device name. For example, FTDI based devices get device names of the type /dev/ttyUSBn where n = 0,1,2,3,... (the lowest possible); Arduino (most types except Nano) and IrToy use /dev/ACMn with n as before.
My proposition in the ticket is that if --device is not given, Lircd should not force its "/dev/lirc0" to a driver, unless its device is NULL. Thinking about it, also the "unless"-clause is unnecessary: A driver that wants /dev/lirc0 as default can state so itself in its code. This would mean skipping the second part of the path.
Hm... wher did my patch disappear? My idea is to implement it like this. Basically, this means that
/dev/lirc0
The patch:
I have added your initial patch (more or less) in [252a83] to master. There are some drawbacks with this approach, but to solve it properly we need to update the API. Which we will do, changes are pending in the api branch, but not now.
Closing, short term fix in master, long term in api branch
Related
Commit: [252a83]