The documentation for the UDP protocol on the website, and in the header commentary for plugins/udp.c, is incorrect, and has been since 2015. The problem is with regard to the meaning of the high bit in the 16 bit packets sent over UDP. The documentation says that the high bit, if set, represents a "pulse", but the code in plugs/udp.c (line 282) is unchanged since 2002 (first implementation), and clearly treats the high bit as meaning "space".
irtext2udp implements the protocol as described in the documentation, and doesn't work as a result.
Attached are 4 patches which fix all of this. The first patch is actually a dupe of the patch I attached to ticket 369. I include it here because my subsequent patches will break without it.
My last patch implements a "--invert" flag for irtext2udp, since someone may depend on the current behavior, and would need an easy way to get that behavior back again.
A simpler solution is to fix plugins/udp.c
I've applied your first patch and a fix to plugins/udp.c.
Some conversation would have been useful before closing this. The fix is incorrect, in that it changes lirc's udp device protocol, which has been the same for decades. Anyone using this protocol to talk to lirc, other than with irtext2udp, will see their systems fail when lirc is next released.
Skipped the last commit but all others have been applied.
See https://sourceforge.net/p/lirc/mailman/lirc-list/thread/aEXwdkZ3FywEG-P6%40gofer.mess.org/