├── README.md └── test_wifi_02 ├── test_wifi_02.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── dev-002.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── dev-002.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── test_wifi_02 ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── RouteAddress │ ├── getgateway.c │ ├── getgateway.h │ └── route.h ├── ViewController.h ├── ViewController.m └── main.m ├── test_wifi_02Tests ├── Info.plist └── test_wifi_02Tests.m └── test_wifi_02UITests ├── Info.plist └── test_wifi_02UITests.m /README.md: -------------------------------------------------------------------------------- 1 | # test_wifi -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CAEFDF6E205ACA8D00618D52 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CAEFDF6D205ACA8D00618D52 /* AppDelegate.m */; }; 11 | CAEFDF71205ACA8D00618D52 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAEFDF70205ACA8D00618D52 /* ViewController.m */; }; 12 | CAEFDF74205ACA8D00618D52 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CAEFDF72205ACA8D00618D52 /* Main.storyboard */; }; 13 | CAEFDF76205ACA8D00618D52 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CAEFDF75205ACA8D00618D52 /* Assets.xcassets */; }; 14 | CAEFDF79205ACA8D00618D52 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CAEFDF77205ACA8D00618D52 /* LaunchScreen.storyboard */; }; 15 | CAEFDF7C205ACA8D00618D52 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CAEFDF7B205ACA8D00618D52 /* main.m */; }; 16 | CAEFDF86205ACA8D00618D52 /* test_wifi_02Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = CAEFDF85205ACA8D00618D52 /* test_wifi_02Tests.m */; }; 17 | CAEFDF91205ACA8D00618D52 /* test_wifi_02UITests.m in Sources */ = {isa = PBXBuildFile; fileRef = CAEFDF90205ACA8D00618D52 /* test_wifi_02UITests.m */; }; 18 | CAEFDFA2205AD1BD00618D52 /* getgateway.c in Sources */ = {isa = PBXBuildFile; fileRef = CAEFDF9F205AD1BD00618D52 /* getgateway.c */; }; 19 | CAEFDFA5205AE6AA00618D52 /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CAEFDFA4205AE6AA00618D52 /* libresolv.tbd */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | CAEFDF82205ACA8D00618D52 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = CAEFDF61205ACA8D00618D52 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = CAEFDF68205ACA8D00618D52; 28 | remoteInfo = test_wifi_02; 29 | }; 30 | CAEFDF8D205ACA8D00618D52 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = CAEFDF61205ACA8D00618D52 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = CAEFDF68205ACA8D00618D52; 35 | remoteInfo = test_wifi_02; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | CAEFDF69205ACA8D00618D52 /* test_wifi_02.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = test_wifi_02.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | CAEFDF6C205ACA8D00618D52 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | CAEFDF6D205ACA8D00618D52 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | CAEFDF6F205ACA8D00618D52 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | CAEFDF70205ACA8D00618D52 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | CAEFDF73205ACA8D00618D52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | CAEFDF75205ACA8D00618D52 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | CAEFDF78205ACA8D00618D52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | CAEFDF7A205ACA8D00618D52 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | CAEFDF7B205ACA8D00618D52 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | CAEFDF81205ACA8D00618D52 /* test_wifi_02Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = test_wifi_02Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | CAEFDF85205ACA8D00618D52 /* test_wifi_02Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = test_wifi_02Tests.m; sourceTree = ""; }; 52 | CAEFDF87205ACA8D00618D52 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | CAEFDF8C205ACA8D00618D52 /* test_wifi_02UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = test_wifi_02UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | CAEFDF90205ACA8D00618D52 /* test_wifi_02UITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = test_wifi_02UITests.m; sourceTree = ""; }; 55 | CAEFDF92205ACA8D00618D52 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | CAEFDF9F205AD1BD00618D52 /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getgateway.c; sourceTree = ""; }; 57 | CAEFDFA0205AD1BD00618D52 /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getgateway.h; sourceTree = ""; }; 58 | CAEFDFA1205AD1BD00618D52 /* route.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = route.h; sourceTree = ""; }; 59 | CAEFDFA4205AE6AA00618D52 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | CAEFDF66205ACA8D00618D52 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | CAEFDFA5205AE6AA00618D52 /* libresolv.tbd in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | CAEFDF7E205ACA8D00618D52 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | CAEFDF89205ACA8D00618D52 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXFrameworksBuildPhase section */ 86 | 87 | /* Begin PBXGroup section */ 88 | CAEFDF60205ACA8D00618D52 = { 89 | isa = PBXGroup; 90 | children = ( 91 | CAEFDF6B205ACA8D00618D52 /* test_wifi_02 */, 92 | CAEFDF84205ACA8D00618D52 /* test_wifi_02Tests */, 93 | CAEFDF8F205ACA8D00618D52 /* test_wifi_02UITests */, 94 | CAEFDF6A205ACA8D00618D52 /* Products */, 95 | CAEFDFA3205AE6A900618D52 /* Frameworks */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | CAEFDF6A205ACA8D00618D52 /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | CAEFDF69205ACA8D00618D52 /* test_wifi_02.app */, 103 | CAEFDF81205ACA8D00618D52 /* test_wifi_02Tests.xctest */, 104 | CAEFDF8C205ACA8D00618D52 /* test_wifi_02UITests.xctest */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | CAEFDF6B205ACA8D00618D52 /* test_wifi_02 */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | CAEFDF9E205AD1BD00618D52 /* RouteAddress */, 113 | CAEFDF6C205ACA8D00618D52 /* AppDelegate.h */, 114 | CAEFDF6D205ACA8D00618D52 /* AppDelegate.m */, 115 | CAEFDF6F205ACA8D00618D52 /* ViewController.h */, 116 | CAEFDF70205ACA8D00618D52 /* ViewController.m */, 117 | CAEFDF72205ACA8D00618D52 /* Main.storyboard */, 118 | CAEFDF75205ACA8D00618D52 /* Assets.xcassets */, 119 | CAEFDF77205ACA8D00618D52 /* LaunchScreen.storyboard */, 120 | CAEFDF7A205ACA8D00618D52 /* Info.plist */, 121 | CAEFDF7B205ACA8D00618D52 /* main.m */, 122 | ); 123 | path = test_wifi_02; 124 | sourceTree = ""; 125 | }; 126 | CAEFDF84205ACA8D00618D52 /* test_wifi_02Tests */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | CAEFDF85205ACA8D00618D52 /* test_wifi_02Tests.m */, 130 | CAEFDF87205ACA8D00618D52 /* Info.plist */, 131 | ); 132 | path = test_wifi_02Tests; 133 | sourceTree = ""; 134 | }; 135 | CAEFDF8F205ACA8D00618D52 /* test_wifi_02UITests */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | CAEFDF90205ACA8D00618D52 /* test_wifi_02UITests.m */, 139 | CAEFDF92205ACA8D00618D52 /* Info.plist */, 140 | ); 141 | path = test_wifi_02UITests; 142 | sourceTree = ""; 143 | }; 144 | CAEFDF9E205AD1BD00618D52 /* RouteAddress */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | CAEFDF9F205AD1BD00618D52 /* getgateway.c */, 148 | CAEFDFA0205AD1BD00618D52 /* getgateway.h */, 149 | CAEFDFA1205AD1BD00618D52 /* route.h */, 150 | ); 151 | path = RouteAddress; 152 | sourceTree = ""; 153 | }; 154 | CAEFDFA3205AE6A900618D52 /* Frameworks */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | CAEFDFA4205AE6AA00618D52 /* libresolv.tbd */, 158 | ); 159 | name = Frameworks; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXGroup section */ 163 | 164 | /* Begin PBXNativeTarget section */ 165 | CAEFDF68205ACA8D00618D52 /* test_wifi_02 */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = CAEFDF95205ACA8D00618D52 /* Build configuration list for PBXNativeTarget "test_wifi_02" */; 168 | buildPhases = ( 169 | CAEFDF65205ACA8D00618D52 /* Sources */, 170 | CAEFDF66205ACA8D00618D52 /* Frameworks */, 171 | CAEFDF67205ACA8D00618D52 /* Resources */, 172 | ); 173 | buildRules = ( 174 | ); 175 | dependencies = ( 176 | ); 177 | name = test_wifi_02; 178 | productName = test_wifi_02; 179 | productReference = CAEFDF69205ACA8D00618D52 /* test_wifi_02.app */; 180 | productType = "com.apple.product-type.application"; 181 | }; 182 | CAEFDF80205ACA8D00618D52 /* test_wifi_02Tests */ = { 183 | isa = PBXNativeTarget; 184 | buildConfigurationList = CAEFDF98205ACA8D00618D52 /* Build configuration list for PBXNativeTarget "test_wifi_02Tests" */; 185 | buildPhases = ( 186 | CAEFDF7D205ACA8D00618D52 /* Sources */, 187 | CAEFDF7E205ACA8D00618D52 /* Frameworks */, 188 | CAEFDF7F205ACA8D00618D52 /* Resources */, 189 | ); 190 | buildRules = ( 191 | ); 192 | dependencies = ( 193 | CAEFDF83205ACA8D00618D52 /* PBXTargetDependency */, 194 | ); 195 | name = test_wifi_02Tests; 196 | productName = test_wifi_02Tests; 197 | productReference = CAEFDF81205ACA8D00618D52 /* test_wifi_02Tests.xctest */; 198 | productType = "com.apple.product-type.bundle.unit-test"; 199 | }; 200 | CAEFDF8B205ACA8D00618D52 /* test_wifi_02UITests */ = { 201 | isa = PBXNativeTarget; 202 | buildConfigurationList = CAEFDF9B205ACA8D00618D52 /* Build configuration list for PBXNativeTarget "test_wifi_02UITests" */; 203 | buildPhases = ( 204 | CAEFDF88205ACA8D00618D52 /* Sources */, 205 | CAEFDF89205ACA8D00618D52 /* Frameworks */, 206 | CAEFDF8A205ACA8D00618D52 /* Resources */, 207 | ); 208 | buildRules = ( 209 | ); 210 | dependencies = ( 211 | CAEFDF8E205ACA8D00618D52 /* PBXTargetDependency */, 212 | ); 213 | name = test_wifi_02UITests; 214 | productName = test_wifi_02UITests; 215 | productReference = CAEFDF8C205ACA8D00618D52 /* test_wifi_02UITests.xctest */; 216 | productType = "com.apple.product-type.bundle.ui-testing"; 217 | }; 218 | /* End PBXNativeTarget section */ 219 | 220 | /* Begin PBXProject section */ 221 | CAEFDF61205ACA8D00618D52 /* Project object */ = { 222 | isa = PBXProject; 223 | attributes = { 224 | LastUpgradeCheck = 0920; 225 | ORGANIZATIONNAME = GSK; 226 | TargetAttributes = { 227 | CAEFDF68205ACA8D00618D52 = { 228 | CreatedOnToolsVersion = 9.2; 229 | ProvisioningStyle = Automatic; 230 | }; 231 | CAEFDF80205ACA8D00618D52 = { 232 | CreatedOnToolsVersion = 9.2; 233 | ProvisioningStyle = Automatic; 234 | TestTargetID = CAEFDF68205ACA8D00618D52; 235 | }; 236 | CAEFDF8B205ACA8D00618D52 = { 237 | CreatedOnToolsVersion = 9.2; 238 | ProvisioningStyle = Automatic; 239 | TestTargetID = CAEFDF68205ACA8D00618D52; 240 | }; 241 | }; 242 | }; 243 | buildConfigurationList = CAEFDF64205ACA8D00618D52 /* Build configuration list for PBXProject "test_wifi_02" */; 244 | compatibilityVersion = "Xcode 8.0"; 245 | developmentRegion = en; 246 | hasScannedForEncodings = 0; 247 | knownRegions = ( 248 | en, 249 | Base, 250 | ); 251 | mainGroup = CAEFDF60205ACA8D00618D52; 252 | productRefGroup = CAEFDF6A205ACA8D00618D52 /* Products */; 253 | projectDirPath = ""; 254 | projectRoot = ""; 255 | targets = ( 256 | CAEFDF68205ACA8D00618D52 /* test_wifi_02 */, 257 | CAEFDF80205ACA8D00618D52 /* test_wifi_02Tests */, 258 | CAEFDF8B205ACA8D00618D52 /* test_wifi_02UITests */, 259 | ); 260 | }; 261 | /* End PBXProject section */ 262 | 263 | /* Begin PBXResourcesBuildPhase section */ 264 | CAEFDF67205ACA8D00618D52 /* Resources */ = { 265 | isa = PBXResourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | CAEFDF79205ACA8D00618D52 /* LaunchScreen.storyboard in Resources */, 269 | CAEFDF76205ACA8D00618D52 /* Assets.xcassets in Resources */, 270 | CAEFDF74205ACA8D00618D52 /* Main.storyboard in Resources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | CAEFDF7F205ACA8D00618D52 /* Resources */ = { 275 | isa = PBXResourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | CAEFDF8A205ACA8D00618D52 /* Resources */ = { 282 | isa = PBXResourcesBuildPhase; 283 | buildActionMask = 2147483647; 284 | files = ( 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | /* End PBXResourcesBuildPhase section */ 289 | 290 | /* Begin PBXSourcesBuildPhase section */ 291 | CAEFDF65205ACA8D00618D52 /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | CAEFDF71205ACA8D00618D52 /* ViewController.m in Sources */, 296 | CAEFDF7C205ACA8D00618D52 /* main.m in Sources */, 297 | CAEFDF6E205ACA8D00618D52 /* AppDelegate.m in Sources */, 298 | CAEFDFA2205AD1BD00618D52 /* getgateway.c in Sources */, 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | CAEFDF7D205ACA8D00618D52 /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | CAEFDF86205ACA8D00618D52 /* test_wifi_02Tests.m in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | CAEFDF88205ACA8D00618D52 /* Sources */ = { 311 | isa = PBXSourcesBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | CAEFDF91205ACA8D00618D52 /* test_wifi_02UITests.m in Sources */, 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | }; 318 | /* End PBXSourcesBuildPhase section */ 319 | 320 | /* Begin PBXTargetDependency section */ 321 | CAEFDF83205ACA8D00618D52 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | target = CAEFDF68205ACA8D00618D52 /* test_wifi_02 */; 324 | targetProxy = CAEFDF82205ACA8D00618D52 /* PBXContainerItemProxy */; 325 | }; 326 | CAEFDF8E205ACA8D00618D52 /* PBXTargetDependency */ = { 327 | isa = PBXTargetDependency; 328 | target = CAEFDF68205ACA8D00618D52 /* test_wifi_02 */; 329 | targetProxy = CAEFDF8D205ACA8D00618D52 /* PBXContainerItemProxy */; 330 | }; 331 | /* End PBXTargetDependency section */ 332 | 333 | /* Begin PBXVariantGroup section */ 334 | CAEFDF72205ACA8D00618D52 /* Main.storyboard */ = { 335 | isa = PBXVariantGroup; 336 | children = ( 337 | CAEFDF73205ACA8D00618D52 /* Base */, 338 | ); 339 | name = Main.storyboard; 340 | sourceTree = ""; 341 | }; 342 | CAEFDF77205ACA8D00618D52 /* LaunchScreen.storyboard */ = { 343 | isa = PBXVariantGroup; 344 | children = ( 345 | CAEFDF78205ACA8D00618D52 /* Base */, 346 | ); 347 | name = LaunchScreen.storyboard; 348 | sourceTree = ""; 349 | }; 350 | /* End PBXVariantGroup section */ 351 | 352 | /* Begin XCBuildConfiguration section */ 353 | CAEFDF93205ACA8D00618D52 /* Debug */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | ALWAYS_SEARCH_USER_PATHS = NO; 357 | CLANG_ANALYZER_NONNULL = YES; 358 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 359 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 360 | CLANG_CXX_LIBRARY = "libc++"; 361 | CLANG_ENABLE_MODULES = YES; 362 | CLANG_ENABLE_OBJC_ARC = YES; 363 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 364 | CLANG_WARN_BOOL_CONVERSION = YES; 365 | CLANG_WARN_COMMA = YES; 366 | CLANG_WARN_CONSTANT_CONVERSION = YES; 367 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 368 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 369 | CLANG_WARN_EMPTY_BODY = YES; 370 | CLANG_WARN_ENUM_CONVERSION = YES; 371 | CLANG_WARN_INFINITE_RECURSION = YES; 372 | CLANG_WARN_INT_CONVERSION = YES; 373 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 374 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 376 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 377 | CLANG_WARN_STRICT_PROTOTYPES = YES; 378 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 379 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 380 | CLANG_WARN_UNREACHABLE_CODE = YES; 381 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 382 | CODE_SIGN_IDENTITY = "iPhone Developer"; 383 | COPY_PHASE_STRIP = NO; 384 | DEBUG_INFORMATION_FORMAT = dwarf; 385 | ENABLE_STRICT_OBJC_MSGSEND = YES; 386 | ENABLE_TESTABILITY = YES; 387 | GCC_C_LANGUAGE_STANDARD = gnu11; 388 | GCC_DYNAMIC_NO_PIC = NO; 389 | GCC_NO_COMMON_BLOCKS = YES; 390 | GCC_OPTIMIZATION_LEVEL = 0; 391 | GCC_PREPROCESSOR_DEFINITIONS = ( 392 | "DEBUG=1", 393 | "$(inherited)", 394 | ); 395 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 396 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 397 | GCC_WARN_UNDECLARED_SELECTOR = YES; 398 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 399 | GCC_WARN_UNUSED_FUNCTION = YES; 400 | GCC_WARN_UNUSED_VARIABLE = YES; 401 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 402 | MTL_ENABLE_DEBUG_INFO = YES; 403 | ONLY_ACTIVE_ARCH = YES; 404 | SDKROOT = iphoneos; 405 | }; 406 | name = Debug; 407 | }; 408 | CAEFDF94205ACA8D00618D52 /* Release */ = { 409 | isa = XCBuildConfiguration; 410 | buildSettings = { 411 | ALWAYS_SEARCH_USER_PATHS = NO; 412 | CLANG_ANALYZER_NONNULL = YES; 413 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 414 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 415 | CLANG_CXX_LIBRARY = "libc++"; 416 | CLANG_ENABLE_MODULES = YES; 417 | CLANG_ENABLE_OBJC_ARC = YES; 418 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 419 | CLANG_WARN_BOOL_CONVERSION = YES; 420 | CLANG_WARN_COMMA = YES; 421 | CLANG_WARN_CONSTANT_CONVERSION = YES; 422 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 423 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 424 | CLANG_WARN_EMPTY_BODY = YES; 425 | CLANG_WARN_ENUM_CONVERSION = YES; 426 | CLANG_WARN_INFINITE_RECURSION = YES; 427 | CLANG_WARN_INT_CONVERSION = YES; 428 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 429 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 430 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 431 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 432 | CLANG_WARN_STRICT_PROTOTYPES = YES; 433 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 434 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 435 | CLANG_WARN_UNREACHABLE_CODE = YES; 436 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 437 | CODE_SIGN_IDENTITY = "iPhone Developer"; 438 | COPY_PHASE_STRIP = NO; 439 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 440 | ENABLE_NS_ASSERTIONS = NO; 441 | ENABLE_STRICT_OBJC_MSGSEND = YES; 442 | GCC_C_LANGUAGE_STANDARD = gnu11; 443 | GCC_NO_COMMON_BLOCKS = YES; 444 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 445 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 446 | GCC_WARN_UNDECLARED_SELECTOR = YES; 447 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 448 | GCC_WARN_UNUSED_FUNCTION = YES; 449 | GCC_WARN_UNUSED_VARIABLE = YES; 450 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 451 | MTL_ENABLE_DEBUG_INFO = NO; 452 | SDKROOT = iphoneos; 453 | VALIDATE_PRODUCT = YES; 454 | }; 455 | name = Release; 456 | }; 457 | CAEFDF96205ACA8D00618D52 /* Debug */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 461 | CODE_SIGN_STYLE = Automatic; 462 | DEVELOPMENT_TEAM = VHRQ5Y2HAX; 463 | INFOPLIST_FILE = test_wifi_02/Info.plist; 464 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 465 | PRODUCT_BUNDLE_IDENTIFIER = "gxd.test-wifi-02"; 466 | PRODUCT_NAME = "$(TARGET_NAME)"; 467 | TARGETED_DEVICE_FAMILY = "1,2"; 468 | }; 469 | name = Debug; 470 | }; 471 | CAEFDF97205ACA8D00618D52 /* Release */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 475 | CODE_SIGN_STYLE = Automatic; 476 | DEVELOPMENT_TEAM = VHRQ5Y2HAX; 477 | INFOPLIST_FILE = test_wifi_02/Info.plist; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 479 | PRODUCT_BUNDLE_IDENTIFIER = "gxd.test-wifi-02"; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | TARGETED_DEVICE_FAMILY = "1,2"; 482 | }; 483 | name = Release; 484 | }; 485 | CAEFDF99205ACA8D00618D52 /* Debug */ = { 486 | isa = XCBuildConfiguration; 487 | buildSettings = { 488 | BUNDLE_LOADER = "$(TEST_HOST)"; 489 | CODE_SIGN_STYLE = Automatic; 490 | DEVELOPMENT_TEAM = VHRQ5Y2HAX; 491 | INFOPLIST_FILE = test_wifi_02Tests/Info.plist; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 493 | PRODUCT_BUNDLE_IDENTIFIER = "gxd.test-wifi-02Tests"; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | TARGETED_DEVICE_FAMILY = "1,2"; 496 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/test_wifi_02.app/test_wifi_02"; 497 | }; 498 | name = Debug; 499 | }; 500 | CAEFDF9A205ACA8D00618D52 /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | BUNDLE_LOADER = "$(TEST_HOST)"; 504 | CODE_SIGN_STYLE = Automatic; 505 | DEVELOPMENT_TEAM = VHRQ5Y2HAX; 506 | INFOPLIST_FILE = test_wifi_02Tests/Info.plist; 507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 508 | PRODUCT_BUNDLE_IDENTIFIER = "gxd.test-wifi-02Tests"; 509 | PRODUCT_NAME = "$(TARGET_NAME)"; 510 | TARGETED_DEVICE_FAMILY = "1,2"; 511 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/test_wifi_02.app/test_wifi_02"; 512 | }; 513 | name = Release; 514 | }; 515 | CAEFDF9C205ACA8D00618D52 /* Debug */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | CODE_SIGN_STYLE = Automatic; 519 | DEVELOPMENT_TEAM = VHRQ5Y2HAX; 520 | INFOPLIST_FILE = test_wifi_02UITests/Info.plist; 521 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 522 | PRODUCT_BUNDLE_IDENTIFIER = "gxd.test-wifi-02UITests"; 523 | PRODUCT_NAME = "$(TARGET_NAME)"; 524 | TARGETED_DEVICE_FAMILY = "1,2"; 525 | TEST_TARGET_NAME = test_wifi_02; 526 | }; 527 | name = Debug; 528 | }; 529 | CAEFDF9D205ACA8D00618D52 /* Release */ = { 530 | isa = XCBuildConfiguration; 531 | buildSettings = { 532 | CODE_SIGN_STYLE = Automatic; 533 | DEVELOPMENT_TEAM = VHRQ5Y2HAX; 534 | INFOPLIST_FILE = test_wifi_02UITests/Info.plist; 535 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 536 | PRODUCT_BUNDLE_IDENTIFIER = "gxd.test-wifi-02UITests"; 537 | PRODUCT_NAME = "$(TARGET_NAME)"; 538 | TARGETED_DEVICE_FAMILY = "1,2"; 539 | TEST_TARGET_NAME = test_wifi_02; 540 | }; 541 | name = Release; 542 | }; 543 | /* End XCBuildConfiguration section */ 544 | 545 | /* Begin XCConfigurationList section */ 546 | CAEFDF64205ACA8D00618D52 /* Build configuration list for PBXProject "test_wifi_02" */ = { 547 | isa = XCConfigurationList; 548 | buildConfigurations = ( 549 | CAEFDF93205ACA8D00618D52 /* Debug */, 550 | CAEFDF94205ACA8D00618D52 /* Release */, 551 | ); 552 | defaultConfigurationIsVisible = 0; 553 | defaultConfigurationName = Release; 554 | }; 555 | CAEFDF95205ACA8D00618D52 /* Build configuration list for PBXNativeTarget "test_wifi_02" */ = { 556 | isa = XCConfigurationList; 557 | buildConfigurations = ( 558 | CAEFDF96205ACA8D00618D52 /* Debug */, 559 | CAEFDF97205ACA8D00618D52 /* Release */, 560 | ); 561 | defaultConfigurationIsVisible = 0; 562 | defaultConfigurationName = Release; 563 | }; 564 | CAEFDF98205ACA8D00618D52 /* Build configuration list for PBXNativeTarget "test_wifi_02Tests" */ = { 565 | isa = XCConfigurationList; 566 | buildConfigurations = ( 567 | CAEFDF99205ACA8D00618D52 /* Debug */, 568 | CAEFDF9A205ACA8D00618D52 /* Release */, 569 | ); 570 | defaultConfigurationIsVisible = 0; 571 | defaultConfigurationName = Release; 572 | }; 573 | CAEFDF9B205ACA8D00618D52 /* Build configuration list for PBXNativeTarget "test_wifi_02UITests" */ = { 574 | isa = XCConfigurationList; 575 | buildConfigurations = ( 576 | CAEFDF9C205ACA8D00618D52 /* Debug */, 577 | CAEFDF9D205ACA8D00618D52 /* Release */, 578 | ); 579 | defaultConfigurationIsVisible = 0; 580 | defaultConfigurationName = Release; 581 | }; 582 | /* End XCConfigurationList section */ 583 | }; 584 | rootObject = CAEFDF61205ACA8D00618D52 /* Project object */; 585 | } 586 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02.xcodeproj/project.xcworkspace/xcuserdata/dev-002.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleBraver/test_wifi/f62d02887210b469205a74d537ba2064e34bd156/test_wifi_02/test_wifi_02.xcodeproj/project.xcworkspace/xcuserdata/dev-002.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02.xcodeproj/xcuserdata/dev-002.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02.xcodeproj/xcuserdata/dev-002.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | test_wifi_02.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // test_wifi_02 4 | // 5 | // Created by dev-002 on 2018/3/15. 6 | // Copyright © 2018年 GSK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // test_wifi_02 4 | // 5 | // Created by dev-002 on 2018/3/15. 6 | // Copyright © 2018年 GSK. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/RouteAddress/getgateway.c: -------------------------------------------------------------------------------- 1 | // 2 | // getgateway.c 3 | // MSTEnterprise 4 | // 5 | // Created by chuting on 13-4-24. 6 | // Copyright (c) 2013年 chuting . All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "getgateway.h" 14 | #include 15 | #include 16 | #include 17 | 18 | 19 | #define CTL_NET 4 /* network, see socket.h */ 20 | 21 | 22 | #if defined(BSD) || defined(__APPLE__) 23 | 24 | #define ROUNDUP(a) \ 25 | ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) 26 | 27 | int getLocalIP(in_addr_t * addr) 28 | { 29 | int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, 30 | NET_RT_FLAGS, RTF_GATEWAY}; 31 | size_t l; 32 | char * buf, * p; 33 | struct rt_msghdr * rt; 34 | struct sockaddr * sa; 35 | struct sockaddr * sa_tab[RTAX_MAX]; 36 | int i; 37 | int r = -1; 38 | if(sysctl(mib, sizeof(mib)/sizeof(int), 0, &l, 0, 0) < 0) { 39 | return -1; 40 | } 41 | if(l>0) { 42 | buf = malloc(l); 43 | if(sysctl(mib, sizeof(mib)/sizeof(int), buf, &l, 0, 0) < 0) { 44 | return -1; 45 | } 46 | for(p=buf; prtm_msglen) { 47 | rt = (struct rt_msghdr *)p; 48 | sa = (struct sockaddr *)(rt + 1); 49 | for(i=0; irtm_addrs & (1 << i)) { 51 | sa_tab[i] = sa; 52 | sa = (struct sockaddr *)((char *)sa + ROUNDUP(sa->sa_len)); 53 | } else { 54 | sa_tab[i] = NULL; 55 | } 56 | } 57 | 58 | if( ((rt->rtm_addrs & (RTA_DST|RTA_GATEWAY)) == (RTA_DST|RTA_GATEWAY)) 59 | && sa_tab[RTAX_DST]->sa_family == AF_INET 60 | && sa_tab[RTAX_GATEWAY]->sa_family == AF_INET) { 61 | 62 | 63 | if(((struct sockaddr_in *)sa_tab[RTAX_DST])->sin_addr.s_addr == 0) { 64 | char ifName[128]; 65 | if_indextoname(rt->rtm_index,ifName); 66 | 67 | if(strcmp("en0",ifName)==0){ 68 | 69 | *addr = ((struct sockaddr_in *)(sa_tab[RTAX_GATEWAY]))->sin_addr.s_addr; 70 | r = 0; 71 | } 72 | } 73 | } 74 | } 75 | free(buf); 76 | } 77 | return r; 78 | } 79 | 80 | 81 | 82 | unsigned char * getdefaultgateway(in_addr_t * addr) 83 | { 84 | unsigned char * octet=malloc(4); 85 | #if 0 86 | /* net.route.0.inet.dump.0.0 ? */ 87 | int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, 88 | NET_RT_DUMP, 0, 0/*tableid*/}; 89 | #endif 90 | /* net.route.0.inet.flags.gateway */ 91 | int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, 92 | NET_RT_FLAGS, RTF_GATEWAY}; 93 | size_t l; 94 | char * buf, * p; 95 | struct rt_msghdr * rt; 96 | struct sockaddr * sa; 97 | struct sockaddr * sa_tab[RTAX_MAX]; 98 | int i; 99 | if(sysctl(mib, sizeof(mib)/sizeof(int), 0, &l, 0, 0) < 0) { 100 | return octet; 101 | } 102 | if(l>0) { 103 | buf = malloc(l); 104 | if(sysctl(mib, sizeof(mib)/sizeof(int), buf, &l, 0, 0) < 0) { 105 | return octet; 106 | } 107 | for(p=buf; prtm_msglen) { 108 | rt = (struct rt_msghdr *)p; 109 | sa = (struct sockaddr *)(rt + 1); 110 | for(i=0; irtm_addrs & (1 << i)) { 112 | sa_tab[i] = sa; 113 | sa = (struct sockaddr *)((char *)sa + ROUNDUP(sa->sa_len)); 114 | } else { 115 | sa_tab[i] = NULL; 116 | } 117 | } 118 | 119 | if( ((rt->rtm_addrs & (RTA_DST|RTA_GATEWAY)) == (RTA_DST|RTA_GATEWAY)) 120 | && sa_tab[RTAX_DST]->sa_family == AF_INET 121 | && sa_tab[RTAX_GATEWAY]->sa_family == AF_INET) { 122 | 123 | 124 | for (int i=0; i<4; i++){ 125 | octet[i] = ( ((struct sockaddr_in *)(sa_tab[RTAX_GATEWAY]))->sin_addr.s_addr >> (i*8) ) & 0xFF; 126 | } 127 | 128 | } 129 | } 130 | free(buf); 131 | } 132 | return octet; 133 | } 134 | #endif 135 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/RouteAddress/getgateway.h: -------------------------------------------------------------------------------- 1 | // 2 | // getgateway.h 3 | // MSTEnterprise 4 | // 5 | // Created by chuting on 13-4-24. 6 | // Copyright (c) 2013年 chuting . All rights reserved. 7 | // 8 | 9 | 10 | 11 | #ifndef MSTEnterprise_getgateway_h 12 | #define MSTEnterprise_getgateway_h 13 | #include 14 | 15 | 16 | // 模拟器调试里可以编译通过并执行,而选真机调试时却在编译中显示该文件找不到 net/route.h 17 | 18 | #if TARGET_IPHONE_SIMULATOR 19 | #include 20 | #include "route.h" 21 | #elif TARGET_OS_IPHONE 22 | #include "route.h" 23 | #endif 24 | 25 | 26 | 27 | 28 | 29 | unsigned char * getdefaultgateway(in_addr_t * addr); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/RouteAddress/route.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000-2008 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. The rights granted to you under the License 10 | * may not be used to create, or enable the creation or redistribution of, 11 | * unlawful or unlicensed copies of an Apple operating system, or to 12 | * circumvent, violate, or enable the circumvention or violation of, any 13 | * terms of an Apple operating system software license agreement. 14 | * 15 | * Please obtain a copy of the License at 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 | * 18 | * The Original Code and all software distributed under the License are 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 | * Please see the License for the specific language governing rights and 24 | * limitations under the License. 25 | * 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 | */ 28 | /* 29 | * Copyright (c) 1980, 1986, 1993 30 | * The Regents of the University of California. All rights reserved. 31 | * 32 | * Redistribution and use in source and binary forms, with or without 33 | * modification, are permitted provided that the following conditions 34 | * are met: 35 | * 1. Redistributions of source code must retain the above copyright 36 | * notice, this list of conditions and the following disclaimer. 37 | * 2. Redistributions in binary form must reproduce the above copyright 38 | * notice, this list of conditions and the following disclaimer in the 39 | * documentation and/or other materials provided with the distribution. 40 | * 3. All advertising materials mentioning features or use of this software 41 | * must display the following acknowledgement: 42 | * This product includes software developed by the University of 43 | * California, Berkeley and its contributors. 44 | * 4. Neither the name of the University nor the names of its contributors 45 | * may be used to endorse or promote products derived from this software 46 | * without specific prior written permission. 47 | * 48 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 | * SUCH DAMAGE. 59 | * 60 | * @(#)route.h 8.3 (Berkeley) 4/19/94 61 | * $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $ 62 | */ 63 | 64 | #ifndef _NET_ROUTE_H_ 65 | #define _NET_ROUTE_H_ 66 | #include 67 | #include 68 | #include 69 | #include 70 | 71 | /* 72 | * These numbers are used by reliable protocols for determining 73 | * retransmission behavior and are included in the routing structure. 74 | */ 75 | struct rt_metrics { 76 | u_int32_t rmx_locks; /* Kernel leaves these values alone */ 77 | u_int32_t rmx_mtu; /* MTU for this path */ 78 | u_int32_t rmx_hopcount; /* max hops expected */ 79 | int32_t rmx_expire; /* lifetime for route, e.g. redirect */ 80 | u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */ 81 | u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */ 82 | u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */ 83 | u_int32_t rmx_rtt; /* estimated round trip time */ 84 | u_int32_t rmx_rttvar; /* estimated rtt variance */ 85 | u_int32_t rmx_pksent; /* packets sent using this route */ 86 | u_int32_t rmx_filler[4]; /* will be used for T/TCP later */ 87 | }; 88 | 89 | /* 90 | * rmx_rtt and rmx_rttvar are stored as microseconds; 91 | */ 92 | #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ 93 | 94 | 95 | 96 | #define RTF_UP 0x1 /* route usable */ 97 | #define RTF_GATEWAY 0x2 /* destination is a gateway */ 98 | #define RTF_HOST 0x4 /* host entry (net otherwise) */ 99 | #define RTF_REJECT 0x8 /* host or net unreachable */ 100 | #define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ 101 | #define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ 102 | #define RTF_DONE 0x40 /* message confirmed */ 103 | #define RTF_DELCLONE 0x80 /* delete cloned route */ 104 | #define RTF_CLONING 0x100 /* generate new routes on use */ 105 | #define RTF_XRESOLVE 0x200 /* external daemon resolves name */ 106 | #define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */ 107 | #define RTF_STATIC 0x800 /* manually added */ 108 | #define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ 109 | #define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */ 110 | #define RTF_PROTO2 0x4000 /* protocol specific routing flag */ 111 | #define RTF_PROTO1 0x8000 /* protocol specific routing flag */ 112 | 113 | #define RTF_PRCLONING 0x10000 /* protocol requires cloning */ 114 | #define RTF_WASCLONED 0x20000 /* route generated through cloning */ 115 | #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ 116 | /* 0x80000 unused */ 117 | #define RTF_PINNED 0x100000 /* future use */ 118 | #define RTF_LOCAL 0x200000 /* route represents a local address */ 119 | #define RTF_BROADCAST 0x400000 /* route represents a bcast address */ 120 | #define RTF_MULTICAST 0x800000 /* route represents a mcast address */ 121 | #define RTF_IFSCOPE 0x1000000 /* has valid interface scope */ 122 | #define RTF_CONDEMNED 0x2000000 /* defunct; no longer modifiable */ 123 | #define RTF_IFREF 0x4000000 /* route holds a ref to interface */ 124 | #define RTF_PROXY 0x8000000 /* proxying, no interface scope */ 125 | #define RTF_ROUTER 0x10000000 /* host is a router */ 126 | /* 0x20000000 and up unassigned */ 127 | 128 | #define RTF_BITS \ 129 | "\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \ 130 | "\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \ 131 | "\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \ 132 | "\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \ 133 | "\33IFREF\34PROXY\35ROUTER" 134 | 135 | /* 136 | * Routing statistics. 137 | */ 138 | struct rtstat { 139 | short rts_badredirect; /* bogus redirect calls */ 140 | short rts_dynamic; /* routes created by redirects */ 141 | short rts_newgateway; /* routes modified by redirects */ 142 | short rts_unreach; /* lookups which failed */ 143 | short rts_wildcard; /* lookups satisfied by a wildcard */ 144 | }; 145 | 146 | /* 147 | * Structures for routing messages. 148 | */ 149 | struct rt_msghdr { 150 | u_short rtm_msglen; /* to skip over non-understood messages */ 151 | u_char rtm_version; /* future binary compatibility */ 152 | u_char rtm_type; /* message type */ 153 | u_short rtm_index; /* index for associated ifp */ 154 | int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ 155 | int rtm_addrs; /* bitmask identifying sockaddrs in msg */ 156 | pid_t rtm_pid; /* identify sender */ 157 | int rtm_seq; /* for sender to identify action */ 158 | int rtm_errno; /* why failed */ 159 | int rtm_use; /* from rtentry */ 160 | u_int32_t rtm_inits; /* which metrics we are initializing */ 161 | struct rt_metrics rtm_rmx; /* metrics themselves */ 162 | }; 163 | 164 | struct rt_msghdr2 { 165 | u_short rtm_msglen; /* to skip over non-understood messages */ 166 | u_char rtm_version; /* future binary compatibility */ 167 | u_char rtm_type; /* message type */ 168 | u_short rtm_index; /* index for associated ifp */ 169 | int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ 170 | int rtm_addrs; /* bitmask identifying sockaddrs in msg */ 171 | int32_t rtm_refcnt; /* reference count */ 172 | int rtm_parentflags; /* flags of the parent route */ 173 | int rtm_reserved; /* reserved field set to 0 */ 174 | int rtm_use; /* from rtentry */ 175 | u_int32_t rtm_inits; /* which metrics we are initializing */ 176 | struct rt_metrics rtm_rmx; /* metrics themselves */ 177 | }; 178 | 179 | 180 | #define RTM_VERSION 5 /* Up the ante and ignore older versions */ 181 | 182 | /* 183 | * Message types. 184 | */ 185 | #define RTM_ADD 0x1 /* Add Route */ 186 | #define RTM_DELETE 0x2 /* Delete Route */ 187 | #define RTM_CHANGE 0x3 /* Change Metrics or flags */ 188 | #define RTM_GET 0x4 /* Report Metrics */ 189 | #define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ 190 | #define RTM_REDIRECT 0x6 /* Told to use different route */ 191 | #define RTM_MISS 0x7 /* Lookup failed on this address */ 192 | #define RTM_LOCK 0x8 /* fix specified metrics */ 193 | #define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ 194 | #define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ 195 | #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ 196 | #define RTM_NEWADDR 0xc /* address being added to iface */ 197 | #define RTM_DELADDR 0xd /* address being removed from iface */ 198 | #define RTM_IFINFO 0xe /* iface going up/down etc. */ 199 | #define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ 200 | #define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ 201 | #define RTM_IFINFO2 0x12 /* */ 202 | #define RTM_NEWMADDR2 0x13 /* */ 203 | #define RTM_GET2 0x14 /* */ 204 | 205 | /* 206 | * Bitmask values for rtm_inits and rmx_locks. 207 | */ 208 | #define RTV_MTU 0x1 /* init or lock _mtu */ 209 | #define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ 210 | #define RTV_EXPIRE 0x4 /* init or lock _expire */ 211 | #define RTV_RPIPE 0x8 /* init or lock _recvpipe */ 212 | #define RTV_SPIPE 0x10 /* init or lock _sendpipe */ 213 | #define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ 214 | #define RTV_RTT 0x40 /* init or lock _rtt */ 215 | #define RTV_RTTVAR 0x80 /* init or lock _rttvar */ 216 | 217 | /* 218 | * Bitmask values for rtm_addrs. 219 | */ 220 | #define RTA_DST 0x1 /* destination sockaddr present */ 221 | #define RTA_GATEWAY 0x2 /* gateway sockaddr present */ 222 | #define RTA_NETMASK 0x4 /* netmask sockaddr present */ 223 | #define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ 224 | #define RTA_IFP 0x10 /* interface name sockaddr present */ 225 | #define RTA_IFA 0x20 /* interface addr sockaddr present */ 226 | #define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ 227 | #define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ 228 | 229 | /* 230 | * Index offsets for sockaddr array for alternate internal encoding. 231 | */ 232 | #define RTAX_DST 0 /* destination sockaddr present */ 233 | #define RTAX_GATEWAY 1 /* gateway sockaddr present */ 234 | #define RTAX_NETMASK 2 /* netmask sockaddr present */ 235 | #define RTAX_GENMASK 3 /* cloning mask sockaddr present */ 236 | #define RTAX_IFP 4 /* interface name sockaddr present */ 237 | #define RTAX_IFA 5 /* interface addr sockaddr present */ 238 | #define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ 239 | #define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ 240 | #define RTAX_MAX 8 /* size of array to allocate */ 241 | 242 | struct rt_addrinfo { 243 | int rti_addrs; 244 | struct sockaddr *rti_info[RTAX_MAX]; 245 | }; 246 | 247 | 248 | #endif /* _NET_ROUTE_H_ */ 249 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // test_wifi_02 4 | // 5 | // Created by dev-002 on 2018/3/15. 6 | // Copyright © 2018年 GSK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // test_wifi_02 4 | // 5 | // Created by dev-002 on 2018/3/15. 6 | // Copyright © 2018年 GSK. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | //iOS获取当前手机WIFI名称信息 12 | #import 13 | 14 | //获取网关信息 15 | #import 16 | #import 17 | #import 18 | #import "getgateway.h" 19 | 20 | //获取DNS Xcode中添加libresolv.dylib 21 | #import 22 | 23 | @interface ViewController () 24 | 25 | @end 26 | 27 | @implementation ViewController 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | // Do any additional setup after loading the view, typically from a nib. 32 | 33 | //iOS获取当前手机WIFI名称信息 34 | NSString *currentSSID = [self fetchSSIDInfo]; 35 | NSLog(@"WIFI名称:%@", currentSSID); 36 | 37 | NSString *gatewayIp = [self getGatewayIpForCurrentWiFi]; 38 | NSLog(@"网关地址:%@", gatewayIp); 39 | 40 | NSString *dns = [self outPutDNSServers]; 41 | NSLog(@"DNS服务器:%@", dns); 42 | 43 | } 44 | 45 | //iOS获取当前手机WIFI名称信息 46 | -(NSString *)fetchSSIDInfo 47 | { 48 | NSString *currentSSID = @"Not Found"; 49 | CFArrayRef myArray = CNCopySupportedInterfaces(); 50 | if (myArray != nil){ 51 | NSDictionary* myDict = (__bridge NSDictionary *) CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0)); 52 | if (myDict!=nil){ 53 | currentSSID=[myDict valueForKey:@"SSID"]; 54 | /* myDict包含信息: 55 | { 56 | BSSID = "ac:29:3a:99:33:45"; 57 | SSID = "三千"; 58 | SSIDDATA = ; 59 | } 60 | */ 61 | } else { 62 | currentSSID=@"<>"; 63 | } 64 | } else { 65 | currentSSID=@"<>"; 66 | } 67 | CFRelease(myArray); 68 | return currentSSID; 69 | } 70 | 71 | //获取网关等信息 72 | - (NSString *)getGatewayIpForCurrentWiFi { 73 | NSString *address = @"error"; 74 | struct ifaddrs *interfaces = NULL; 75 | struct ifaddrs *temp_addr = NULL; 76 | int success = 0; 77 | 78 | // retrieve the current interfaces - returns 0 on success 79 | success = getifaddrs(&interfaces); 80 | if (success == 0) { 81 | temp_addr = interfaces; 82 | while(temp_addr != NULL) { 83 | if(temp_addr->ifa_addr->sa_family == AF_INET) { 84 | // Check if interface is en0 which is the wifi connection on the iPhone 85 | if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) 86 | { 87 | address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)]; 88 | NSLog(@"本机地址:%@",address); 89 | 90 | //routerIP----192.168.1.255 广播地址 91 | NSLog(@"广播地址:%@",[NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_dstaddr)->sin_addr)]); 92 | 93 | //--192.168.1.106 本机地址 94 | NSLog(@"本机地址:%@",[NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)]); 95 | 96 | //--255.255.255.0 子网掩码地址 97 | NSLog(@"子网掩码地址:%@",[NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_netmask)->sin_addr)]); 98 | 99 | //--en0 接口 100 | // en0 Ethernet II protocal interface 101 | // et0 802.3 protocal interface 102 | // ent0 Hardware device interface 103 | NSLog(@"接口名:%@",[NSString stringWithUTF8String:temp_addr->ifa_name]); 104 | } 105 | } 106 | temp_addr = temp_addr->ifa_next; 107 | } 108 | } 109 | 110 | freeifaddrs(interfaces); 111 | in_addr_t i = inet_addr([address cStringUsingEncoding:NSUTF8StringEncoding]); 112 | in_addr_t* x = &i; 113 | unsigned char *s = getdefaultgateway(x); 114 | NSString *ip=[NSString stringWithFormat:@"%d.%d.%d.%d",s[0],s[1],s[2],s[3]]; 115 | free(s); 116 | return ip; 117 | } 118 | 119 | /// 获取本机DNS服务器 120 | - (NSString *)outPutDNSServers 121 | { 122 | res_state res = malloc(sizeof(struct __res_state)); 123 | 124 | int result = res_ninit(res); 125 | 126 | NSMutableArray *dnsArray = @[].mutableCopy; 127 | 128 | if ( result == 0 ) 129 | { 130 | for ( int i = 0; i < res->nscount; i++ ) 131 | { 132 | NSString *s = [NSString stringWithUTF8String : inet_ntoa(res->nsaddr_list[i].sin_addr)]; 133 | 134 | [dnsArray addObject:s]; 135 | } 136 | } 137 | else{ 138 | NSLog(@"%@",@" res_init result != 0"); 139 | } 140 | 141 | res_nclose(res); 142 | 143 | return dnsArray.firstObject; 144 | } 145 | 146 | - (void)didReceiveMemoryWarning { 147 | [super didReceiveMemoryWarning]; 148 | // Dispose of any resources that can be recreated. 149 | } 150 | 151 | @end 152 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // test_wifi_02 4 | // 5 | // Created by dev-002 on 2018/3/15. 6 | // Copyright © 2018年 GSK. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02Tests/test_wifi_02Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // test_wifi_02Tests.m 3 | // test_wifi_02Tests 4 | // 5 | // Created by dev-002 on 2018/3/15. 6 | // Copyright © 2018年 GSK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface test_wifi_02Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation test_wifi_02Tests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02UITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /test_wifi_02/test_wifi_02UITests/test_wifi_02UITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // test_wifi_02UITests.m 3 | // test_wifi_02UITests 4 | // 5 | // Created by dev-002 on 2018/3/15. 6 | // Copyright © 2018年 GSK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface test_wifi_02UITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation test_wifi_02UITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------