Checkbox Items

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
christian.emerich
Posts: 4
Joined: Sat Jan 24, 2015 4:50 pm

Checkbox Items

Post by christian.emerich »

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? :?: :oops:

Thanks for your help!!!!!!!
br. Christian

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: Checkbox Items

Post by EOSBandi »

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? :?: :oops:

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.... :D

christian.emerich
Posts: 4
Joined: Sat Jan 24, 2015 4:50 pm

Re: Checkbox Items solved

Post by christian.emerich »

Hi,
:D thanks to eosbandi and his hint to increase INBUF_SIZE in protocol.cpp line 84 it's working now for me.

br. Christian

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Checkbox Items

Post by Hamburger »

increase to what, please?

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: Checkbox Items

Post by EOSBandi »

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.

Post Reply