From: liangzhenying <867174124@qq.com> Date: Fri, 8 Nov 2024 08:17:54 +0000 (+0800) Subject: 千寻适配D9 X-Git-Tag: 千寻适配d9^0 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=91865203a1a0446d11e7ef4e2df7f9d7a4994e4c;p=mirrors%2FMouseSdk-MacOS.git 千寻适配D9 --- diff --git a/MouseSdk/AiMouseSdk/Manager/DeviceManger.m b/MouseSdk/AiMouseSdk/Manager/DeviceManger.m index 460f191..073975d 100644 --- a/MouseSdk/AiMouseSdk/Manager/DeviceManger.m +++ b/MouseSdk/AiMouseSdk/Manager/DeviceManger.m @@ -42,7 +42,7 @@ - (instancetype)init{ self = [super init]; if (self) { - NSString *version = @"MouseSdk_v2024110801"; + NSString *version = @"MouseSdk_v2024110802"; NSLog(@"[AiMouseSdk] %@",version); [self showLog:version]; [self setupSDK]; diff --git a/MouseSdk/AiMouseSdk/NMouseSdk/NMouseSdk.m b/MouseSdk/AiMouseSdk/NMouseSdk/NMouseSdk.m index 00eb299..dcbdf1d 100644 --- a/MouseSdk/AiMouseSdk/NMouseSdk/NMouseSdk.m +++ b/MouseSdk/AiMouseSdk/NMouseSdk/NMouseSdk.m @@ -56,69 +56,33 @@ } //北科专属 -- (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 //// sn1 0xb52c00bba30d5540 //// sn2 0xb52c01bba30d5540 //// 62DF3D553297 -// [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]]; +// // if ([text hasPrefix:@"B52C00"]) { // [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]]; +// [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]]; // if (self.getSn1CallBack) { -// self.getSn1CallBack([text substringWithRange:NSMakeRange(6, 8)], nil); +// //北科加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) { -// self.getSn2CallBack([text substringWithRange:NSMakeRange(6, 4)], nil); +// //北科加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]; @@ -132,6 +96,42 @@ // [self.delegate nMouseSendCmdData:mData]; // } //} + +//千寻 +- (void)sendDeviceDataToSdk:(NSData *)data{ + NSString *text = [TlwTools dataToHexString:data]; + +// 鼠标 0x020001f0ff0000 +// sn1 0xb52c00bba30d5540 +// sn2 0xb52c01bba30d5540 +// 62DF3D553297 + [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]]; + if ([text hasPrefix:@"B52C00"]) { + [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]]; + if (self.getSn1CallBack) { + self.getSn1CallBack([text substringWithRange:NSMakeRange(6, 8)], nil); + } + } + else if ([text hasPrefix:@"B52C01"]) { + [self showLog:[NSString stringWithFormat:@"[receive][usb][info] %@",text]]; + if (self.getSn2CallBack) { + self.getSn2CallBack([text substringWithRange:NSMakeRange(6, 4)], nil); + } + } + else if([text hasPrefix:@"B5200443"]){ + 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)getDeviceInfo:(void (^)(AiMouseDeviceInfo *deviceInfo,NSError *error))finished{ [NSObject cancelPreviousPerformRequestsWithTarget:self]; self.getDeviceInfoCallBack = finished; diff --git a/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate b/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate index eca5223..de7d8c9 100644 Binary files a/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate and b/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate differ