字节鉴权优化,只需获取一次,断开连接后清除鉴权 Weisheng
authorliangzhenying <867174124@qq.com>
Mon, 26 May 2025 02:22:58 +0000 (10:22 +0800)
committerliangzhenying <867174124@qq.com>
Mon, 26 May 2025 02:22:58 +0000 (10:22 +0800)
MouseSdk/AiMouseSdk/AiMouseSdk/AiMouseSdk.m
MouseSdk/AiMouseSdk/ByteDance/ByteDanceSdk.m
MouseSdk/AiMouseSdk/Manager/DeviceManger.h
MouseSdk/AiMouseSdk/Manager/DeviceManger.m
MouseSdk/AiMouseSdk/Manager/HidManager.h
MouseSdk/AiMouseSdk/Manager/HidManager.m
MouseSdk/MouseSdk/ViewController.m

index aada5f2..758273b 100644 (file)
                 [ws switchConnect:ws.connectType isConnected:false];
                 return;
             }
-            //            if (([DeviceManger shared].appType == 2 || [DeviceManger shared].appType == 4) ) {
-            //                [[ByteDanceSdk shared] startAuth:^(ByteDanceInfo *info) {
-            //                    deviceInfo.byteAuthInfo = info;
-            //                    [ws showLog:deviceInfo.description];
-            //                }];
-            //            }
             dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                 if([ws.delegate respondsToSelector:@selector(aiMouseConnectStateDidChange:)]) [ws.delegate aiMouseConnectStateDidChange:ws.connected];
                 if(ws.delegate) [ws.delegate aiMouseAuthenticationResult:true];
index 9fa3d73..fff141c 100644 (file)
 
 - (void)startAuth:(void (^)(ByteDanceInfo *info,NSError *error))complete{
     self.byteDanceAuthInfoCallback = complete;
+    
+    if (self.info.urlParams && self.info.expireTime && self.info.token && self.info.host) {
+        if(self.byteDanceAuthInfoCallback){
+            self.byteDanceAuthInfoCallback(self.info,nil);
+        }
+        return;
+    }
+    
     self.info = [[ByteDanceInfo alloc] init];
     stb_app_start_identify();
     [self performSelector:@selector(timeOutAction) withObject:nil afterDelay:5];
@@ -72,7 +80,7 @@
 }
 - (void)disconnected{
 //    stb_app_deinit();
-    
+    self.info.token = nil;
 }
 
 #pragma mark - ByteDance
index 577bbd9..5ddd69c 100644 (file)
@@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
 +(DeviceManger *)shared;
 
 /// 初始化sdk
-/// - Parameter appType: app类型  2
+/// - Parameter appType: app类型  1威鼠不鉴权;2威鼠字节鉴权;3千寻不鉴权;4千寻字节鉴权
 - (void)initSdk:(int)appType;
 
 ///当前设置的连接类型:@"0"表示蓝牙;@"1"表示USB;
index b31b725..68ba5be 100644 (file)
@@ -32,6 +32,7 @@
 @property (nonatomic,strong) M8MouseSdk *m8Sdk;
 @property (nonatomic,assign) AiMouseProductType productType;
 @property (nonatomic,strong)void (^authCallBack)(BOOL isSuccess);/// 鉴权回调
+@property (nonatomic, assign)NSInteger retryTimes;//重试次数
 
 //connectType 返回为0代表蓝牙,为1代表usb
 @property (nonatomic, copy)void (^aiMouseConnectStateDidChangeCallBack)(int connectType, BOOL connected);/// 设备连接状态回调
