m8 hid调试
authorliangzhenying <867174124@qq.com>
Fri, 18 Apr 2025 06:11:34 +0000 (14:11 +0800)
committerliangzhenying <867174124@qq.com>
Fri, 18 Apr 2025 06:11:34 +0000 (14:11 +0800)
MouseSdk/AiMouseSdk/AiMouseSdk.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist
MouseSdk/AiMouseSdk/Manager/HidManager.m
MouseSdk/AiMouseSdk/Manager/TimerManager.m
MouseSdk/MouseSdk.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate
MouseSdk/MouseSdk.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
MouseSdk/Pods/Pods.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist

index 64bd978..27157b9 100644 (file)
@@ -7,7 +7,7 @@
                <key>AiMouseSdk copy.xcscheme_^#shared#^_</key>
                <dict>
                        <key>orderHint</key>
-                       <integer>2</integer>
+                       <integer>4</integer>
                </dict>
                <key>AiMouseSdk.xcscheme_^#shared#^_</key>
                <dict>
index 294da9e..734ec3a 100644 (file)
@@ -50,8 +50,48 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
     uint32_t PrimaryUsagePage = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDPrimaryUsagePageKey));
     uint32_t PrimaryUsage = IOHIDDevGetUInt32Property(inIOHIDDeviceRef, CFSTR(kIOHIDPrimaryUsageKey));
     //    [[HidManager shared] showLog: inIOHIDDeviceRef];
-    
-    if((vid == 0x248a && pid == 0x6092)
+//    if((vid == 16700 && pid == 8455)
+//       ){
+//        [[HidManager shared] showLog:([NSString stringWithFormat:@"发现M8%@,pid = %d,vid = %d ,page = %d, usage = %d",inIOHIDDeviceRef,pid,vid,PrimaryUsagePage,PrimaryUsage])];
+//        if(PrimaryUsagePage == 1 && PrimaryUsage == 6){
+//            [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) ;
+//            }
+//        }
+//        else if (PrimaryUsagePage == 65282 && PrimaryUsage == 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;
+//    }
+//    else
+        if((vid == 0x248a && pid == 0x6092)
        ){
         [[HidManager shared] showLog:([NSString stringWithFormat:@"发现键盘%@,pid = %d,vid = %d ,page = %d, usage = %d",inIOHIDDeviceRef,pid,vid,PrimaryUsagePage,PrimaryUsage])];
         [HidManager shared].productType = AiMouseProductType_keyboard;
@@ -171,6 +211,7 @@ static void hidDisAppearDevice(void *inContext,IOReturn inResult,void *inSender,
 static void hidReceiveData(void* context, IOReturn result, void* sender, IOHIDReportType type, uint32_t reportID, uint8_t *report,CFIndex reportLength){
     NSData *data = [[NSData alloc] initWithBytes:report length:reportLength];
 //        [[HidManager shared] showLog:[NSString stringWithFormat:@"receive = %@",data]];
+//    return;
     if([HidManager shared].productType == AiMouseProductType_keyboard){
         uint32_t primaryUsagePage = IOHIDDevGetUInt32Property(sender, CFSTR(kIOHIDPrimaryUsagePageKey));
         uint32_t primaryUsage = IOHIDDevGetUInt32Property(sender, CFSTR(kIOHIDPrimaryUsageKey));
index a0267d1..556807b 100644 (file)
@@ -32,7 +32,7 @@
 //        [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
 //        [[NSRunLoop currentRunLoop] run];
 //    });
-    self.timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(timerAction) userInfo:nil repeats:true];
+    self.timer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(timerAction) userInfo:nil repeats:true];
 }
 
 - (void)timerAction{
index bc0c02b..0e26bc4 100644 (file)
Binary files a/MouseSdk/MouseSdk.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate and b/MouseSdk/MouseSdk.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate differ
index 51ba4e0..ff83931 100644 (file)
@@ -7,33 +7,33 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "3FEEA307-9A37-4E1D-83CF-48F35AD81EF6"
+            uuid = "7811129E-8425-43E8-9FDC-75B40C321EE5"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "AiMouseSdk/M8/M8MouseSdk.m"
+            filePath = "AiMouseSdk/AiMouseSdk/AiAudioManager.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "59"
-            endingLineNumber = "59"
-            landmarkName = "-recordManager"
+            startingLineNumber = "52"
+            endingLineNumber = "52"
+            landmarkName = "-setupAudioDecoder"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "7811129E-8425-43E8-9FDC-75B40C321EE5"
+            uuid = "4CD2AA7E-80CE-4CAA-A0AC-008B3CD5E559"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "AiMouseSdk/AiMouseSdk/AiAudioManager.m"
+            filePath = "AiMouseSdk/Manager/HidManager.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "52"
-            endingLineNumber = "52"
-            landmarkName = "-setupAudioDecoder"
-            landmarkType = "7">
+            startingLineNumber = "57"
+            endingLineNumber = "57"
+            landmarkName = "hidAppearDevice(inContext, inResult, inSender, inIOHIDDeviceRef)"
+            landmarkType = "9">
          </BreakpointContent>
       </BreakpointProxy>
    </Breakpoints>
index 30f1cdd..a1cc8f6 100644 (file)
@@ -12,7 +12,7 @@
                <key>Pods-MouseSdk.xcscheme_^#shared#^_</key>
                <dict>
                        <key>orderHint</key>
-                       <integer>4</integer>
+                       <integer>2</integer>
                </dict>
        </dict>
 </dict>