新增M8、一键上网版、麦吉版
authorliangzhenying <867174124@qq.com>
Wed, 9 Oct 2024 02:15:56 +0000 (10:15 +0800)
committerliangzhenying <867174124@qq.com>
Wed, 9 Oct 2024 02:15:56 +0000 (10:15 +0800)
MouseSdk/AiMouseSdk/Manager/DeviceManger.m
MouseSdk/AiMouseSdk/Manager/HidManager.m
MouseSdk/AiMouseSdk/NMouseSdk/NMouseSdk.m
MouseSdk/AiMouseSdk/TlwMouseSdk/TlwMouseSdk.h
MouseSdk/AiMouseSdk/TlwMouseSdk/TlwMouseSdk.m
MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

index a272c9e..2f3ab4b 100644 (file)
@@ -42,7 +42,7 @@
 - (instancetype)init{
     self = [super init];
     if (self) {
-        [self showLog:@"MouseSdk_v1.0.3"];
+        [self showLog:@"MouseSdk_v1.0.7"];
         [self setupSDK];
         [self setupBle];
         [self setupHid];
         self.aiMouseSendCmdDataCallBack([NSString stringWithFormat:@"%X",cmd]);
     }
     
-    if(cmd == 0x31 || cmd == 0x21 || cmd == 0x25 ||cmd == 0x27){
+    if(cmd == 0x04 || cmd == 0x07 || cmd == 0x31 || cmd == 0x21 || cmd == 0x25 ||cmd == 0x27){
         [self showLog:@"开始录音"];
         self.recordData = [[NSMutableData alloc] init];
         if (self.begainRecoredCallBack) {
             self.begainRecoredCallBack();
         }
     }
-    else if(cmd == 0x32 || cmd == 0x22 || cmd == 0x26 ||cmd == 0x28){
+    else if(cmd == 0x05 || cmd == 0x08 || cmd == 0x32 || cmd == 0x22 || cmd == 0x26 ||cmd == 0x28){
         [self showLog:@"结束录音"];
         [self finishRecored:self.recordData];
         if (self.finishRecoredCallBack) {
index 4a48cc8..b022262 100644 (file)
@@ -52,7 +52,15 @@ static void hidAppearDevice(void *inContext,IOReturn inResult,void *inSender,IOH
 //    [[HidManager shared] showLog: inIOHIDDeviceRef];
     
     
-    if(vid == 0x1ea7 && pid == 0x0064){
+    if((vid == 0x1ea7 && pid == 0x0064)
+       || (vid == 0x1ea7 && pid == 0x0066)
+       || (vid == 0x32c2 && pid == 0x0066)
+       ){
+//        现在确认是这三款:
+//        VID 0x1EA7    PID 0x0064
+//        VID 0x1EA7    PID 0x0066
+//        VID 0x32C2    PID 0x0066
+        
         [[HidManager shared] showLog:([NSString stringWithFormat:@"发现设备%@,pid = %d,vid = %d ,page = %d, usage = %d",inIOHIDDeviceRef,pid,vid,PrimaryUsagePage,PrimaryUsage])];
         [HidManager shared].productType = AiMouseProductType_n;
         [HidManager shared].deviceInfoCha = inIOHIDDeviceRef;
@@ -162,11 +170,11 @@ static void hidReceiveData(void* context, IOReturn result, void* sender, IOHIDRe
         uint32_t primaryUsagePage = IOHIDDevGetUInt32Property(sender, CFSTR(kIOHIDPrimaryUsagePageKey));
         uint32_t primaryUsage = IOHIDDevGetUInt32Property(sender, CFSTR(kIOHIDPrimaryUsageKey));
         
-        if(primaryUsagePage == 65461 && primaryUsage == 1){
+//        if(primaryUsagePage == 65461 && primaryUsage == 1){
+//        if(primaryUsage == 1){
             NSData *data = [[NSData alloc] initWithBytes:report length:reportLength];
-//            [[HidManager shared] showLog:[NSString stringWithFormat:@"receive = %@",data]];
             [HidManager shared].receiveInfoDataCallBack(data);
-        }
+//        }
     }
     else if([HidManager shared].productType == AiMouseProductType_tlw){
         if (report[0] == 0x01 || report[0] == 0x02) {
index 091a263..dcbdf1d 100644 (file)
     _connected = false;
 }
 
+//北科专属
+//- (void)sendDeviceDataToSdk:(NSData *)data{
+//    
+//    NSString *text = [TlwTools dataToHexString:data];
+//   
+////  鼠标  0x020001f0ff0000
+////  sn1  0xb52c00bba30d5540
+////  sn2  0xb52c01bba30d5540
+////    62DF3D553297
+//   
+//    if ([text hasPrefix:@"B52C00"]) {
+//        [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]];
+//        [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]];
+//        if (self.getSn1CallBack) {
+//            //北科加42专属
+//            self.getSn1CallBack([NSString stringWithFormat:@"42%@",[text substringWithRange:NSMakeRange(6, 8)]], nil);
+//        }
+//    }
+//    else if ([text hasPrefix:@"B52C01"]) {
+//        [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]];
+//        [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]];
+//        if (self.getSn2CallBack) {
+//            //北科加42专属
+//            self.getSn2CallBack([text substringWithRange:NSMakeRange(6, 2)], nil);
+//        }
+//    }
+//    else if([text hasPrefix:@"B5200443"]){
+//        [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]];
+//        uint8_t cmd = 0x42;
+//        NSMutableData *mData = [NSMutableData data];
+//        [mData appendBytes:&cmd length:1];
+//        [self.delegate nMouseSendCmdData:mData];
+//    }
+//    else if([text hasPrefix:@"B5200057"]){
+//        [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]];
+//        uint8_t cmd = 0x42;
+//        NSMutableData *mData = [NSMutableData data];
+//        [mData appendBytes:&cmd length:1];
+//        [self.delegate nMouseSendCmdData:mData];
+//    }
+//}
+
+//千寻
 - (void)sendDeviceDataToSdk:(NSData *)data{
-    
     NSString *text = [TlwTools dataToHexString:data];
    
 //  鼠标  0x020001f0ff0000
         [mData appendBytes:&cmd length:1];
         [self.delegate nMouseSendCmdData:mData];
     }
+    else if([text hasPrefix:@"B5200057"]){
+        [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]];
+        uint8_t cmd = 0x42;
+        NSMutableData *mData = [NSMutableData data];
+        [mData appendBytes:&cmd length:1];
+        [self.delegate nMouseSendCmdData:mData];
+    }
 }
-
 - (void)getDeviceInfo:(void (^)(AiMouseDeviceInfo *deviceInfo,NSError *error))finished{
     [NSObject cancelPreviousPerformRequestsWithTarget:self];
     self.getDeviceInfoCallBack = finished;
     [self.delegate nMouseSendDeviceInfoData:data];
 }
 @end
+
index 4f38ca2..b6d9289 100644 (file)
@@ -45,7 +45,8 @@ typedef NS_ENUM(NSInteger,TlwMouseLogLevel) {
 /// - Parameter data: 数据。
 /// 前  单击0x06, 按下0x13(开始录音)抬起0x14(结束录音)
 /// 中  单击0x03, 按下0x11(开始录音)抬起0x12(结束录音)
-/// 后  第一次单击0x01, 第二次单击0x02(结束录音) , 按下0x09(开始录音)抬起0x10(结束录音)
+/// 后  第一次单击0x01, 第二次单击0x02(结束录音) , 按下0x09(开始录音)抬起0x10(结束录音)
+/// 翻译键  第一次单击0x04(开始录音), 第二次单击0x05(结束录音), 按下0x07(开始录音) 抬起0x08(结束录音)
 /// 其他未定义
 - (void)tlwMouseSendCmdData:(NSData *)data;
 
index ab3845b..eaf2bc0 100644 (file)
             uint8 cmd;
             [subData getBytes:&cmd length:1];
             
-            if(cmd == 0x13 || cmd == 0x11 || cmd == 0x01 ||cmd == 0x09){
+            if(cmd == 0x04 || cmd == 0x07 || cmd == 0x13 || cmd == 0x11 || cmd == 0x01 ||cmd == 0x09){
                 self.recordManager.startCmd = subData;
                 [self startRecord];
             }
-            else if(cmd == 0x14 || cmd == 0x12 || cmd == 0x02 ||cmd == 0x10){
+            else if(cmd == 0x05 || cmd == 0x08 || cmd == 0x14 || cmd == 0x12 || cmd == 0x02 ||cmd == 0x10){
                 [self stopRecord];
             }
             break;
 }
 #pragma mark - other
 - (void)sendRecordData:(NSData *)data{
-//    [self showLog:[NSString stringWithFormat:@"[send][audio] %@",data]];
+    [self showLog:[NSString stringWithFormat:@"[send][audio] %@",data]];
     if (self.delegate)  [self.delegate tlwMouseSendRecordData:data];
 }
 
index 966de6a..974ad7e 100644 (file)
Binary files a/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate and b/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate differ
index 86ee2a8..c3ddbcd 100644 (file)
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "12E46D2B-C0AD-4773-8DFD-6F921BD2631E"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "AiMouseSdk/AiMouseSdk/AiMouseSdk.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "233"
-            endingLineNumber = "233"
-            landmarkName = "-sendAiDataToSdk:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "3B4834FE-8394-46CA-891E-A4A9DD3F09DE"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "AiMouseSdk/AiMouseSdk/AiMouseSdk.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "273"
-            endingLineNumber = "273"
-            landmarkName = "-sendDeviceDataToSdk:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
    </Breakpoints>
 </Bucket>