- fixing reading profile
This commit is contained in:
parent
d57d847bf7
commit
f0ccf57e69
2 changed files with 10 additions and 16 deletions
|
@ -703,7 +703,6 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager
|
||||||
// create message
|
// create message
|
||||||
PumpMessage msg;
|
PumpMessage msg;
|
||||||
|
|
||||||
// if (bodyData == null)
|
|
||||||
msg = makePumpMessage(commandType);
|
msg = makePumpMessage(commandType);
|
||||||
|
|
||||||
// send and wait for response
|
// send and wait for response
|
||||||
|
@ -718,8 +717,6 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager
|
||||||
|
|
||||||
byte[] data = null;
|
byte[] data = null;
|
||||||
|
|
||||||
int runs = 1;
|
|
||||||
|
|
||||||
if (check == null) {
|
if (check == null) {
|
||||||
|
|
||||||
data = response.getRawContentOfFrame();
|
data = response.getRawContentOfFrame();
|
||||||
|
@ -728,24 +725,21 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager
|
||||||
|
|
||||||
while (checkIfWeHaveMoreData(commandType, response, data)) {
|
while (checkIfWeHaveMoreData(commandType, response, data)) {
|
||||||
|
|
||||||
runs++;
|
response = sendAndListen(ackMsg, DEFAULT_TIMEOUT + (DEFAULT_TIMEOUT * retries));
|
||||||
|
|
||||||
PumpMessage response2 = sendAndListen(ackMsg, DEFAULT_TIMEOUT + (DEFAULT_TIMEOUT * retries));
|
|
||||||
|
|
||||||
// LOG.debug("{} Response: {}", runs, HexDump.toHexStringDisplayable(response2.getRawContent()));
|
// LOG.debug("{} Response: {}", runs, HexDump.toHexStringDisplayable(response2.getRawContent()));
|
||||||
// LOG.debug("{} Response: {}", runs,
|
// LOG.debug("{} Response: {}", runs,
|
||||||
// HexDump.toHexStringDisplayable(response2.getMessageBody().getTxData()));
|
// HexDump.toHexStringDisplayable(response2.getMessageBody().getTxData()));
|
||||||
|
|
||||||
String check2 = checkResponseContent(response2, commandType.commandDescription, 1);
|
String check2 = checkResponseContent(response, commandType.commandDescription, 1);
|
||||||
|
|
||||||
if (check2 == null) {
|
if (check2 == null) {
|
||||||
|
|
||||||
data = ByteUtil.concat(data, response2.getRawContentOfFrame());
|
data = ByteUtil.concat(data, response.getRawContentOfFrame());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.errorMessage = check2;
|
this.errorMessage = check2;
|
||||||
if (isLogEnabled())
|
LOG.error("Error with response got GetProfile: " + check2);
|
||||||
LOG.debug("Error message: " + check2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,11 +778,10 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager
|
||||||
if (commandType == MedtronicCommandType.GetBasalProfileSTD || //
|
if (commandType == MedtronicCommandType.GetBasalProfileSTD || //
|
||||||
commandType == MedtronicCommandType.GetBasalProfileA || //
|
commandType == MedtronicCommandType.GetBasalProfileA || //
|
||||||
commandType == MedtronicCommandType.GetBasalProfileB) {
|
commandType == MedtronicCommandType.GetBasalProfileB) {
|
||||||
byte[] responseRaw = response.getRawContent();
|
byte[] responseRaw = response.getRawContentOfFrame();
|
||||||
|
|
||||||
int last = responseRaw.length - 1;
|
int last = responseRaw.length - 1;
|
||||||
|
|
||||||
if (isLogEnabled())
|
|
||||||
LOG.debug("Length: " + data.length);
|
LOG.debug("Length: " + data.length);
|
||||||
|
|
||||||
if (data.length >= BasalProfile.MAX_RAW_DATA_SIZE) {
|
if (data.length >= BasalProfile.MAX_RAW_DATA_SIZE) {
|
||||||
|
|
|
@ -129,9 +129,10 @@ public class PumpMessage implements RLMessage {
|
||||||
return arrayOut;
|
return arrayOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public byte[] getRawContentOfFrame() {
|
public byte[] getRawContentOfFrame() {
|
||||||
byte[] raw = getRawContent();
|
byte[] raw = messageBody.getTxData();
|
||||||
return ByteUtil.substring(raw, 0, raw.length - 1);
|
return ByteUtil.substring(raw, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue