by jrhees » Thu Apr 17, 2003 9:13 pm
Greg,
Your questions are not stupid!
Anyway, hopefully I can shed some light on this.
First, I'm not sure where BeRnA got his 'base' code from, but I would guess he simply 'learned' a code in the Girder plugin from a remote button of a remote brand/piece of equip he no longer uses. He may have dusted off an old VCR remote he had lying around, etc.
To answer your question (b), I need to give a bit of an overview of the codes the Girder plugin uses for transmitting IR.
- When you 'learn' an IR code in Girder, you will note a large string of hex digits will appear in the 'Code 1' box. In some cases, another string will appear in the 'Code 2' box. These codes are in a UIRT-specific format. The 'base' code that BeRnA gave earlier in this post was likely cut and pasted from the 'Code 1' box and is in this format.
- The USB-UIRT supports/generates *two* different formats in these 'Code' boxes -- 'STRUCT' and 'RAW'. The 'STRUCT' is a derivative of the original 'STRUCT' format developed by Ruud v. Gessel some time ago for the early UIRT. It is a 'compressed' format which can hold a lot of IR code information but will only work if the IR protocol being learned fits within certain parameters. It was developed because memory was very limited on the original UIRT.
The 'RAW' format spells out each IR burst individually, and as such is much longer. But, it is also much simpler to understand. It is also similar in concept to Pronto's 'Learned' format.
The code BeRnA pasted was a 'STRUCT' code.
Now with that said, if you wanted to transmit a code in Girder, you simply need to have a code present in the 'Code1' box and you can hit the 'Test' button. If you also hit 'Apply' then that Girder command is now ready to transmit whenever it is executed.
If you wanted to alter a code, you could simply hand-edit the code in the 'Code1' box to your liking.
To answer your question (c), the answer is that theoretically there are 2048 possibilities, but your mileage may vary. This is because when the USB-UIRT receives a code and generates an event to Girder, it does not give an event in RAW or STRUCT format (which would be too long), but rather condenses (lossy) the received IR stream into a 6-byte 'UIR' format code. Generally, this compaction leaves about 32-40 bits of unique data -- meaning you probably *would* see 2048 unique codes. For very long base codes, however, the compaction algorithm starts Xor'ing bits with each other to fit everything into 6 bytes. This can start to create the possibility of duplicates.
Don't worry about my comment about 'Messing up' the transmitter. What I mean by that is that if you mess up the format of the STRUCT code, you may find your transmitter takes a *very* long time to send the code (tens of seconds) before it will recover. You cannot damage it, but the unit could appear 'Hung' with the LED lit, and you might have to unplug it and plug it back in.
If you're thinking about writing a program, you might want to consider having it generate codes in the Pronto format instead. This is very similar to 'Raw' and is widely understood. You can import pronto codes into Girder and the USB-UIRT programming API can take them directly.
-Jon