Преглед изворни кода

1.偶现恢复出厂设置不成功问题

huangxiaodong пре 1 година
родитељ
комит
0468f9faa6

+ 2 - 2
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -2790,7 +2790,7 @@
 				ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 11;
+				CURRENT_PROJECT_VERSION = 13;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2869,7 +2869,7 @@
 				ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 11;
+				CURRENT_PROJECT_VERSION = 13;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 1 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/view/downloadFileBottomView.m

@@ -38,6 +38,7 @@
         diskfreeSpace = freeSpace;
     }
      NSString *str = [NSString stringWithFormat:@"%0.2f GB",freeSpace/1024.0/1024.0/1024.0];
+    //NSString *str11 = [NSString stringWithFormat:@"%0.2f GB",freeSpace/1000.0/1000.0/1000.0];
     return str;
 }
 

+ 1 - 0
创维盒子/双子星云手机/CloudPlayer/Model/commandSendCheckModel.h

@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString * commandStr;//发送指令
 @property (nonatomic, copy) NSString * type;//类型
 @property (nonatomic, assign) long  sendTimerStamp;//发送的时间戳
+@property (nonatomic, assign) NSInteger  reSendNum;//重发次数
 @end
 
 NS_ASSUME_NONNULL_END

+ 1 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.h

@@ -37,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)handleDownloadResponseFunBy:(id)message;
 
 - (void)checkAllTaskFun;
+- (void)deleteCommandSendTaskFunWith:(NSString*)type;
 - (void)getExtraFilesResponseFun:(NSDictionary *)dataDict;
 - (void)saveLastImageFun;
 - (void)readLastImageFun;

+ 33 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

@@ -23,6 +23,7 @@
 #import "cachesFileManager.h"
 #import "extraMediaEventModel.h"
 #import "USBInsertPopView.h"
+#import "commandSendCheckModel.h"
 
 @implementation PlayerViewController (otherDelegate)
 
@@ -381,6 +382,38 @@
     
     [[uploadFileManager shareInstance] checkReUploadFileFun];
     [[downloadManager shareInstance] checkReDownloadFileFun];
+    
+    [self checkCommandSendTaskFun];
+}
+
+-(void)checkCommandSendTaskFun
+{
+    if(commandSendCheckArr && commandSendCheckArr.count >0){
+        for (commandSendCheckModel *model in commandSendCheckArr) {
+            if(model.reSendNum < 3){
+                model.reSendNum ++;
+                if(model.commandStr){
+                    [self send_data:model.commandStr];
+                    
+                    HLog(@"\n\n\n任务重发 重发次数:%ld 指令:%@\n\n\n",model.reSendNum,model.commandStr);
+                }
+            }
+        }
+    }
+}
+
+-(void)deleteCommandSendTaskFunWith:(NSString*)type
+{
+    if(commandSendCheckArr && commandSendCheckArr.count >0){
+        
+        NSArray *taskArr = [NSArray arrayWithArray:commandSendCheckArr];
+        
+        for (commandSendCheckModel *model in taskArr) {
+            if([type isEqualToString:model.type]){
+                [commandSendCheckArr removeObject:model];
+            }
+        }
+    }
 }
 
 - (void)getExtraFilesResponseFun:(NSDictionary *)dataDict

+ 1 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.h

@@ -57,6 +57,7 @@
     
     UIView *wattingView;
     USBInsertPopView *curUSBInsertPopV;
+    NSMutableArray *commandSendCheckArr;//需要检测任务是否发出的的指令
 }
 
 @property(copy,nonatomic)NSString * _Nullable internetVideoPort;

+ 18 - 1
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm

@@ -124,7 +124,6 @@ ComontAlretViewControllerDelegate>
     
     int preIFrameNum;
     
-    NSMutableArray *commandSendCheckArr;//需要检测任务是否发出的的指令
 }
 @property (nonatomic, strong, nullable) RCVideoRecoderManager *recoderManager;
 @property (nonatomic, strong, nullable) RCAudioRecoderMamager *audioRecoderMamager;
@@ -368,6 +367,8 @@ ComontAlretViewControllerDelegate>
         
         self.didRecyclResource = YES;
         
+        [commandSendCheckArr removeAllObjects];
+        commandSendCheckArr = nil;
         // 销毁定时器
         [self cancelTimer];
         
@@ -788,6 +789,10 @@ ComontAlretViewControllerDelegate>
                 [weakSelf getExtraMediaEventResponseFun:dataDict];
                 [weakSelf getExtraFilesListFun];
             }
+            else if ([messageType isEqualToString:@"reset"]){/**/
+                [weakSelf deleteCommandSendTaskFunWith:@"reset"];
+            }
+            
         } failure:^(NSError *error) {
             [self showNetErrorAlertFun:2];
         }];
@@ -1643,6 +1648,18 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
     //最后一帧 没显示正在重启问题
     //self->_canShowImgAndVoiceType = YES;
     _isResetingType = YES;
+    
+    //添加到任务监听
+    commandSendCheckModel *model = [commandSendCheckModel new];
+    model.commandStr = commondStr;
+    model.type = @"reset";
+    model.reSendNum = 0;
+    model.sendTimerStamp = [iTools getNowTimeStamp];
+    
+    if(commandSendCheckArr){
+        [commandSendCheckArr addObject:model];
+    }
+    
 }
 
 #pragma mark 启动timer 秒后检查是否软件重启成功