|
|
@@ -36,7 +36,7 @@ WHPingDelegate
|
|
|
|
|
|
@property (nonatomic, assign) NSInteger tcpPort;
|
|
|
|
|
|
-
|
|
|
+@property (nonatomic, copy) NSString *Pre_sdnId;//上一个sdn好
|
|
|
@end
|
|
|
|
|
|
@implementation connectDeviceManager
|
|
|
@@ -59,6 +59,13 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
|
|
|
{
|
|
|
if(needReconnect){
|
|
|
_curConnectDeviceState = DeviceConnectGetThridMsging;
|
|
|
+
|
|
|
+ //更换设备
|
|
|
+ NSString *curSdnId = self.DeviceThirdIdMod.data.sdnId;
|
|
|
+ if(curSdnId){
|
|
|
+ _Pre_sdnId = curSdnId;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
NSMutableDictionary *paraDict = [NSMutableDictionary new];
|
|
|
@@ -228,7 +235,12 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
|
|
|
}
|
|
|
|
|
|
- (void)disconnect {
|
|
|
+
|
|
|
NSString *curSdnId = self.DeviceThirdIdMod.data.sdnId;
|
|
|
+ if(_Pre_sdnId){
|
|
|
+ curSdnId = _Pre_sdnId;
|
|
|
+ }
|
|
|
+
|
|
|
if(curSdnId){
|
|
|
[RaylinkProxy.sharedManager closeConnection:curSdnId];
|
|
|
[RaylinkProxy.sharedManager closeHttpService:curSdnId];
|