diff --git a/Ifish/Info.plist b/Ifish/Info.plist index 4ec6c1c..e0c4307 100644 --- a/Ifish/Info.plist +++ b/Ifish/Info.plist @@ -70,7 +70,7 @@ CFBundleVersion - 493 + 494 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/RestartViewController.m b/Ifish/controllers/IfishTabControllers/我的/mineControllers/RestartViewController.m index 5b871cc..16d7780 100644 --- a/Ifish/controllers/IfishTabControllers/我的/mineControllers/RestartViewController.m +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/RestartViewController.m @@ -36,4 +36,8 @@ [self.view makeToast:@"设备即将重启"]; } +- (void)udpHelperMessage:(NSString *)msg { + [self.view makeToast:msg]; +} + @end diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.m b/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.m index f6de97c..4006d3f 100644 --- a/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.m +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.m @@ -37,4 +37,8 @@ [self.view makeToast:@"设备即将重置"]; } +- (void)udpHelperMessage:(NSString *)msg { + [self.view makeToast:msg]; +} + @end diff --git a/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.m b/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.m index f5c1e69..645307c 100644 --- a/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.m +++ b/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.m @@ -13,6 +13,7 @@ #import "IFishHotpotUDPHelper.h" #import "ESPTouchResult.h" #import "ESPTouchTask.h" +#import "IfishDataUnity.h" @interface ConnectHotpotViewController () @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; @@ -244,6 +245,7 @@ -(void)bindDeviceWithSsid:(NSString*)bssid{ NSLog(@"设备bssid_%@",bssid); NSString *userId = [dataContorl dataControlGetUserIdInfo]; + [self.view makeToast:[NSString stringWithFormat:@"正在绑定设备,bssid:%@", bssid]]; [AFHttpTool bindDeviceWithUserId:userId macAddress:bssid success:^(id response) { NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil]; NSLog(@"data:%@",resultDic[@"data"]); @@ -270,6 +272,9 @@ [self showTitle:@"" messsage:@"设备不在服务器"]; }else{ + [self.view makeToast:@"设备绑定成功"]; + [[IfishDataUnity shareDataInstance] initAppCenterVcWith:devicemodel addWithdissMisVc:nil]; + //绑定成功 加 经验值 [[IfishUserObsever sharedInstance] xinZengJingYanZhi:IFISHADDEXP_BIDDEVICE addType:IFISHADDEXPTYPE1]; } @@ -287,6 +292,7 @@ }else if ([resultDic[@"result"] isEqualToString:@"302"]){ // 请求被舍弃未执行 self.bakbutton.userInteractionEnabled=YES; + [self.view makeToast:@"绑定失败"]; } diff --git a/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m index 2272c0d..6ec422e 100644 --- a/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m +++ b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m @@ -13,6 +13,8 @@ #import "ResetDeviceModel.h" #import "RestartDeviceModel.h" +#define K_ReSendTimeInterval 5 + @interface IFishHotpotUDPHelper () { NSString * _ssidName; @@ -37,11 +39,13 @@ - (void)broadCastHotspotConnectCommandWith:(NSString *)ssidName pwd:(NSString *)pwd { _ssidName = ssidName; _pwd = pwd; - self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(sendConnectHotspotSoketdata) userInfo:nil repeats:YES]; + [self postmsg:@"命令已发出"]; + self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:K_ReSendTimeInterval target:self selector:@selector(sendConnectHotspotSoketdata) userInfo:nil repeats:YES]; } - (void)broadCastRestCommand { - self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(sendRestSocketData) userInfo:nil repeats:YES]; + [self postmsg:@"命令已发出"]; + self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:K_ReSendTimeInterval target:self selector:@selector(sendRestSocketData) userInfo:nil repeats:YES]; } - (void)sendRestSocketData { @@ -70,7 +74,8 @@ } - (void)broadCastRestartCommand { - self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(sendRestartSocketData) userInfo:nil repeats:YES]; + [self postmsg:@"命令已发出"]; + self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:K_ReSendTimeInterval target:self selector:@selector(sendRestartSocketData) userInfo:nil repeats:YES]; } @@ -129,12 +134,7 @@ -(BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port { - NSString* result; - - result = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; - - NSLog(@"didReceiveData%@",result); - NSLog(@"port%hu",port); + NSString* result = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; IFishUDPHelperBackMsgModel *model = [[IFishUDPHelperBackMsgModel alloc] initWithData:data]; if ([model.result isEqualToString:@"01"]) { if ([self.delegate respondsToSelector:@selector(udpHelperCommandExecutedSuccess:)]) {