Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ public int getNumCrcBytes() {

public static final int MSG_IDENTIFIER_VERISENSE_ERASE_DATA_COMPLETED = 14;
public static final int MSG_IDENTIFIER_VERISENSE_WRITE_OPCONFIG_COMPLETED = 15;
public static final int MSG_IDENTIFIER_SYNC_COMPLETED = 16;

// private boolean mVerboseMode = true;
// private String mParentClassName = "ShimmerPC";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface RadioListener {
public void isNowStreamingCallback();
public void hasStopStreamingCallback();
public void isNowStreamLoggedDataCallback();
public void hasStopStreamLoggedDataCallback();
public void hasStopStreamLoggedDataCallback(String binPath);
public void initialiseStreamingCallback();

// public void eventSyncStates(boolean isDocked, boolean isInitialised, boolean isSdLogging, boolean isSensing, boolean isStreaming, boolean haveAttemptedToRead);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public void newSyncPayloadReceived(int payloadIndex, boolean crcError, double tr
mShimmerDevice.sendCallBackMsg(ShimmerBluetooth.MSG_IDENTIFIER_SYNC_PROGRESS, callBackObject);
}

public void readLoggedDataCompleted(String binFilePath) {
CallbackObject callBackObject = new CallbackObject(getMacId(), getComPort(), new SyncProgressDetails(binFilePath));
mShimmerDevice.sendCallBackMsg(ShimmerBluetooth.MSG_IDENTIFIER_SYNC_COMPLETED, callBackObject);
}

public void eraseDataCompleted() {
CallbackObject callBackObject = new CallbackObject(getMacId(), getComPort(), true);
mShimmerDevice.sendCallBackMsg(ShimmerBluetooth.MSG_IDENTIFIER_VERISENSE_ERASE_DATA_COMPLETED, callBackObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ public void isNowStreamLoggedDataCallback() {
}

@Override
public void hasStopStreamLoggedDataCallback() {
public void hasStopStreamLoggedDataCallback(String binPath) {
// TODO Auto-generated method stub

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,8 @@ public void isNowStreamLoggedDataCallback() {
}

@Override
public void hasStopStreamLoggedDataCallback() {
public void hasStopStreamLoggedDataCallback(String binFilePath) {
mDeviceCallbackAdapter.readLoggedDataCompleted(binFilePath);
// TODO Auto-generated method stub
setBluetoothRadioState(BT_STATE.CONNECTED);
}
Expand Down Expand Up @@ -1940,6 +1941,16 @@ public void readLoggedData() throws ShimmerException {
mapOfVerisenseProtocolByteCommunication.get(currentStreamingCommsRoute).readLoggedData();
}

public void setRootPathForBinFile(String path) {
mapOfVerisenseProtocolByteCommunication.get(currentStreamingCommsRoute).setRootPathForBinFile(path);
}

public void deleteData() throws Exception {

mapOfVerisenseProtocolByteCommunication.get(currentStreamingCommsRoute).eraseDataTask().waitForCompletion();

}

/**
* @return Null if sensor not supported by current hardware
* @see SensorLIS2DW12
Expand Down Expand Up @@ -2187,15 +2198,15 @@ public void setPendingEventScheduleRwcSync(PendingEventSchedule pendingEventSche
}

/**
* The number of minute’s interval the ASM sensor will wait after a failed connection attempt before turning on the scheduler again
* The number of minute�s interval the ASM sensor will wait after a failed connection attempt before turning on the scheduler again
* @return interval in minutes, if this value is set to either 0 or 65535 then the adaptive scheduler will never be turned on.
*/
public int getAdaptiveSchedulerInterval() {
return adaptiveSchedulerInterval;
}

/**
* The number of minute’s interval the ASM sensor will wait after a failed connection attempt before turning on the scheduler again
* The number of minute�s interval the ASM sensor will wait after a failed connection attempt before turning on the scheduler again
* @param adaptiveSchedulerInterval interval in minutes, if this value is set to either 0 or 65535 then the adaptive scheduler will never be turned on.
*/
public void setAdaptiveSchedulerInterval(int adaptiveSchedulerInterval) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ public SyncProgressDetails(int payloadIndex, boolean crcError, double transferRa
mTransferRateBytes = transferRateBytes;
mBinFilePath = binFilePath;
}
public SyncProgressDetails(String binFilePath) {
mBinFilePath = binFilePath;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void handleResponse(VerisenseMessage verisenseMessage) {
resetFileNameOnStreamingLoggedDataFinish();
stateChange(VerisenseProtocolState.Connected);
for (RadioListener rl : mRadioListenerList) {
rl.hasStopStreamLoggedDataCallback();
rl.hasStopStreamLoggedDataCallback(getDataFilePath());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void connect() throws ShimmerException{
WriteDataToProcess("Connect");
mTaskConnect = new TaskCompletionSource<>();
try {
boolean result = mTaskConnect.getTask().waitForCompletion(2, TimeUnit.SECONDS);
boolean result = mTaskConnect.getTask().waitForCompletion(6, TimeUnit.SECONDS);
if (result) {

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,27 @@ public class BasicShimmerBluetoothManagerPc extends ShimmerBluetoothManager {
List<String> shimmer3BleMacIdList = new ArrayList<String>();
List<VerisenseDevice> verisenseDeviceList = new ArrayList<VerisenseDevice>();
List<ShimmerGRPC> shimmer3BleDeviceList = new ArrayList<ShimmerGRPC>();
private boolean mInternalUse = true;
public static int mGRPCPort;

public BasicShimmerBluetoothManagerPc() {
startGrpc();
}

public BasicShimmerBluetoothManagerPc(boolean isInternalUse) {
if(isInternalUse) {
public BasicShimmerBluetoothManagerPc(boolean enableGRPC) {
if(enableGRPC) {
startGrpc();
}
}

protected void startGrpc(String path) {
try {
GrpcBLERadioByteTools grpcTool = new GrpcBLERadioByteTools("ShimmerBLEGrpc.exe",path);
mGRPCPort = grpcTool.startServer();
} catch(Exception e) {
e.printStackTrace();
}
}

private void startGrpc() {
try {
GrpcBLERadioByteTools grpcTool = new GrpcBLERadioByteTools();
Expand Down
Loading