The encoder is working fine, and produces the same output as IrpTransmogrifier for the protocols defined in IrpProtocols.xml
The decoder generates a fine state machine like regexes. I've got NFA mostly working, with a few minor exceptions. DFA will be next. Note that my decoder works fine with protocols marked decodable=false in IrpProtocols.xml
Now, in order to generate a decoder, sometimes I have to jump through some hoops because the way the protocols are written in IRP.
Take DirecTV_3FG for example.
Code: Select all
{38k,600,msb}<1,-1|1,-2|2,-1|2,-2>(10,-2,(D:4,F:8,C:4,1,-30m,5,-2)*){C=7*(F:2:6)+5*(F:2:4)+3*(F:2:2)+(F:2)}[D:0..15,F:0..255]
down: 10,-2
repeating: D:4,F:8,C:4,1,-30m,5,-2
up:
However, down does not work because 10,-2 does not define F and D. After all, I want a decoded down event to actually have usable values. So, my decoder has special code which goes something like this "if the down part does not set the required variables, add a single instance of repeat to down", e.g.
down: 10,-2,D:4,F:8,C:4,1,-30m,5,-2
repeating: D:4,F:8,C:4,1,-30m,5,-2
up:
Now the down decoder can actually give you the value of D & F. See https://github.com/seanyoung/cir/blob/m ... ariants.rs
So now effectively I've re-written:
Code: Select all
{38k,600,msb}<1,-1|1,-2|2,-1|2,-2>(10,-2,(D:4,F:8,C:4,1,-30m,5,-2)*){C=7*(F:2:6)+5*(F:2:4)+3*(F:2:2)+(F:2)}[D:0..15,F:0..255]
Code: Select all
{38k,600,msb}<1,-1|1,-2|2,-1|2,-2>(10,-2,(D:4,F:8,C:4,1,-30m,5,-2)+){C=7*(F:2:6)+5*(F:2:4)+3*(F:2:2)+(F:2)}[D:0..15,F:0..255]
In fact, another way to describe this problem is: if I render the IRP with 0 repeats, then the protocol is not decodable.
Code: Select all
$ cir transmit irp --dry-run '{38k,600,msb}<1,-1|1,-2|2,-1|2,-2>(10,-2,(D:4,F:8,C:4,1,-30m,5,-2)*){C=7*(F:2:6)+5*(F:2:4)+3*(F:2:2)+(F:2)}[D:0..15,F:0..255]' -f D=0,F=0 -r 0
info: carrier: 38000Hz
info: rawir: +6000 -1200
Code: Select all
{40k,600}<1,-1|2,-1>(4,-1,F:8,^45m)[F:0..255]
Code: Select all
{40k,600}<1,-1|2,-1>(4,-1,F:8,^45m)+[F:0..255]
How do we feel about amending the protocols so they all make sense wrt having somethign sensible in the down and repeat part?
