|
@@ -55,9 +55,11 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
|
|
|
|
|
|
|
|
|
#pragma mark 根据扫码的sn获取第三方信息
|
|
|
--(void)getThridMsgBySN:(NSString*)snStr didNetEnd:(netWork_DidEndByOK)didNetEndIsOK
|
|
|
+-(void)getThridMsgBySN:(NSString*)snStr needReconnect:(BOOL)needReconnect didNetEnd:(netWork_DidEndByOK)didNetEndIsOK
|
|
|
{
|
|
|
- _curConnectDeviceState = DeviceConnectGetThridMsging;
|
|
|
+ if(needReconnect){
|
|
|
+ _curConnectDeviceState = DeviceConnectGetThridMsging;
|
|
|
+ }
|
|
|
|
|
|
NSMutableDictionary *paraDict = [NSMutableDictionary new];
|
|
|
[paraDict setValue:snStr forKey:@"sn"];
|
|
@@ -74,7 +76,6 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
|
|
|
if(weakSelf.DeviceThirdIdMod.status == 0
|
|
|
&& weakSelf.DeviceThirdIdMod.data)
|
|
|
{
|
|
|
- weakSelf.curConnectDeviceState = DeviceConnectGetThridOK;
|
|
|
|
|
|
NSString*desPwdstr = [RSATool AES128Decrypt:weakSelf.DeviceThirdIdMod.data.password key:AESCODEKEEYY];
|
|
|
|
|
@@ -86,10 +87,15 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
|
|
|
[dict setObject:desPwdstr forKey:Const_Have_Add_Device_PWD];
|
|
|
[HWDataManager setObjectWithKey:Const_Have_Add_Device value:dict];
|
|
|
|
|
|
+ //
|
|
|
+ bool connected = [RaylinkProxy.sharedManager isSdnConnected];
|
|
|
+ if(!connected || needReconnect){
|
|
|
+ weakSelf.curConnectDeviceState = DeviceConnectGetThridOK;
|
|
|
+ NSString *ipStr = weakSelf.DeviceThirdIdMod.data.ip;
|
|
|
+ [weakSelf startPingDeviceIp:ipStr];
|
|
|
+ [weakSelf initRuiyunSDKFun];
|
|
|
+ }
|
|
|
|
|
|
- NSString *ipStr = weakSelf.DeviceThirdIdMod.data.ip;
|
|
|
- [weakSelf startPingDeviceIp:ipStr];
|
|
|
- [weakSelf initRuiyunSDKFun];
|
|
|
}
|
|
|
else{
|
|
|
didNetEndIsOK(NO);
|