|
|
@@ -83,6 +83,17 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
|
|
|
_isGetThridMsgType = YES;
|
|
|
KWeakSelf
|
|
|
[[netWorkManager shareInstance] CommonGetWithCallBackCode:getThirdIdBySn Parameters:paraDict success:^(id _Nonnull responseObject) {
|
|
|
+
|
|
|
+ if(!needReconnect){
|
|
|
+ NSError *parseError;
|
|
|
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject:responseObject options:NSJSONWritingPrettyPrinted error:&parseError];
|
|
|
+ if (parseError) {
|
|
|
+ //解析出错
|
|
|
+ }
|
|
|
+ NSString * str = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
|
|
+ [cachesFileManager writeLogsWithMsg:str];
|
|
|
+ }
|
|
|
+
|
|
|
self->_isGetThridMsgType = NO;
|
|
|
DeviceThirdIdModel *model = [[DeviceThirdIdModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
|
|
|
@@ -362,6 +373,15 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
|
|
|
- (void)tryReconnectFun{
|
|
|
|
|
|
[cachesFileManager writeLogsWithMsg:@"tryReconnect"];
|
|
|
+
|
|
|
+ [cachesFileManager writeLogsWithMsg:@"click again try Net Work"];
|
|
|
+
|
|
|
+ [self getThridMsgBySN:self.DeviceThirdIdMod.data.changeSn needReconnect:NO didNetEnd:^(NSInteger didSuc) {
|
|
|
+
|
|
|
+ NSString *tip = [[NSString alloc] initWithFormat:@"Net Work state:%ld",didSuc];
|
|
|
+ [cachesFileManager writeLogsWithMsg:tip];
|
|
|
+ }];
|
|
|
+
|
|
|
if(!disconnected_cb_type){
|
|
|
[cachesFileManager writeLogsWithMsg:@"tryReconnect return"];
|
|
|
return;
|
|
|
@@ -415,15 +435,15 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
|
|
|
|
|
|
//音视频 链接返回-5的时候调用
|
|
|
- (void)recreateHttpServiceFun{
|
|
|
-// [cachesFileManager writeLogsWithMsg:@"recreateHttpServiceFun"];
|
|
|
-// NSString *sdnId = self.DeviceThirdIdMod.data.sdnId;
|
|
|
-// [RaylinkProxy.sharedManager closeHttpService:sdnId];
|
|
|
-//
|
|
|
-//
|
|
|
-// self.tcpPort = [RaylinkProxy.sharedManager createHttpService:sdnId];
|
|
|
-// self.tcpPortStr = [[NSString alloc] initWithFormat:@"%ld",self.tcpPort];
|
|
|
-// [RaylinkProxy.sharedManager addSdnId:sdnId allowPort:9300];
|
|
|
-// [RaylinkProxy.sharedManager addSdnId:sdnId allowPort:9100];
|
|
|
+ [cachesFileManager writeLogsWithMsg:@"recreateHttpServiceFun"];
|
|
|
+ NSString *sdnId = self.DeviceThirdIdMod.data.sdnId;
|
|
|
+ [RaylinkProxy.sharedManager closeHttpService:sdnId];
|
|
|
+
|
|
|
+
|
|
|
+ self.tcpPort = [RaylinkProxy.sharedManager createHttpService:sdnId];
|
|
|
+ self.tcpPortStr = [[NSString alloc] initWithFormat:@"%ld",self.tcpPort];
|
|
|
+ [RaylinkProxy.sharedManager addSdnId:sdnId allowPort:9300];
|
|
|
+ [RaylinkProxy.sharedManager addSdnId:sdnId allowPort:9100];
|
|
|
|
|
|
}
|
|
|
|