¿ªÔÆÌåÓý

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


 

¿ªÔÆÌåÓý

Tim,

On 11 Feb 2020, at 8:50 PM, tnt23 <tim.tashpulatov@...> wrote:

Next was the well-behaved '<M 0 1 2 3 4 5>' which went through perfectly silent.

Then I tried '<M 0 1 2 3 4 5 6 7 8'> and did not get error response. By adding debug print of nBytes I learned it is always set to 6, and it is the number of parameters the "%d %x %x %x %x %x"?format string expects (1 decimal for register number, and 5 hexes for parameters). It appears sscanf() just ignores the rest of input once it successfully stuffes all variables in its list.

But you didn't try ?'<M 0 1 2 3>' . I don't think you'll get nBytes=6 when the number of supplied parameters are less than those in the format string and variables).
See <>

Please set the DCC++ code as per my crossed-in-delivery email.

Dave in Australia

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