Fix hang issue with messages longer than 67 characters

master
sh123 2023-12-07 14:26:07 +02:00
rodzic df80a982de
commit 2c7eb04b69
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -10,8 +10,8 @@ android {
applicationId "com.radio.codec2talkie"
minSdkVersion 23
targetSdkVersion 30
versionCode 165
versionName "1.65"
versionCode 166
versionName "1.66"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Wyświetl plik

@ -94,14 +94,14 @@ public class AprsDataTextMessage implements AprsData {
}
} else {
// message requires acknowledge {xxxxx (for auto ack)
p = Pattern.compile("^(.+){0,67}[{](\\d+){1,5}$", Pattern.DOTALL);
p = Pattern.compile("^.+[{](\\d+){1,5}$", Pattern.DOTALL);
m = p.matcher(stringMessage);
if (m.find()) {
this.textMessage = m.group(1);
String ackNumStr = m.group(2);
if (ackNumStr != null)
this.ackId = Integer.parseInt(ackNumStr);
} else if (stringMessage.length() <= 67) {
} else {
this.textMessage = stringMessage;
}
}