From b15f10afe2d56160cdd95a0f20087fd26b5955d9 Mon Sep 17 00:00:00 2001 From: kai60 Date: Wed, 6 May 2020 11:15:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=92=E6=B8=A9=E6=98=BE=E7=A4=BA=E6=95=B0?= =?UTF-8?q?=E5=80=BC=E4=BF=AE=E6=94=B9=E5=92=8C=E6=99=BA=E8=83=BD=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E8=8E=B7=E5=8F=96wifi=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XuTo/Xuanduo2fController.m | 4 ++-- .../YooseeNextConnectViewController.mm | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m index dc0c055..d07293c 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m @@ -279,8 +279,8 @@ UInt64 mac1=[dataContorl hexToTen:_cycleModel.lastTime]; //float TPlabel=mac/10+(mac%10)*0.1; - float temp1 = mac1/10.0; - NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp1]; + float temp1 = mac1; + NSString *stringTemp = [NSString stringWithFormat:@"%f℃",temp1]; UIImage*uvNomal=[UIImage imageNamed:@"杀菌关"]; uvNomal=[uvNomal imageWaterMarkWithString:stringTemp rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}]; [self.light1 setImage:uvNomal forState:UIControlStateNormal]; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm index d1b0318..cddae8f 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm @@ -323,6 +323,12 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 [alert show]; return; } + if ([self.wifiName.uppercaseString isEqualToString:@"WLAN"]) { + UIAlertView *alert= [[UIAlertView alloc] initWithTitle:@"" message:@"获取到的WiFi无效" delegate:nil cancelButtonTitle:@"重试" otherButtonTitles:nil, nil]; + alert.tag=3; + [alert show]; + return; + } BOOL isRight =[dataContorl isIncludeSpecialCharact:self.wifiSecFiled.text]; if (!isRight) { @@ -396,8 +402,8 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 */ - (void)p2pDeviceLinker:(GWP2PDeviceLinker *)linker deviceLinkSuccess:(NSDictionary *)deviceDict { -// NSLog(@"扫描到设备"); -// [self deviceLinkin:deviceDict linkType:self.conectType]; + NSLog(@"扫描到设备"); + [self deviceLinkin:deviceDict linkType:self.conectType]; } -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ @@ -440,6 +446,10 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 } } + }//重试wifi + else if (alertView.tag==3){ + + [self initComponent]; } } @@ -454,7 +464,7 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 //AP配网时有值 smart没有值 if ([self.deviceID isEqualToString:deviceID]||self.deviceID==nil) { - self.isDeviceLinkIn = YES; + self.isDeviceLinkIn = YES; if (type==conectType_Intelligent) { [self.view makeToast:@"声波配网成功"]; @@ -463,8 +473,10 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 else { [self.view makeToast:@"AP配网成功"]; - [[GWP2PDeviceLinker shareInstance] p2pStopAPLink]; } - + [[GWP2PDeviceLinker shareInstance] p2pStopAPLink]; + + } + // NSString *devicePassword = deviceDict[@"devicePassword"]; self.deviceID = deviceID; @@ -547,6 +559,7 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 WEAK_SELF; [[GWP2PDeviceLinker shareInstance] p2pStopSmartLink]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(100 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [[GWP2PDeviceLinker shareInstance] p2pStopSmartLink]; [self deviceLinkinTimeout:self.conectType]; }); [[GWP2PDeviceLinker shareInstance] p2pSmartLinkDeviceWithWiFiSSID:weakSelf.wifiName password:weakSelf.wifiPwd useSimpleConfig:YES deviceLinkIn:^(NSDictionary *deviceDict) {