3
목표 C에서 프로그램을 실행해야합니다. 무선 신호 강도를 얻기위한 코드를 발견했습니다.iOS 프레임 워크를 찾을 수 없음
mobilewifi.h 파일이 표시되지 않습니까? 이것이 가능한 곳. 내가 봤어.
또한이 파일을 프로젝트의 어느 부분에 보관해야합니까? 어떤 .m 파일? App Delegate ??
코드는 다음과 같습니다
#include <math.h>
#include <MobileWiFi.h>
WiFiManagerRef manager = WiFiManagerClientCreate(kCFAllocatorDefault, 0);
CFArrayRef devices = WiFiManagerClientCopyDevices(_manager);
WiFiDeviceClientRef client = (WiFiDeviceClientRef)CFArrayGetValueAtIndex(devices, 0);
CFDictionaryRef data = (CFDictionaryRef)WiFiDeviceClientCopyProperty(_device, CFSTR("RSSI"));
CFNumberRef scaled = (CFNumberRef)WiFiDeviceClientCopyProperty(_device, kWiFiScaledRSSIKey);
CFNumberRef RSSI = (CFNumberRef)CFDictionaryGetValue(data, CFSTR("RSSI_CTL_AGR"));
int raw;
CFNumberGetValue(RSSI, kCFNumberIntType, &raw);
float strength;
CFNumberGetValue(scaled, kCFNumberFloatType, &strength);
CFRelease(scaled);
strength *= -1;
// Apple uses -3.0.
int bars = (int)ceilf(strength * -3.0f);
bars = MAX(1, MIN(bars, 3));
printf("WiFi signal strength: %d dBm\n\t Bars: %d\n", raw, bars);
CFRelease(data);
CFRelease(scaled);
CFRelease(devices);
CFRelease(manager);
. 사과에 의해 (가능성이) 거부되기를 원하지 않는다면 그것을 사용하면 안됩니다. – Putz1103
@ Putz1103 방금 연구 과제로 사용하고자합니다. –
해결 했습니까? 동일한 문제가 있으며 프레임 워크를 사용할 수 없습니다. 그랬다면 내 질문을 여기에서 볼 수 있습니다 : http://stackoverflow.com/questions/31557922/xcode-how-use-mobilewifi-framework – doxsi