Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <alex@mapswithme.com>2013-07-05 04:24:47 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:58:17 +0300
commit4d9fb7de86a2d5a9bc3f39e1c1b65869c3380a0a (patch)
tree0cc5d01bf96be04ae1f0cd06733570f9596a3004 /platform
parent5d7723e7190679bb4cb477268297540f8d6607d2 (diff)
[mac] Fixed compilation issue with new MacOSX SDK - they removed WiFi scanning code starting from MacOS X 10.7
Diffstat (limited to 'platform')
-rw-r--r--platform/location_service.cpp2
-rw-r--r--platform/platform.pro1
-rw-r--r--platform/wifi_info_mac.mm110
-rw-r--r--platform/wifi_location_service.cpp2
4 files changed, 2 insertions, 113 deletions
diff --git a/platform/location_service.cpp b/platform/location_service.cpp
index a24c8c8acd..8c2ac1a560 100644
--- a/platform/location_service.cpp
+++ b/platform/location_service.cpp
@@ -80,7 +80,7 @@ namespace location
m_services.push_back(CreateAppleLocationService(*this));
#endif
-#if defined(OMIM_OS_MAC) || defined(OMIM_OS_WINDOWS)
+#if defined(OMIM_OS_WINDOWS)
m_services.push_back(CreateWiFiLocationService(*this));
#endif
}
diff --git a/platform/platform.pro b/platform/platform.pro
index 75fe5000a7..13e048c10f 100644
--- a/platform/platform.pro
+++ b/platform/platform.pro
@@ -30,7 +30,6 @@ INCLUDEPATH += $$ROOT_DIR/3party/jansson/src
wifi_info_windows.cpp
} else:macx* {
OBJECTIVE_SOURCES += platform_mac.mm \
- wifi_info_mac.mm \
apple_video_timer.mm \
apple_location_service.mm
} else:linux* {
diff --git a/platform/wifi_info_mac.mm b/platform/wifi_info_mac.mm
deleted file mode 100644
index 781d201728..0000000000
--- a/platform/wifi_info_mac.mm
+++ /dev/null
@@ -1,110 +0,0 @@
-#include "../std/target_os.hpp"
-#ifdef OMIM_OS_MAC
-
-#include "wifi_info.hpp"
-
-#include "../base/string_utils.hpp"
-
-#import <Foundation/Foundation.h>
-#import <CoreWLAN/CWInterface.h>
-#import <CoreWLAN/CWNetwork.h>
-
-static string AppendZeroIfNeeded(string const & macAddrPart)
-{
- string res(macAddrPart);
- if (res.size() == 1)
- res.insert(0, "0");
- return res;
-}
-
-@interface WiFiInfoMac : NSObject {
-@private
- WiFiInfo::WifiRequestCallbackT m_callback;
- vector<WiFiInfo::AccessPoint> m_accessPoints;
-}
-@end
-//- (id)InitWithCallback:(WiFiInfo::WifiRequestCallbackT)callback;
-@implementation WiFiInfoMac
-
-- (id)InitWithCallback:(WiFiInfo::WifiRequestCallbackT)callback
-{
- self = [super init];
- m_callback = callback;
- [self performSelectorInBackground:@selector(WifiScanThread) withObject:nil];
- return self;
-}
-
-- (void)dealloc
-{
- [super dealloc];
-// NSLog(@"Mac OS WiFiInfo selfdestructed successfully");
-}
-
-/// Executed on main thread
-- (void)NotifyGUI
-{
- m_callback(m_accessPoints);
- // selfdestruct
- [self release];
-}
-
-/// new background thread
-- (void)WifiScanThread
-{
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-
- m_accessPoints.clear();
-
- // avoid crash on systems without wlan interfaces
- NSArray * ifaces = [CWInterface supportedInterfaces];
- if ([ifaces count])
- {
- CWInterface * iFace = [CWInterface interface];
- NSArray * nets = [iFace scanForNetworksWithParameters:nil error:nil];
- for (NSUInteger i = 0; i < [nets count]; ++i)
- {
- CWNetwork * net = (CWNetwork *)[nets objectAtIndex:i];
- WiFiInfo::AccessPoint apn;
- apn.m_ssid = [net.ssid UTF8String];
- apn.m_signalStrength = strings::to_string([net.rssi intValue]);
- // fix formatting for wifi address
- string const rawBssid = [net.bssid UTF8String];
- if (!rawBssid.empty())
- {
- strings::SimpleTokenizer tokIt(rawBssid, ":");
- apn.m_bssid = AppendZeroIfNeeded(*tokIt);
- do
- {
- ++tokIt;
- apn.m_bssid += "-";
- apn.m_bssid += AppendZeroIfNeeded(*tokIt);
- } while (!tokIt.IsLast());
- }
- m_accessPoints.push_back(apn);
- }
- }
- [pool drain];
-
- [self performSelectorOnMainThread:@selector(NotifyGUI) withObject:nil waitUntilDone:NO];
-}
-@end
-/////////////////////////////////////////////////////////////////////////////
-WiFiInfo::WiFiInfo()
-{
-}
-
-WiFiInfo::~WiFiInfo()
-{
-}
-
-void WiFiInfo::RequestWiFiBSSIDs(WifiRequestCallbackT callback)
-{
- // it will be self-destroyed when finished
- [[WiFiInfoMac alloc] InitWithCallback:callback];
-}
-
-void WiFiInfo::Stop()
-{
-}
-
-#endif
diff --git a/platform/wifi_location_service.cpp b/platform/wifi_location_service.cpp
index 6954a8aee5..3fd394c5a8 100644
--- a/platform/wifi_location_service.cpp
+++ b/platform/wifi_location_service.cpp
@@ -64,7 +64,7 @@ namespace location
}
else
LOG(LWARNING, ("Location server is not available"));
- /// free memory
+ // free memory
delete &response;
}