HI all,

I have found some time to do some work on the LearnIR
interface, which I have almost completed by now:
- allow LearnIR.EZtut file with more than one key
  (several keys tagged in the web interface)
- added callback for key name and IR code information:
  this removes the output of the key name from libconcord,
  and allows the caller to display not only the name of the
  key to be pressed on the original remote, but also the received 
  IR signal (as list of durations, or maybe even graphical, like
   xmode2 from the LIRC project)
- allow to input IR code information instead of learning 
  from the Harmony remote. In this case, the callback will
  receive the IR code data instead of reporting them.

I have also made up a small module to read Philips Pronto
raw hex codes (to feed the code input part), but I'm still 
not quite sure where it should be placed - currently, I have 
imported it into concordance, but it is probably worth to be 
a new library, for integration into the GUI application. At 
least, libconcord, IMHO, is definitely not the place for this code.

Something else still to do would be to also get device/command
codes for NEC, RC5, etc. IR code formats learned by translating
them into raw format.

more to follow soon...I'll first check some changes in the low-level
modules that I may have added to work around some problem that was 
actually something else, so they probably can/should be reverted.

This would be the new interface in libconcord.h:

============================================
-int learn_ir_commands(uint8_t *data, uint32_t size, int post);
+/*
+ * CALLBACK INFORMATION
+ *
+ * The callback for learn_ir_command behaves slightly different, with
+ * the meaning of the parameters depending on the value of the first:
+ *   uint32_t index - case 0 : (char*)keyname holds the next key name
+ *                             learning starts when cb has returned.
+ *                    case 1 : space_carrier/burst hold IR carrier clock
+ *                             and first burst duration
+ *                    case 2+: space_carrier/burst hold next space/burst
+ *                             durations; when burst==0, learning is complete
+ *   uint32_t *space_carrier  - IR carrier frequency or next space duration
+ *   uint32_t *burst  - next burst duration, ==0 when learning is complete
+ *   void *keyname   - (char*) to next key name when index==0
+ * When from_remote:
+ * ==1: IR code will be read from remote, and callback reports received data.
+ * ==0: IR code provided by other source, callback asks for data which have
+ *      to be filled in by the callback implementation.
+ */
+typedef void (*ir_callback)(uint32_t, uint32_t*, uint32_t*, void*);
+
+int learn_ir_commands(uint8_t *data, uint32_t size, int post,
+       ir_callback cb, void *cb_arg, int from_remote);


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel

Reply via email to