Added extra logging around fall detection code.

This commit is contained in:
Graham Jones
2021-11-07 15:54:51 +00:00
parent 0161b93922
commit eb2aff577f
2 changed files with 8 additions and 2 deletions

View File

@@ -457,6 +457,7 @@ public abstract class SdDataSource {
hrCheck();
fallCheck();
muteCheck();
Log.v(TAG,"after fallCheck, mSdData.fallAlarmStanding="+mSdData.fallAlarmStanding);
mSdDataReceiver.onSdDataReceived(mSdData); // and tell SdServer we have received data.
}
@@ -570,8 +571,9 @@ public abstract class SdDataSource {
if (mSdData.rawData[i + j] < minAcc) minAcc = mSdData.rawData[i + j];
if (mSdData.rawData[i + j] > maxAcc) maxAcc = mSdData.rawData[i + j];
}
Log.d(TAG, "check_fall() - minAcc=" + minAcc +" (mFallThreshMin="+mFallThreshMin+ "), maxAcc=" + maxAcc+" (mFallThreshMax="+mFallThreshMax+")") ;
if ((minAcc < mFallThreshMin) && (maxAcc > mFallThreshMax)) {
Log.d(TAG, "check_fall() - minAcc=" + minAcc + ", maxAcc=" + maxAcc);
Log.d(TAG, "check_fall() ****FALL DETECTED***** minAcc=" + minAcc + ", maxAcc=" + maxAcc);
Log.d(TAG, "check_fall() - ****FALL DETECTED****");
mSdData.fallAlarmStanding = true;
return;

View File

@@ -296,8 +296,9 @@ public class SdServer extends Service implements SdDataReceiver {
showNotification(0);
}
// Record last time we sent an SMS so we can limit rate of SMS
// sending to one per minute.
// sending to one per minute. We set it to one minute ago (60000 milliseconds)
mSMSTime = new Time(Time.getCurrentTimezone());
mSMSTime.set(mSMSTime.toMillis(false)-60000);
// Start timer to log data regularly..
@@ -529,6 +530,8 @@ public class SdServer extends Service implements SdDataReceiver {
*/
public void onSdDataReceived(SdData sdData) {
Log.v(TAG, "onSdDataReceived() - " + sdData.toString());
Log.v(TAG,"onSdDataReceived(), sdData.fallAlarmStanding="+sdData.fallAlarmStanding);
if (sdData.alarmState == 0) {
if ((!mLatchAlarms) ||
(mLatchAlarms &&
@@ -602,6 +605,7 @@ public class SdServer extends Service implements SdDataReceiver {
startLatchTimer();
}
// Handle fall alarm
Log.v(TAG,"sdData.fallAlarmStanding="+sdData.fallAlarmStanding );
if ((sdData.alarmState == 3) || (sdData.fallAlarmStanding)) {
sdData.alarmPhrase = "FALL";
sdData.fallAlarmStanding = true;