Attached find a small patch to correct a minor bug and a typo.
1. start lircd, push lots of buttons on a remote.
2. start a lirc client.
3. watch lircd exit.
Problem was when the dongle is plugged in its active and will send stuff
whether the host system is ready or not. The fix is to flush the port
before we 'initilize it' (initalize it, as in check to make sure we have
a tira there) Also we check the response from the device on the last
command sent just to make sure we really got its attention and in sync
And a typo in the setup.data.
1) Repeats are messed up, though this may be something the hardware is
# Single press volume:
# Repeat volume:
So it looks like its returning two different codes depending on if its
repeating or not, I have checked this with other keys and it is
consistant in two different codes for the single press vs repeating I
didn't see an obvious pattern to it maybe someone else can (single
press, repeat press):
3) Capturing remote codes for sending.
This is a mess.. Dunno what to do here.
Device has 2 modes of IR receiving. Here's the kicker, it uses two
different sensors to accomplish this.
Normal everyday use, uses a long range sensor and returns in six byte mode.
Capture for re-transmission, uses a very very short range sensor and
returns data in a 'timing' format, should be converted to mode2 data but
not sure how mode2 data will line up with the above six byte data from
'normal' use. Plus does mode2 data have suffcient data for re-transmission?
Ideal solution would be some sort of flag from the clients as to what
mode to capture in. And have the driver switch between them as required.
So for instance irrecord could tell the driver mode2 please, and the
driver switches the device to timing mode and does what it needs to, to
output mode2 data. Which looks fairly straight foreward.
Data comes in as:
[0x04 0x51](burst)[0x02 0x2A](space) ... [0x00 0x47](burst)[0x00
Timing is calculated as:
Timing = (Dhi * 256 + Dlo) * 8uS
Timing = (0x04 * 256 + 0x51) * 8uS
(And so on)
Modulation Frequency = 20000000 / 0x34
Pulse Period = 0x34 * .05
Build an array (BSA array) of upto 12 timing periods (16 bit data 2
bytes per period, 24 bytes total)
build a string of data indexing into the above array with the last byte
of the ir data with the space index set to all ones (0x0F). High nibble
is the burst index, low nibble is the space index.
Send the lot to the device:
0x49 0x58 [Frequency/Modulation word] [mode: reserved set to 0]
[BSA Array 24 bytes]
Read OIX (0x4f 0x49 0x58) from device on success.
Haven't puzzled out how to go from mode2 to the above.