Hi,
after a while of programming I reached the magic limit of 16 checkbox items. Now I see them all in the WinGui but can't set them anymore.
I found a few cryptic post telling that I can use only 16 items, but out of the code I didn't find the limitations as always the variable checkboxitems is used.
Can someone give me a hint what I missed so far?
Thanks for your help!!!!!!!
br. Christian
Checkbox Items
Re: Checkbox Items
christian.emerich wrote:Hi,
after a while of programming I reached the magic limit of 16 checkbox items. Now I see them all in the WinGui but can't set them anymore.
I found a few cryptic post telling that I can use only 16 items, but out of the code I didn't find the limitations as always the variable checkboxitems is used.
Can someone give me a hint what I missed so far?
Thanks for your help!!!!!!!
br. Christian
I tested it with 17 checkboxes and it worked....
Could you post or share your code ? I assume it is not a standard MW code....
-
- Posts: 4
- Joined: Sat Jan 24, 2015 4:50 pm
Re: Checkbox Items solved
Hi,
thanks to eosbandi and his hint to increase INBUF_SIZE in protocol.cpp line 84 it's working now for me.
br. Christian
thanks to eosbandi and his hint to increase INBUF_SIZE in protocol.cpp line 84 it's working now for me.
br. Christian
Re: Checkbox Items
increase to what, please?
Re: Checkbox Items
Hamburger wrote:increase to what, please?
Well, it depends on the number of checkboxes. With ExtAUX enabled 1 checkbox needs 4 bytes. So 16 checkboxes needs 64 bytes of data.
The InBuf array size is 64 bytes.... MSP commands with more than 64 bytes payload are discarded...
Code: Select all
} else if (state == HEADER_ARROW) {
if (c > INBUF_SIZE) { // now we are expecting the payload size
state = IDLE;
continue;
}
So to use more than 16 checkboxes with ExtAux you have to add 4 bytes to the INBUF_SIZE define in protocol.cpp for every additional checkbox items.
However I think this is an extreme case. So it has to be documented but no changes in the code is needed.