Console should get much smarter around compatibility with older units #6845
only:now with ochBlockSize
This commit is contained in:
parent
829d6d39b3
commit
17a35f07d4
|
@ -15,6 +15,7 @@ public class IniFileMetaInfo {
|
||||||
|
|
||||||
private int totalSize;
|
private int totalSize;
|
||||||
private final List<Integer> pageSizes = new ArrayList<>();
|
private final List<Integer> pageSizes = new ArrayList<>();
|
||||||
|
private int ochBlockSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* read maximum chunk size
|
* read maximum chunk size
|
||||||
|
@ -24,6 +25,7 @@ public class IniFileMetaInfo {
|
||||||
public IniFileMetaInfo(RawIniFile file) {
|
public IniFileMetaInfo(RawIniFile file) {
|
||||||
|
|
||||||
nPages = file.getSimpleIntegerProperty("nPages", 1);
|
nPages = file.getSimpleIntegerProperty("nPages", 1);
|
||||||
|
ochBlockSize = file.getSimpleIntegerProperty("ochBlockSize");
|
||||||
|
|
||||||
blockingFactor = file.getSimpleIntegerProperty("blockingFactor", DEFAULT_BLOCKING_FACTOR);
|
blockingFactor = file.getSimpleIntegerProperty("blockingFactor", DEFAULT_BLOCKING_FACTOR);
|
||||||
|
|
||||||
|
@ -47,6 +49,10 @@ public class IniFileMetaInfo {
|
||||||
return nPages;
|
return nPages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getOchBlockSize() {
|
||||||
|
return ochBlockSize;
|
||||||
|
}
|
||||||
|
|
||||||
public int getBlockingFactor() {
|
public int getBlockingFactor() {
|
||||||
return blockingFactor;
|
return blockingFactor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,7 @@ public class IniFileReaderTest {
|
||||||
String string = " nPages = 3\n" +
|
String string = " nPages = 3\n" +
|
||||||
SIGNATURE_UNIT_TEST +
|
SIGNATURE_UNIT_TEST +
|
||||||
PAGE_READ +
|
PAGE_READ +
|
||||||
|
"ochBlockSize=1\n" +
|
||||||
" pageSize = 288, 64, 288\n";
|
" pageSize = 288, 64, 288\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -625,11 +625,12 @@ public class BinaryProtocol {
|
||||||
|
|
||||||
// TODO: Get rid of the +1. This adds a byte at the front to tack a fake TS response code on the front
|
// TODO: Get rid of the +1. This adds a byte at the front to tack a fake TS response code on the front
|
||||||
// of the reassembled packet.
|
// of the reassembled packet.
|
||||||
byte[] reassemblyBuffer = new byte[TS_TOTAL_OUTPUT_SIZE + 1];
|
int ochBlockSize = iniFile.getMetaInfo().getOchBlockSize();
|
||||||
|
byte[] reassemblyBuffer = new byte[ochBlockSize + 1];
|
||||||
reassemblyBuffer[0] = Integration.TS_RESPONSE_OK;
|
reassemblyBuffer[0] = Integration.TS_RESPONSE_OK;
|
||||||
|
|
||||||
int reassemblyIdx = 0;
|
int reassemblyIdx = 0;
|
||||||
int remaining = TS_TOTAL_OUTPUT_SIZE;
|
int remaining = ochBlockSize;
|
||||||
|
|
||||||
while (remaining > 0) {
|
while (remaining > 0) {
|
||||||
// If less than one full chunk left, do a smaller read
|
// If less than one full chunk left, do a smaller read
|
||||||
|
|
Loading…
Reference in New Issue