static jboolean android_net_wifi_setScanningMacOui(JNIEnv *env, jclass cls, jint iface, jbyteArray param) { wifi_interface_handle handle = getIfaceHandle(env, cls, iface); ALOGD("setting scan oui %p", handle); static const unsigned oui_len = 3; /* OUI is upper 3 bytes of mac_address */ int len = env->GetArrayLength(param); if (len != oui_len) { ALOGE("invalid oui length %d", len); return false; } jbyte* bytes = env->GetByteArrayElements(param, NULL); if (bytes == NULL) { ALOGE("failed to get array"); return false; } wifi_error ret = wifi_set_scanning_mac_oui(handle, (byte *)bytes); env->ReleaseByteArrayElements(param, bytes, 0); return ret == WIFI_SUCCESS; }
static void setPnoMacOui() { wifi_set_scanning_mac_oui(wlan0Handle, mac_oui); }