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. Detecting WiFi network
Forum Updated to NodeBB v4.3 + New Features

Detecting WiFi network

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
25 Posts 8 Posters 9.0k Views 3 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.
  • dheerendraD Offline
    dheerendraD Offline
    dheerendra
    Qt Champions 2022
    wrote on last edited by
    #21

    Did you solve this issue using native APIs ?

    Dheerendra
    @Community Service
    Certified Qt Specialist
    http://www.pthinks.com

    1 Reply Last reply
    0
    • ashajgA Offline
      ashajgA Offline
      ashajg
      wrote on last edited by
      #22

      Hi sir @dheerendra
      sorry for late reply..
      I didn't tried with native APIs.
      But when I am trying the above code with Android device I am getting this output
      CODE:

      QStringList WiFisList;
      QNetworkConfiguration cfg;
      QNetworkConfigurationManager ncm;
      auto nc = ncm.allConfigurations();
          for (auto &x : nc)
          {
              qDebug()<< "CHECK1  " << x.bearerType();
              if (x.bearerType() == QNetworkConfiguration::BearerWLAN)
             {  qDebug ()<<"CHECK2";
                qDebug() <<"WIFI is"<<x.name();
             }
      

      OUTPUT:

      D libWiFi.so: ..\AshishTest\main.cpp:19 (int main(int, char**)): CHECK1   1
      D libWiFi.so: ..\AshishTest\main.cpp:19 (int main(int, char**)): CHECK1   2
      D libWiFi.so: ..\AshishTest\main.cpp:21 (int main(int, char**)): CHECK2
      D libWiFi.so: ..\AshishTest\main.cpp:22 (int main(int, char**)): WIFI is "Mobile"
      D libWiFi.so: ..\AshishTest\main.cpp:19 (int main(int, char**)): CHECK1   2
      D libWiFi.so: ..\AshishTest\main.cpp:21 (int main(int, char**)): CHECK2
      D libWiFi.so: ..\AshishTest\main.cpp:22 (int main(int, char**)): WIFI is "WiFi"
      D libWiFi.so: ..\AshishTest\main.cpp:19 (int main(int, char**)): CHECK1   7
      

      For android device it is entering inside if (x.bearerType() == QNetworkConfiguration::BearerWLAN) as it is printing check2.
      just the problem is that output is WIFI is "WiFi" instead of wifi name I am getting "WiFi" as output . Is something missing in my code?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SAMJOSEPH
        Banned
        wrote on last edited by SAMJOSEPH
        #23
        This post is deleted!
        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mohan1997
          wrote on last edited by
          #24

          Seems i am having also same issue .

          when i am printing x.bearerTypename i am having the name of interface only.
          not getting all SSID names in the list.
          can anyone help me here.

          1 Reply Last reply
          0
          • guerinoniG Offline
            guerinoniG Offline
            guerinoni
            wrote on last edited by
            #25

            @Mohan1997
            On Android is not support, you need to implement it with AndroidExtras and calling directly java class

            1 Reply Last reply
            0

            • Login

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