¿ªÔÆÌåÓý

Locked Re: JMRI and DCC++: Exception with Simple Programmer in Ops Accessory Byte/Extended Byte mode #dccpp #4-18


 

¿ªÔÆÌåÓý

Tim,

(It is probably worth nothing to note that DCC++ code, as it seems, will not spot extra bytes in 'M' message. The sscanf template used will always try to read up to 5 or 6 parameters, and will always return maximum number, 5 or 6, even if being fed 10 or 15 parameters)

That needs updating to scan the extra parameter and load it into the extra element of the array.

What does your modified code look like? Please show us.

My reading (I'm not a C++ speaker) of the code is that the sscanf ?function returns the number of successful matches*, not the number of parameters. So nBytes returns the actual number of parameters (minus 1 for the register parameter).

nBytes is the number of bytes specified to loadPacket?


*<>

Dave in Australia

Join [email protected] to automatically receive all group messages.