@@ -51,7 +52,7 @@
 - (instancetype)init{
     self = [super init];
     if (self) {
-        self.version = @"MouseSdk_v2025052202";
+        self.version = @"MouseSdk_v2025052401";
     }
     return self;
 }
 //            [self.hid close];
         }
         else{
-            [self.ble open];
-            [self.hid open];
+//            [self.ble open];
+            if (self.retryTimes < 5) {
+                [self.hid open];
+            }
+            else{
+                if (self.hid.isOpen) {
+                    if (self.hid.productType == AiMouseProductType_n) {
+                        [self.nSdk switchConnect:AiMouseConnectType_hid isConnected:true];
+                    }
+                    else if (self.hid.productType == AiMouseProductType_tlw) {
+                        [self.tlwSdk switchConnect:AiMouseConnectType_hid isConnected:true];
+                    }
+                    else if (self.hid.productType == AiMouseProductType_frk){
+                        [self.frkSdk switchConnect:AiMouseConnectType_hid isConnected:true];
+                    }
+                    else if (self.hid.productType == AiMouseProductType_keyboard){
+                        [self.kbSdk switchConnect:AiMouseConnectType_hid isConnected:true];
+                    }
+                    else if (self.hid.productType == AiMouseProductType_m8){
+                        [self.m8Sdk switchConnect:AiMouseConnectType_hid isConnected:true];
+                    }
+                }
+                else{
+                    [self.hid open];
+                }
+            }
         }
     };
 }
 ///获取设备信息
 - (void)getDeviceInfo:(void (^)(AiMouseDeviceInfo *deviceInfo,NSError *error))finished{
     [self showLog:@"app主动获取设备信息 。。。"];
+    __weak typeof(self) ws = self;
     if(self.productType == AiMouseProductType_keyboard){
-        [self.kbSdk getDeviceInfo:finished];
+        [self.kbSdk getDeviceInfo:^(AiMouseDeviceInfo *deviceInfo, NSError *error) {
+            finished(deviceInfo,error);
+            [ws checkedDisconect:error];
+        }];
     }
     else if(self.productType == AiMouseProductType_n){
-        [self.nSdk getDeviceInfo:finished];
+        [self.nSdk getDeviceInfo:^(AiMouseDeviceInfo *deviceInfo, NSError *error) {
+            finished(deviceInfo,error);
+            [ws checkedDisconect:error];
+        }];
     }else if (self.productType == AiMouseProductType_tlw) {
-        [self.tlwSdk getFullDeviceInfo:finished];
+        [self.tlwSdk getFullDeviceInfo:^(AiMouseDeviceInfo *deviceInfo, NSError *error) {
+            finished(deviceInfo,error);
+            [ws checkedDisconect:error];
+        }];
     }
     else if (self.productType == AiMouseProductType_m8) {
-        [self.m8Sdk getFullDeviceInfo:finished];
+        [self.m8Sdk getFullDeviceInfo:^(AiMouseDeviceInfo *deviceInfo, NSError *error) {
+            finished(deviceInfo,error);
+            [ws checkedDisconect:error];
+        }];
     }
     else{
-        [self.frkSdk getDeviceInfo:finished];
+        [self.frkSdk getDeviceInfo:^(AiMouseDeviceInfo *deviceInfo, NSError *error) {
+            finished(deviceInfo,error);
+            [ws checkedDisconect:error];
+        }];
+    }
+}
+
+- (void)checkedDisconect:(NSError *)error{
+    if (error == nil) {
+        self.retryTimes = 0;
     }
+    self.retryTimes++;
 }
 
 /// 获取信号强度
index 6b32010..9ef0872 100644 (file)
@@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy)void (^receiveInfoDataCallBack)(NSData *data);/// 设备信息数据回调
 @property (nonatomic, copy)void (^logCallBack)(NSString *log);//输出日志
 
-@property (nonatomic, assign)AiMouseProductType productType;//
+@property (nonatomic, assign)AiMouseProductType productType;
+@property (nonatomic, assign)BOOL isOpen;
 
 +(HidManager *)shared;
 
index a0237df..76ebd50 100644 (file)
@@ -50,7 +50,7 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
     uint32_t vid = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDVendorIDKey));
     uint32_t page = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDPrimaryUsagePageKey));
     uint32_t usage = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDPrimaryUsageKey));
