iOS Check if WiFi ip is accessible (ping)
-
Hello,
I'm looking for a ping alternative on iOS, since ussual ping calling methods doesn't work on iOS.
I've tried including SimplePing, which works fine on an XCode project, however even if rename .m files to .mm, on Qt I get an "undefined reference" errors on CFHost.h file methods that are called in SimplePing.mm.link text SimplePing issue here is unsolved, so I assume that we can't use SimplePing on Qt.
Is there any way to check on Qt, if WiFi ip is accessible for iOS?
-
You are not linking the CFNetwork framework.
-
Hi,
Which exact error do you get ?
-
Hello,
The exact steps I take are:
After I download SimplePingHelper project from the link mentioned before, I rename SimplePing.m and SimplePingHelper.m files to .mm, include SimplePing.h/.mm and SimplePingHelper.h/.mm files in the .pro file and build the project. First errors I get:On "check_compile_time()" calls in "SimplePing.h" file:
C++ requres a type specifier for all declarations
And casting errors in SimplePing.mm file:
At line 76:assigning to 'const uint16_t *' (aka 'const unsigned short *') from incompatible type 'const void *' cursor = buffer; ^~~~~~
At line 226:
assigning to 'ICMPHeader *' from incompatible type 'void *' icmpPtr = [packet mutableBytes];
Since they do not seem critical, after commenting out "check_compile_time()" calls and adding appropriate casts to the casting errors, the second errors I get:
:-1: error: Undefined symbols for architecture arm64: "_CFHostScheduleWithRunLoop", referenced from: -[SimplePing start] in SimplePing.o "_CFHostUnscheduleFromRunLoop", referenced from: -[SimplePing _stopHostResolution] in SimplePing.o "_CFHostSetClient", referenced from: -[SimplePing start] in SimplePing.o -[SimplePing _stopHostResolution] in SimplePing.o "_CFHostStartInfoResolution", referenced from: -[SimplePing start] in SimplePing.o "_CFHostCreateWithName", referenced from: -[SimplePing start] in SimplePing.o "_kCFErrorDomainCFNetwork", referenced from: -[SimplePing _didFailWithHostStreamError:] in SimplePing.o -[SimplePing _hostResolutionDone] in SimplePing.o "_kCFGetAddrInfoFailureKey", referenced from: -[SimplePing _didFailWithHostStreamError:] in SimplePing.o "_CFHostGetAddressing", referenced from: -[SimplePing _hostResolutionDone] in SimplePing.o "_kCFStreamErrorDomainNetDB", referenced from: -[SimplePing _didFailWithHostStreamError:] in SimplePing.o
-
You are not linking the CFNetwork framework.