大佬教程收集整理的这篇文章主要介绍了iOS 7(非越狱)Wi-Fi RSSI值,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我不想在AppStore上发布我的应用程序,因此允许使用PrivateAPI.
#include <dlfcn.h> -(NSDictionary *)currentWiFiInfo { void *libHandle; void *airportHandle; int (*apple80211Open)(void *); int (*apple80211Bind)(void *,NSString *); int (*apple80211ClosE)(void *); int (*apple80211GeTinfoCopy)(void *,CFDictionaryRef *); NSMutableDictionary *infoDict = [NSMutableDictionary new]; NSDictionary * tempDictionary; libHandle = dlopen("/System/Library/SystemConfiguration/IPConfiguration.bundle/IPConfiguration",RTLD_LAZY); char *error; if (libHandle == NULL && (error = dlerror()) != NULL) { NSLog(@"%s",error); } apple80211Open = dlsym(libHandle,"Apple80211Open"); apple80211Bind = dlsym(libHandle,"Apple80211BindToInterface"); apple80211Close = dlsym(libHandle,"Apple80211Close"); apple80211GeTinfoCopy = dlsym(libHandle,"Apple80211GeTinfoCopy"); apple80211Open(&airportHandlE); apple80211Bind(airportHandle,@"en0"); CFDictionaryRef info = NULL; apple80211GeTinfoCopy(airportHandle,&info); tempDictionary = (__bridge NSDictionary *)info; apple80211Close(airportHandlE); [infoDict setObject:(tempDictionarY[@"RSSI"])[@"RSSI_CTL_AGR"] ? (tempDictionarY[@"RSSI"])[@"RSSI_CTL_AGR"] : @"0" forKey:@"RSSI"]; [infoDict setObject:tempDictionarY[@"BSSID"] ? tempDictionarY[@"BSSID"] : @"null" forKey:@"BSSID"]; [infoDict setObject:tempDictionarY[@"SSID_STR"] ? tempDictionarY[@"SSID_STR"] : @"null" forKey:@"SSID"]; [infoDict setObject:tempDictionarY[@"RATE"] ? tempDictionarY[@"RATE"] : @"0" forKey:@"SPEED"]; return infoDict; }
以上是大佬教程为你收集整理的iOS 7(非越狱)Wi-Fi RSSI值全部内容,希望文章能够帮你解决iOS 7(非越狱)Wi-Fi RSSI值所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。