Version 0.9 of lircd is the last version which is able to connect to multiple other lircd instances. A short look at the code shows that lircd passed the arguments in a while loop for version <=0.9. After 0.9.1 it gets option strings, but only one connect string.
This is a major regression for me, as I need to combine three dev/input devices.
If someone give me a concrete hint what to do I'll could look into it myself.
Ack. This is indeed a major regression. Odd that it isn't reported until now.
If you want to make a stab at it, I think one way is to redefine the --connect parameter to a comma-separated list of clients, and change the code in lircd: main() to invoke add_peer_connection() as needed. Don't forget to patch also the manpage in that case.
Parsing a list is too much work and state for the main() function, you will need a separate helper for that.
When testing, please don't forget to test also setting the parameter in lirc_options.conf.
Ok, I've made a patch which works for me. I've no idea how stress resistant this solution is as I'm not the biggest expert in standard-c string manipulation.
Looks reasonable, nice job! Hpwever, as I stated in the first comment you need to use a separate helper function for this, it's too much state to be in the main function.
Also, you might look into strtok(3). It does the job for you here. The possible downside is that it destroys the string, but it's no problem in this context. There are plenty of strtok examples in the code...
Funny, this is also much easier. Thanks. This should work.
hm.. there is one problem (const-ness compilation warning) and a few style issues (unnecessary global variable, formatting, return-is-an-operator) with the v2 patch. I have rewritten it (attached), can you check & test since you have the test setup (and four eyes are always better that two...)
Ping?
Ah sorry, I forgot it. I'll test it today right after I get home from work
Pong? :)
Upps, I'm really sorry. Forgot it again. But i've tested it right now and it works like a charm.
NP, I really appreciate the help. Will merge Real Soon (TM).
Fixed in [d5474f], closing. Thanks for reporting, coding and testing!
Related
Commit: [d5474f]