//
//  NSDictionary+WiFiInfo.m
//  SmartLightForBigFish
//
//  Created by coderYK on 2017/8/11.
//  Copyright © 2017年 RD-iOS. All rights reserved.
//

#import "NSDictionary+WiFiInfo.h"
#import <SystemConfiguration/CaptiveNetwork.h>

@implementation NSDictionary (WiFiInfo)

+ (NSDictionary *)rds_fetchSSIDInfo {
    
    NSArray *ifs = (__bridge_transfer NSArray *)CNCopySupportedInterfaces();
    if (!ifs) { return nil; }
    NSDictionary *info = nil;
    for (NSString *ifnam in ifs) {
        info = (__bridge_transfer NSDictionary *)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
        if (info && [info count]) { break; }
    }
    return info;
}

@end
