Skip to content

Commit acaeb21

Browse files
committed
Update ShimmerJavaClass.java
1 parent d6a4a89 commit acaeb21

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

ShimmerDriverPC/src/main/java/com/shimmerresearch/tools/matlab/ShimmerJavaClass.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@ protected void processMsgFromCallback(ShimmerMsg shimmerMSG) {
236236
}
237237
}
238238
System.out.println("Device State Change: CONNECTED");
239-
pcs.firePropertyChange("ConnectedState", null, "CONNECTED");
239+
pcs.firePropertyChange("ConnectedState", null, new MatlabConnectionEvent("CONNECTED", callbackObject.mComPort));
240240

241241
} else if (callbackObject.mState == BT_STATE.DISCONNECTED || callbackObject.mState == BT_STATE.CONNECTION_LOST) {
242242
System.out.println("Device State Change: " + callbackObject.mState);
243243
System.out.flush();
244244
System.out.println("Device State Change: DISCONNECTED");
245-
pcs.firePropertyChange("ConnectedState", null, "DISCONNECTED");
245+
pcs.firePropertyChange("ConnectedState", null, new MatlabConnectionEvent("DISCONNECTED", callbackObject.mComPort));
246246

247247
}
248248
} else if (ind == ShimmerPC.MSG_IDENTIFIER_NOTIFICATION_MESSAGE) {
@@ -271,4 +271,14 @@ protected void processMsgFromCallback(ShimmerMsg shimmerMSG) {
271271
}
272272
}
273273
}
274-
}
274+
public class MatlabConnectionEvent {
275+
public String state;
276+
public String comPort;
277+
278+
public MatlabConnectionEvent(String state, String comPort) {
279+
this.state = state;
280+
this.comPort = comPort;
281+
}
282+
}
283+
284+
}

0 commit comments

Comments
 (0)