GUI counterpart to create/disable AdHoc connection
+ a small trick with powering WiFi to reconnect to a default WiFi after
Adhoc is no longer in use
+ extending author names
Change-Id: I972f0a54e4ccbb5c9c2582763a0f5a72a8b25407
diff --git a/adhoc/adhoc-osx.mm b/adhoc/adhoc-osx.mm
index 107e230..3b7da80 100644
--- a/adhoc/adhoc-osx.mm
+++ b/adhoc/adhoc-osx.mm
@@ -99,6 +99,13 @@
CWInterface *airport = [CWInterface interfaceWithName:interfaceName];
[airport disassociate];
+
+ NSError *err;
+ [airport setPower:NO error:&err];
+ [airport setPower:YES error:&err];
+
+ // ok. this trick works. if just disassociate, then it will stay OFF
+ // setting power OFF/ON trick the system to reconnect to default WiFi
}
#endif // ADHOC_SUPPORTED