Hiya,
What’s the ‘Legato Way’ of passing an arbitrarily sized array from once component to another?
in ‘C’ I would something like this:
void doIt(uint8_t *data, size_t len)
{
// ... process data
return;
}
void buildIt()
{
uint8_t *D = NULL;
size_t len = 100;
D = (uint8_t *)calloc(len, sizeof(uint8_t));
// .... do something to build array
doIt(D, len);
free(D);
return;
}
I can create an API for a component that has a fixed maximum length of IN data, but how do I pass an array of an unknown maximum length (at build time) from one component to another?
ciao, Dave