For the device type number, think of it like this: Start by initializing a variable to -1. Then read & parse each line. If no device type number is present (no comma), add 1 to the previous value in the variable and use that as the device number. If a device type number is present, use it and update it to the variable.vickyg2003 wrote:I find this kind completely uncomprehendable, although sitting here staring at it, do I start counting from 0, and then skip counting for anything that has a comma in it?
If so then I could also count the numbers then I could point the errors where there are more setup types than = signs in the device setups section. As you note, I reported there were 6 device types in the remote by counting those = signs.
It might help to always print the device type number in your report. That way you'd see the way the entries would be interpreted by IR/RMIR.
The more complicated case is where you find device type numbers such as $0202. In this case, split the high and low bytes into two values. Treat them as separate values (use two separate variables, both initialized to -1; use the same logic independently for each). The low byte is the device type number. The high byte is a secondary device type number used only in older remotes.