-//    [[HidManager shared] showLog: [NSString stringWithFormat:@"发现设备 %@",inIOHIDDeviceRef]];
+    [[HidManager shared] showLog: [NSString stringWithFormat:@"发现设备 %@",inIOHIDDeviceRef]];
    if(vid == 3468 && pid == 786){
        if (page == 65282 && usage == 2) {
            [HidManager shared].productType = AiMouseProductType_m8;
@@ -65,6 +65,7 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
                return;
            }else{
                [[HidManager shared] showLog:@"打开设备成功!"];
+               [HidManager shared].isOpen = true;
                [HidManager shared].connectStateCallBack(true) ;
            }
        }
@@ -99,6 +100,7 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
             return;
         }else{
             [[HidManager shared] showLog:@"打开设备成功!"];
+            [HidManager shared].isOpen = true;
             [HidManager shared].connectStateCallBack(true) ;
         }
         return;
@@ -119,6 +121,7 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
             return;
         }else{
             [[HidManager shared] showLog:@"打开设备成功!"];
+            [HidManager shared].isOpen = true;
             [HidManager shared].connectStateCallBack(true) ;
         }
     }
@@ -135,6 +138,7 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
             return;
         }else{
             [[HidManager shared] showLog:@"打开设备成功!"];
+            [HidManager shared].isOpen = true;
             [HidManager shared].connectStateCallBack(true) ;
         }
     }
@@ -154,6 +158,7 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
                 
                 [[HidManager shared] showLog:@"打开设备信息成功!"];
                 if([HidManager shared].voiceCha != nil){
+                    [HidManager shared].isOpen = true;
                     [HidManager shared].connectStateCallBack(true);
                 }
             }
@@ -172,6 +177,7 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
                 
                 [[HidManager shared] showLog:@"打开设备voice成功!"];
                 if([HidManager shared].deviceInfoCha != nil){
+                    [HidManager shared].isOpen = true;
                     [HidManager shared].connectStateCallBack(true);
                 }
             }
@@ -195,6 +201,7 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
                 
                 [[HidManager shared] showLog:@"打开设备voice成功!"];
                 if([HidManager shared].deviceInfoCha != nil){
+                    [HidManager shared].isOpen = true;
                     [HidManager shared].connectStateCallBack(true);
                 }
             }
@@ -209,6 +216,7 @@ static void hidDisAppearDevice(void *inContext,IOReturn inResult,void *inSender,
         [HidManager shared].deviceInfoCha = nil;
         [HidManager shared].voiceCha = nil;
 //        [HidManager shared].hidManager = nil;
+        [HidManager shared].isOpen = false;
         [HidManager shared].connectStateCallBack(false) ;
     }
 }
@@ -286,222 +294,35 @@ static void hidReceiveData(void* context, IOReturn result, void* sender, IOHIDRe
     IOHIDManagerRegisterDeviceRemovalCallback(self.hidManager, &hidDisAppearDevice, NULL);
 }
 
