I have OBD2 device adapter which supports Wifi. Now I want to get notification about Wifi with OBD2 device is available so I can start talking to that device and read data and Wifi with OBD2 device is not available.
When device is connected to OBD2 Port,wifi is broadcasting. I have used sample code of Reachability class. But I can't get proper notification.
I tried with SimplePingHelper code. It works fine with Main thread but it not runs with background thread. SimplePingHelper Source code
SimplePingHelper code actually uses SimplePing sample code from Apple. SimplePing Code By Apple
Can you help me in this code that it works with background thread Or What are other ways I can check to get this notification ?
Wireless Network Watcher is a free Windows app that tells you whenever new connections are made.
`Use Apple's default reachability class:
Download reachability project from This link
Copy Reachability.h and Reachability.m file in your project.
And set this method in Application delegate file.
-(void)initializeRechabilityObeserver { //Change the host name here to change the server your monitoring hostReach = [Reachability reachabilityWithHostName: @"www.apple.com http://www.apple.com"]; [hostReach startNotifier]; //[self updateInterfaceWithReachability: hostReach];
internetReach = [Reachability reachabilityForInternetConnection];
[internetReach startNotifier];
//[self updateInterfaceWithReachability: internetReach];
wifiReach = [Reachability reachabilityForLocalWiFi] ;
[wifiReach startNotifier];
//[self updateInterfaceWithReachability: wifiReach];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With