I have an array: aTelemetry: ARRAY[0..65536] OF BYTE;
I put data inside this array. the amount of elements filled inside this array can be variable all the time.
I want to publish this array via mqtt but if i publish the whole array i get alot of blanc data/white spaces as data. So i only want to send SIZEOF(aTelemetry) without empty elements.
suppose I fill the array with 60000 bytes, then I don't want to include the last 5536 Bytes.
So the question; is there a function/manner to see how much of the array is filled with written data?
kind regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When you're filling out this array, couldn't you just keep track of the filled index via a separate variable? This is especially important if you're re-using this array since each transaction might not have the same size.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have an array: aTelemetry: ARRAY[0..65536] OF BYTE;
I put data inside this array. the amount of elements filled inside this array can be variable all the time.
I want to publish this array via mqtt but if i publish the whole array i get alot of blanc data/white spaces as data. So i only want to send SIZEOF(aTelemetry) without empty elements.
suppose I fill the array with 60000 bytes, then I don't want to include the last 5536 Bytes.
So the question; is there a function/manner to see how much of the array is filled with written data?
kind regards
When you're filling out this array, couldn't you just keep track of the filled index via a separate variable? This is especially important if you're re-using this array since each transaction might not have the same size.