This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
YASMIN/sensors/android/WiFiSensorAndroid.cpp
2016-09-28 12:16:45 +02:00

20 lines
501 B
C++

#ifdef ANDROID
#include "WiFiSensorAndroid.h"
extern "C" {
/** called after each successful WiFi scan */
JNIEXPORT void JNICALL Java_indoor_java_WiFi_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);
WiFiSensorAndroid::get().handle(str);
}
}
#endif