-//- (void)open{
-//    if(self.hidManager == nil){
-//        self.deviceInfoCha = nil;
-//        self.hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
-//        IOHIDManagerScheduleWithRunLoop(self.hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
-//        IOReturn ret = IOHIDManagerOpen(self.hidManager, 0L);
-//        if (ret != kIOReturnSuccess) {
-//            [self showLog:(@"打开hid失败!")];
-//        }else{
-//            [self showLog:(@"打开hid成功!")];
-//        }
-//        NSMutableDictionary* dict= [NSMutableDictionary dictionary];
-//        IOHIDManagerSetDeviceMatching(self.hidManager, (__bridge CFMutableDictionaryRef)dict);
-//        IOHIDManagerRegisterDeviceRemovalCallback(self.hidManager, &hidDisAppearDevice, NULL);
-//    }
-//    
-//    if (self.deviceInfoCha != nil) {
-//        [HidManager shared].connectStateCallBack(true);
-//        return;
-//    }
-//
-//    // 在需要使用的地方调用
-//    CFSetRef devices = IOHIDManagerCopyDevices(self.hidManager);
-//    if (devices) {
-//        [self showLog:[NSString stringWithFormat:@"找到 %ld 个HID设备", CFSetGetCount(devices)]];
-//        // 使用C函数遍历集合
-//        CFSetApplyFunction(devices, deviceApplier, NULL);
-//        CFRelease(devices);
-//    } else {
-//        [self showLog:@"未找到HID设备"];
-//    }
-//}
-
-// 定义C函数作为集合应用函数
-void deviceApplier(const void *value, void *context) {
-    IOHIDDeviceRef inIOHIDDeviceRef = (IOHIDDeviceRef)value;
-    
-    if ([DeviceManger shared].isConneted) {
-        //        [[HidManager shared] showLog:(@"当前处于连接状态,对监听到有USB 插入 的事件不做处理")];
-        return;
-    }
-    uint32_t pid = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDProductIDKey));
-    uint32_t vid = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDVendorIDKey));
-    uint32_t page = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDPrimaryUsagePageKey));
-    uint32_t usage = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDPrimaryUsageKey));
-    [[HidManager shared] showLog: [NSString stringWithFormat:@"发现设备 %@",inIOHIDDeviceRef]];
-    if(vid == 3468 && pid == 786){
-        if (page == 65282 && usage == 2) {
-            [HidManager shared].productType = AiMouseProductType_m8;
-            [HidManager shared].deviceInfoCha = inIOHIDDeviceRef;
-            unsigned char InputBuffer[64];
-            IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, InputBuffer, sizeof(InputBuffer), &hidReceiveData, NULL);
-            
-            IOReturn result = IOHIDDeviceOpen(inIOHIDDeviceRef, kIOHIDOptionsTypeNone);
-            if (result != kIOReturnSuccess) {
-                [[HidManager shared] showLog:[NSString stringWithFormat:@"打开设备失败! %d",result]];
-                [[AiDeviceAuthManager shared] showHidAlert];
-                return;
-            }else{
-                [[HidManager shared] showLog:@"打开设备成功!"];
-                [HidManager shared].connectStateCallBack(true) ;
+- (BOOL)close{
+    if (self.hidManager != nil) {
+        if (self.deviceInfoCha != nil) {
+            // 取消所有报告回调
+            IOReturn ret = IOHIDDeviceClose(self.deviceInfoCha, kIOHIDOptionsTypeNone);
+            if (ret != kIOReturnSuccess) {
+                [self showLog:(@"关闭device失败!")];
+                return false;
             }
         }
-        //       else if (page == 1 && usage == 2){
-        //           [HidManager shared].productType = AiMouseProductType_m8;
-        //           [HidManager shared].deviceInfoCha = inIOHIDDeviceRef;
-        //           unsigned char InputBuffer[64];
-        //           IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, InputBuffer, sizeof(InputBuffer), &hidReceiveData, NULL);
-        //
-        //           IOReturn result = IOHIDDeviceOpen(inIOHIDDeviceRef, kIOHIDOptionsTypeNone);
-        //           if (result != kIOReturnSuccess) {
-        //               [[HidManager shared] showLog:[NSString stringWithFormat:@"打开设备失败! %d",result]];
-        //               [[AiDeviceAuthManager shared] showHidAlert];
-        //               return;
-        //           }else{
-        //               [[HidManager shared] showLog:@"打开设备成功!"];
-        //               //            [HidManager shared].connectStateCallBack(true) ;
-        //           }
-        //       }
-        return;
-    }
-    if((vid == 0x248a && pid == 0x6092)){
-        [HidManager shared].productType = AiMouseProductType_keyboard;
-        [HidManager shared].deviceInfoCha = inIOHIDDeviceRef;
-        unsigned char InputBuffer[64];
-        IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, InputBuffer, sizeof(InputBuffer), &hidReceiveData, NULL);
-        
-        IOReturn result = IOHIDDeviceOpen([HidManager shared].deviceInfoCha, kIOHIDOptionsTypeNone);
-        if (result != kIOReturnSuccess) {
-            [[HidManager shared] showLog:[NSString stringWithFormat:@"打开设备失败! %d",result]];
-            [[AiDeviceAuthManager shared] showHidAlert];
-            return;
-        }else{
-            [[HidManager shared] showLog:@"打开设备成功!"];
-            [HidManager shared].connectStateCallBack(true) ;
+        if (self.voiceCha != nil) {
+            IOReturn ret = IOHIDDeviceClose(self.voiceCha, kIOHIDOptionsTypeNone);
+            if (ret != kIOReturnSuccess) {
+                [self showLog:(@"关闭voice失败!")];
+                return false;
+            }
         }
-        return;
-    }
-    else if((vid == 0x1ea7 && pid == 0x0064)
-            || (vid == 0x1ea7 && pid == 0x0066)
-            || (vid == 0x32c2 && pid == 0x0066)
-            ){
-        [HidManager shared].productType = AiMouseProductType_n;
-        [HidManager shared].deviceInfoCha = inIOHIDDeviceRef;
-        unsigned char InputBuffer[64];
-        IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, InputBuffer, sizeof(InputBuffer), &hidReceiveData, NULL);
         
-        IOReturn result = IOHIDDeviceOpen([HidManager shared].deviceInfoCha, kIOHIDOptionsTypeNone);
-        if (result != kIOReturnSuccess) {
-            [[HidManager shared] showLog:[NSString stringWithFormat:@"打开设备失败! %d",result]];
-            [[AiDeviceAuthManager shared] showHidAlert];
-            return;
-        }else{
-            [[HidManager shared] showLog:@"打开设备成功!"];
-            [HidManager shared].connectStateCallBack(true) ;
+        IOReturn ret = IOHIDManagerClose(self.hidManager, 0);
+        if (ret != kIOReturnSuccess) {
+            [self showLog:(@"关闭hid失败!")];
+            return false;
         }
-    }
-    else if(vid == 0x10D6 && pid == 0xB008){
-        [HidManager shared].productType = AiMouseProductType_tlw;
-        [HidManager shared].deviceInfoCha = inIOHIDDeviceRef;
-        unsigned char InputBuffer[64];
-        IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, InputBuffer, sizeof(InputBuffer), &hidReceiveData, NULL);
         
-        IOReturn result = IOHIDDeviceOpen([HidManager shared].deviceInfoCha, kIOHIDOptionsTypeNone);
-        if (result != kIOReturnSuccess) {
-            [[HidManager shared] showLog:[NSString stringWithFormat:@"打开设备失败! %d",result]];
-            [[AiDeviceAuthManager shared] showHidAlert];
-            return;
-        }else{
-            [[HidManager shared] showLog:@"打开设备成功!"];
-            [HidManager shared].connectStateCallBack(true) ;
-        }
-    }
-    else  if(vid == 0x6675 && pid == 0x8601){
-        [HidManager shared].productType = AiMouseProductType_frk;
-        AiMouse.shared.tlw2 = false;
-        if(page == 1 && usage == 0){
-            unsigned char InputBuffer[128];
-            IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, InputBuffer, sizeof(InputBuffer), hidReceiveData, NULL);
-            IOReturn result = IOHIDDeviceOpen(inIOHIDDeviceRef, kIOHIDOptionsTypeNone);
-            if (result != kIOReturnSuccess) {
-                [[HidManager shared] showLog:[NSString stringWithFormat:@"打开设备信息失败! %d",result]];
-                [[AiDeviceAuthManager shared] showHidAlert];
-                return;
-            }else{
-                [HidManager shared].deviceInfoCha = inIOHIDDeviceRef;
-                
-                [[HidManager shared] showLog:@"打开设备信息成功!"];
-                if([HidManager shared].voiceCha != nil){
-                    [HidManager shared].connectStateCallBack(true);
-                }
-            }
-        }
-        else if(page == 65283 && usage == 0){
-            unsigned char InputBuffer[128];
-            IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, InputBuffer, sizeof(InputBuffer), hidReceiveData, NULL);
-            
-            IOReturn result = IOHIDDeviceOpen(inIOHIDDeviceRef, kIOHIDOptionsTypeNone);
-            if (result != kIOReturnSuccess) {
-                [[HidManager shared] showLog:[NSString stringWithFormat:@"打开设备voice失败! %d",result]];
-                [[AiDeviceAuthManager shared] showHidAlert];
-                return;
-            }else{
-                [HidManager shared].voiceCha = inIOHIDDeviceRef;
-                
-                [[HidManager shared] showLog:@"打开设备voice成功!"];
-                if([HidManager shared].deviceInfoCha != nil){
-                    [HidManager shared].connectStateCallBack(true);
-                }
-            }
-        }
-    }
-    else  if(vid == 0x6675 && pid == 0x8602){
-        [HidManager shared].productType = AiMouseProductType_frk;
-        AiMouse.shared.tlw2 = true;
-        [HidManager shared].tlw2Receiver = [[Tlw2ReceiveManager alloc] init];
-        if(page == 65519 && usage == 0){
-            unsigned char InputBuffer[128];
-            IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, InputBuffer, sizeof(InputBuffer), hidReceiveData, NULL);
-            
-            IOReturn result = IOHIDDeviceOpen(inIOHIDDeviceRef, kIOHIDOptionsTypeNone);
-            if (result != kIOReturnSuccess) {
-                [[HidManager shared] showLog:[NSString stringWithFormat:@"打开设备voice失败! %d",result]];
-                [[AiDeviceAuthManager shared] showHidAlert];
-                return;
-            }else{
-                [HidManager shared].deviceInfoCha = inIOHIDDeviceRef;
-                
-                [[HidManager shared] showLog:@"打开设备voice成功!"];
-                if([HidManager shared].deviceInfoCha != nil){
-                    [HidManager shared].connectStateCallBack(true);
-                }
-            }
-        }
-    }
-}
-
-
-
-- (void)close{
-    if (self.hidManager == nil) {
-        return;
-    }
-    [self showLog:@"关闭hid"];
-    
-    IOReturn ret = IOHIDManagerClose(self.hidManager, 0);
-    self.hidManager = nil;
-    
-    if (ret != kIOReturnSuccess) {
-        [self showLog:(@"关闭hid失败!")];
-    }else{
-        [self showLog:(@"关闭hid成功!")];
         self.deviceInfoCha = nil;
         self.voiceCha = nil;
         self.hidManager = nil;
     }
+    return true;
 }
 /// 发送数据给设备
 -(void)writeToDevice:(NSData *)data{
index 0996e86..8b1c6fd 100644 (file)
@@ -24,6 +24,7 @@
     // Do any additional setup after loading the view.
     [self setupUI];
     [self setupDeviceManger];
+    [self getDeviceIinfo];
 }
 
 - (void)loadView{
@@ -81,7 +82,7 @@
 #pragma mark - action
 - (void)setupDeviceManger{
     DeviceManger *manager = [DeviceManger shared];
-    [manager initSdk:2];
+    [manager initSdk:1];
     manager.debugLevel = 2;
     
     __weak typeof(self) ws = self;
         }
     }];
 }
+
+- (void)getDeviceIinfo{
+    if ([DeviceManger shared].isConneted) {
+        [self geviceInfoAction];
+    }
+   //[self performSelector:@selector(getDeviceIinfo) withObject:nil afterDelay:10];
+}
 @end