You can drive IR transmitter via GPIO. You need a driver, which is not a part of the kernel. Next problem is encrypted protocol ... Check this website for all about IR hacks: https://www.analysir.com/blog/
In Arduino world it is much easier. There are very good IR libraries and example programs where you can read IR remote codes and than use them in your program sending them via IR LED to the device. Probably you could adapt it here without pure Linux way via kernel module, just using bitbanging of GPIO pin.