./hostside-old [] see nmra-packets.h ./hostside-old [] nmra_bytes ./hostside-old [] nmra_raw ./hostside-old [] command options -s eg -s/dev/ttyS0 normally necessary -w usleep; 0 = no usleep; default is -1 = don't repeat at all -i default is 0 = infinite; -1 means don't repeat *** the above seems wrong; -1 seems to mean infinite *** and 0 means once ?! -f usleep; each character; default is 0 = no usleep Eg, ./hostside-old -s/dev/ttyS0 -w10000 -i1000 nmra_bytes 0348 to tell decoder 3 to go speed 13 backwards every 10ms for 1000 times, ie 10s (on norway this means it actually happens every 20ms, ie for 20s, which makes it a bit of a fudge really) ff ff 80 e4 c1 17 output bytes 11111111 11111111 10000000 11100100 11000001 00010111 as bits >1111111 >1111111 >0000000 >1100100 >1000001 $0010111 top bit: >/$ for pic 1111111 1111111 0 00000011 0 01001000 0 01001011 1 reorg bits for nmra: preamble (14) S 0AAAAAAA P 01DCSSSS 0 EEEEEEEE 1 03 (+) 48 = 4b ok To test: ./hostside-old -st nmra_bytes 0348 && binview t Protocol over new hostside stdin: Example (always the same msg): P> nmra [*] [...]] nmra speed28 3 13 1 P> nmra [*] [=] nmra =0348 P> nmra [*] [:] nmra :03484b P> nmra [*] [_] nmra _7f7f00644197 in each case * indicates that the message should be put in the retransmission cycle, and cancels any previous message with the same *. may be empty. P> nmra * cancels the relevant retransmission. Example (always the same msg): P> pic = pic =a003 P> pic [ and nmra _ do exactly the same. P> polarity .... where, eg, with 14 segments, [ 1] [111 1111] reversible [123] [56 7890] [123 4567] segment number 1 0010 000 1 000 1000 0 111 1010 example POLARITY 1 0010 RRR 1 RRR RRRR 0 RRR R--- from README.protocol RRR RRR RRRR RRR R actual R bits \__ ___/\__ ___/ ... which map ... RRRRRRRR RRRRRR ... into data ... RRRRRRRR RRRRRR-- ... like this. 00000010 00111100 [ 1111111] reversible [12345678] [90123456] segment number 0x02 0x3c hex values 023c hex data string Up< pic-out Up< pic-in U< count eg count polarity 14 U< pic detect 1|0 U< pic point

U< pic pointed

U< pic charged

U< polarity .... U< polarised ....