qtwifiblackberry-10ipv4blackberry-cascades

QT Blackberry 10 cascades get WIFI IPv4 address programmatically


I required IPv4 address of my blackberry device of WIFI which it is connected.

The IPv4 address which is displayed in Settings -> About -> Category Network => WIFI

The same address I have to access programmatically.


Solution

  • From the documentation, the Wifi service is only available in C.

    If you don't want to deal with C, I think that reading the file mentionned down below with PPS and mixing default_gateway first entry with fib should give you the correct IPv4, but I'm not sure as I don't know much about networking lingo.

    /pps/services/networking/all/status_public

    You'll find many many example on how to read files with PPS on my GitHub or in the official documentation.