On Nov 28, 2010, at 9:46 AM, Linus Vikström wrote:
> Hi all, hope someone here can give me some pointers in the right direction.
>
> I am looking at implementing a custom daemon for the sample mode of the USB IR Toy from Dangerous Prototype but can’t really get my head around what I need to implement and what it should to. This means I’ll be able to use the IRRecording functionality to generate a remote file with the timing and bitmasks for the different buttons/repeats etc.
>
>
> Looking at the code for some of the daemons this is my understanding of how it works:
> Define my own struct of type hardware.
> Implement *init_func so it sets up the IR Receiver the way I want it.
> Implement *deinit_func to do a nice shutdown.
> Implement *rec_func to receive data.
> Implement #decode_func to decode the data I receive.
>
> Where I stumble is on the actual data I have access to and what I should write to/return in the implementation.
Pulse/space timing data, mostly, to the fd set up for your
device's hardware struct, which lircd will read from. Or so
I think. I'm still learning myself.
> So my real question is: Is there any documentation about what all the structs do and what input/output they expect?
The code IS the documentation! :)
(There may be some that I'm unaware of... I know the kernel side
of things much better than userspace though...)
> For example: The USB IR Toy gives me an array of timings for a specific signal (2bytes per pulse), so the output from the IR Toy might be {0xFF, 0xFF, 0x02,0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0xFF, 0xFF}.
> What I can’t figure out how this will get passed to my daemon..will the buffer hold the separate bytes? Will it be an array of some kind? A struct?
> And when I have taken that array and converted it to the actual pulse times, how do I get them into the LIRC engine so it can match it against the remote control configuration?
Most devices that receive raw IR have to do some sort of
device-specific parsing of their incoming data buffer, converting
it into a format that makes sense to lirc. A common setup is to
use a fifo to store incoming raw IR data, then process it as/when
needed, and pass along the timing data to lirc.
--
Jarod Wilson
jarod@...
|