Skip to content

Commit e4d88a6

Browse files
Copilotjyong15
andcommitted
Use startsWith for more precise port name matching
Co-authored-by: jyong15 <26561407+jyong15@users.noreply.github.com>
1 parent 56056c5 commit e4d88a6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ShimmerDriverPC/src/main/java/com/shimmerresearch/pcSerialPort/SerialPortCommJssc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public SerialPortCommJssc(String comPort, String uniqueId, int baudToUse) {
4747
mUniqueId = uniqueId;
4848
mComPort = comPort;
4949
// On MacOS, prefer cu.* over tty.* to avoid blocking on carrier detect
50-
if(UtilShimmer.isOsMac() && mComPort.contains("/dev/tty.")) {
50+
if(UtilShimmer.isOsMac() && mComPort.startsWith("/dev/tty.")) {
5151
mComPort = mComPort.replace("/dev/tty.", "/dev/cu.");
5252
consolePrintLn("MacOS detected: Using cu port instead of tty: " + mComPort);
5353
}

ShimmerDriverPC/src/main/java/com/shimmerresearch/tools/bluetooth/BasicShimmerBluetoothManagerPc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public void connectShimmerThroughCommPort(String comPort){
242242

243243
// On MacOS, normalize tty to cu for consistent key management
244244
String normalizedComPort = comPort;
245-
if(UtilShimmer.isOsMac() && comPort.contains("/dev/tty.")) {
245+
if(UtilShimmer.isOsMac() && comPort.startsWith("/dev/tty.")) {
246246
normalizedComPort = comPort.replace("/dev/tty.", "/dev/cu.");
247247
}
248248

0 commit comments

Comments
 (0)