Merges register addresses into the fewest read transactions that cover them.
The planner sorts and deduplicates the addresses, then extends a span while the
next address is within maxGap unrequested registers of the last one and the
span stays within maxRegistersPerRead.
ReadPlan.locate maps each address back to its position, so a caller
issues the spans, keeps the responses in order, and reads each value out
without tracking the grouping itself.
Parameters
addresses: readonlynumber[]
Requested addresses, in any order, duplicates allowed.
Merges register addresses into the fewest read transactions that cover them.
The planner sorts and deduplicates the addresses, then extends a span while the next address is within
maxGapunrequested registers of the last one and the span stays withinmaxRegistersPerRead.ReadPlan.locate maps each address back to its position, so a caller issues the spans, keeps the responses in order, and reads each value out without tracking the grouping itself.