How can I use the ListAll or ListAllS functions correctly from Java?
I want to return the serial numbers of all found devices. The API documentation says:
An array of serial numbers, one for each of the NumFound devices. Must be preallocated to size LJM_LIST_ALL_SIZE
What I am unsure of is how to obtain the LJM_LIST_ALL_SIZE value. If I know how many devices there are (only one in my case for now) I am able to preallocate the array size to that. I assume I could preallocate it to some arbitrarily large value (unlikely to have thousands of devices for instance) and then "trim" the array after learning the numFound value but this feels messy.
Is there a better way to do this?