Commit 617d0f78 authored by LIly's avatar LIly
Browse files

time seems to be working

parent a6b24548
......@@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.google.gms:google-services:3.2.0'
......
......@@ -34,9 +34,9 @@ android {
workingDir 'src/main/jni'
commandLine './ndk-build-script.sh'
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn buildNDK
}
//tasks.withType(JavaCompile) {
//compileTask -> compileTask.dependsOn buildNDK
//}
buildTypes {
debug {
signingConfig signingConfigs.debug
......
......@@ -43,6 +43,8 @@ import java.util.List;
*
**/
public class EncounterBasedCommunication {
public static final long CHANGE_EPOCH_TIME = 2*60000;
public static final long SCAN_BATCH_INTERVAL = (long) (2 * 60000);
public static final int REQUEST_ENABLE_BT = 1;
public static final int REQUEST_ACCESS_FINE_LOCATION = 2;
......
......@@ -24,6 +24,7 @@ import org.mpisws.helpers.ThreadPoolManager;
import java.util.HashMap;
import java.util.Map;
import static org.mpisws.encounters.EncounterBasedCommunication.CHANGE_EPOCH_TIME;
import static org.mpisws.encounters.encounterformation.GattServerClient.confirmEvents;
/**
......@@ -34,8 +35,6 @@ import static org.mpisws.encounters.encounterformation.GattServerClient.confirmE
* - running epoch changes and confirmation
*/
public class EncounterFormationCore implements Runnable {
public static final long CHANGE_EPOCH_TIME = 15*60000;
public static final long SCAN_BATCH_INTERVAL = (long) (2 * 60000);
private static final String TAG = EncounterFormationCore.class.getSimpleName();
protected static Identifier mDHPubKey;
protected static Identifier mNonce;
......
......@@ -28,6 +28,7 @@ import android.bluetooth.le.ScanSettings;
import android.content.Context;
import android.os.Handler;
import android.os.ParcelUuid;
import android.os.SystemClock;
import android.util.Log;
import com.google.protobuf.ByteString;
......@@ -50,10 +51,10 @@ import java.util.List;
import java.util.Map;
import static android.bluetooth.le.ScanSettings.SCAN_MODE_LOW_POWER;
import static org.mpisws.encounters.EncounterBasedCommunication.SCAN_BATCH_INTERVAL;
import static org.mpisws.encounters.encounterformation.Advertiser.NONCE_LENGTH_IN_ADVERT;
import static org.mpisws.encounters.encounterformation.Advertiser.PUUID_LENGTH;
import static org.mpisws.encounters.encounterformation.Advertiser.SHA1_LENGTH;
import static org.mpisws.encounters.encounterformation.EncounterFormationCore.SCAN_BATCH_INTERVAL;
import static org.mpisws.encounters.encounterformation.EncounterFormationCore.mDHKey;
import static org.mpisws.encounters.encounterformation.EncounterFormationCore.mDHPubKey;
import static org.mpisws.encounters.encounterformation.EncounterFormationCore.mNonce;
......@@ -185,7 +186,10 @@ public class ScannerProcessor {
// get the rssi
int rssi = result.getRssi();
// process the scan result. if this is a new device, pkid is not null
long pkid = SDDR_Native.c_processScanResult(rssi, newnonce);
long pkid = SDDR_Native.c_processScanResult(rssi, newnonce,
System.currentTimeMillis() -
SystemClock.elapsedRealtime() +
result.getTimestampNanos() / 1000000);
Log.d(TAG, "Processing SDDR_API scanresult with data " + Utils.getHexString(datahead) + Utils.getHexString(datatail) + ":\n"
+ "newNonce " + Utils.getHexString(newnonce) + ", "
......
{
application: {
ebcKey: '2e5a1cc8-5eab-4dbd-8d6d-6a84eab23374'
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment