WTWifiSDK 是一个用于 alphaesswifi 配置的 Framework。
WTWifiSDK 的系统要求是 iOS 11.0+
pod 'WTWifiSDK'
-
#import "WTWifiSDK/WTWifiCenter.h"
-
使用
WTWifiCenterDelegate
添加或删除代理,例如[[WTWifiCenter sharedInstance] addDelegate:self]; [[WTWifiCenter sharedInstance] removeDelegate:self];
-
当配置视图出现时开始配置 wifi,在视图析构时停止 wifi 配置,例如
[[WTWifiCenter sharedInstance] startConfiguration]; [[WTWifiCenter sharedInstance] releaseConfiguration];
-
从 wifi 收集设备中获取 wifi ssid 列表,例如
[[WTWifiCenter sharedInstance] fetchWifiList:^(NSArray * _Nullable list, NSError * _Nullable error) { self.ssids = list; [self.tableview reloadData]; }];
-
如果您想配置能量存储设备的本地WiFi,请使用此API
[[WTWifiCenter sharedInstance] wifiConfigurationWith:ssid password:password completionHandler:^(bool result, NSError * _Nullable error) { bool success = result && !error; if (success) { // Congratulations! you're successed! } }];
-
如果您想查看历史配置,请使用如下API:
[[WTWifiCenter sharedInstance] loadWifiConfiguration:^(NSDictionary * _Nullable result, NSError * _Nullable error) { bool success = result && !error; if (success) { // Congratulations! you're successed! } }];
-
如何加载能源管理系统的系统信息?
第一步
向能量存储设备发送EMS命令来查询系统信息。
[[WTWifiCenter sharedInstance] sendSystemInfoCommand];
第二步
结果将通过WTWifiCenterDelegate中的[didReceiveEMSSystemInfo]方法返回。但请注意,这不是一个很稳定的回调,您可以在确保直接连接成功后尝试多次发送命令。
- (void)didReceiveEMSSystemInfo:(WTSystemModel *)info { // Congratulations! you're successed if the info not nil. }
-
如何加载能源管理系统的运行信息?
第一步
向能量存储设备发送EMS命令来查询运行信息。
[[WTWifiCenter sharedInstance] sendRunningInfoCommand];
第二步
结果将通过WTWifiCenterDelegate中的[didReceiveEMSRunningInfo]方法返回。但请注意,这不是一个很稳定的回调,您可以在确保直接连接成功后尝试多次发送命令。
- (void)didReceiveEMSRunningInfo:(WTSystemModel *)info { // Congratulations! you're successed if the info not nil. }
-
如何加载能源管理系统的安全信息?
第一步
向能量存储设备发送EMS命令来查询安全信息。
[[WTWifiCenter sharedInstance] sendSafetyInfoCommand];
第二步
结果将通过WTWifiCenterDelegate中的[didReceiveEMSSafetyInfo]方法返回。但请注意,这不是一个很稳定的回调,您可以在确保直接连接成功后尝试多次发送命令。
- (void)didReceiveEMSSafetyInfo:(WTSystemModel *)info { // Congratulations! you're successed if the info not nil. }
-
最后一个问题,如何带参数配置能量存储设备?
WTUpdateModel *update = [[WTUpdateModel alloc] init]; update.ACDC = @"3"; update.CTRate = @"1"; update.GridMeterCTE = @"0"; update.Meter_CT_Select = @"2"; update.OnGridCap = @"5000"; update.ReliefMode = @"1"; update.SafetyType = @"25"; update.SelfUseOrEconomic = @"0"; update.VPPMode = @"1"; [[WTWifiCenter sharedInstance] updateEMSConfigurationWith:update];
注意
当配置成功时,将调用代理方法[didUpdateEMSParametersSuccess]。否则,将调用代理方法[didUpdateEMSParametersFailed]。
问题
如果您对SDK有任何疑问,我们欢迎您提交问题。但请您在提交问题时,尽可能清晰地描述问题重演场景,以便我们更高效地帮助您解决问题。
特性
我们将致力于实现更稳定的版本。