Add ability to load config from lirc remote file #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added a program irsling.cpp that uses irslinger.h to transmit codes loaded from a lirc remote control config file. I've only tested it with an NEC remote and a raw remote but believe it should work with RC5 too. (Apologies for using c++ but there were so many things which would have been a PITA in c but easy in c++).
g++ -o irsling irsling.cpp -lpigpio -lm -lpthread
sudo ./irsling -p pinnumber -f lircconfigfile buttonname buttonname buttonname ...
It can load multiple remotes and you can combine transmissions to >1 remote:
sudo ./irsling -p pinnumber -f lircconfigfile -f lircconfigfile remotename.buttonname remotename.buttonname remotename.buttonname ...
To make this work I had to break the existing transmission functions down in to distinct components but have kept the existing APIs unchanged, with the exception that you can now also pass a hex string e.g. 0x1ee1f30c instead of a binary string for the codes.
I also fixed a couple of type mismatches which caused compile failures with c++.