10

I am using following code to fetch the connected WIFI with my ios device. I want to know what data does SSIDDATA contains and how to read this data.

    -(id)fetchSSIDInfo
    {
    NSArray *ifs = (__bridge NSArray *)(CNCopySupportedInterfaces());
    NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
    id info = nil;
        for (NSString *ifnam in ifs) {
        info = (__bridge id)(CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam));
        NSLog(@"%s: %@ => %@", __func__, ifnam, info);
        if (info && [info count]) {
            break;
        }
        }
    return info;
}
Nikita Pestrov
  • 5,876
  • 4
  • 31
  • 66
Dinesh
  • 929
  • 7
  • 25

1 Answers1

7

SSIDDATA is the hex representation of the SSID. Nothing else, as far as i know.

Nikita Pestrov
  • 5,876
  • 4
  • 31
  • 66
  • Not sure but why someone wants to add the same info in hexadecimal format which they already added in str format. I want to find out the signal strength of my conneted wifi.. Is there any way of doing this ? – Dinesh Nov 01 '13 at 08:38
  • 1
    According to this info — no. Just try to unhex that and see what that really is. The signal strength is not a public API, check this question out http://stackoverflow.com/questions/4954389/programatically-measuring-carriers-signal-strength-in-iphone-device – Nikita Pestrov Nov 01 '13 at 08:41
  • I checked that coretelephony API as well but it only returns signal strength of GSM signal and not of wifi and it seems like when sim is not there it shows the last signal stregth of the SIM which is more annoying.. – Dinesh Nov 01 '13 at 09:09
  • @Dinesh, If the SSID can not be encoded as a valid UTF-8 or WinLatin1 string, it will be `null` ([source](https://developer.apple.com/documentation/corewlan/cwnetwork/1512318-ssid)). So in that case SSIDDATA could be used to determine the actual SSID. – wovano Feb 26 '20 at 12:40