Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. iOS Check if WiFi ip is accessible (ping)
Forum Updated to NodeBB v4.3 + New Features

iOS Check if WiFi ip is accessible (ping)

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 332 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Augustas
    wrote on last edited by Augustas
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      You are not linking the CFNetwork framework.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Which exact error do you get ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Augustas
          wrote on last edited by Augustas
          #3

          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
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            You are not linking the CFNetwork framework.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved