started to add ble functions
added ble as sensor to java and c++ added sensorlistener for ble added ble to observation and onDataSensor in filter started to work on ble fingerprints for optimization
This commit is contained in:
18
sensors/android/BLESensorAndroid.cpp
Normal file
18
sensors/android/BLESensorAndroid.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifdef ANDROID
|
||||
|
||||
#include "BLESensorAndroid.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
/** called after each successful WiFi scan */
|
||||
JNIEXPORT void JNICALL Java_indoor_java_BLE_onScanComplete(JNIEnv* env, jobject jobj, jbyteArray arrayID) {
|
||||
(void) env; (void) jobj;
|
||||
jsize length = env->GetArrayLength(arrayID);
|
||||
jbyte* data = env->GetByteArrayElements(arrayID, 0);
|
||||
std::string str((char*)data, length);
|
||||
env->ReleaseByteArrayElements(arrayID, data, JNI_ABORT);
|
||||
BLESensorAndroid::get().handle(str);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user