From: liangzhenying <867174124@qq.com> Date: Thu, 20 Jun 2024 04:05:23 +0000 (+0800) Subject: demo增加获取设备信息 X-Git-Tag: 千寻适配d9~52 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=37e138aaafbcd3b028ba57efa81b134c65a7796c;p=mirrors%2FMouseSdk-MacOS.git demo增加获取设备信息 --- diff --git a/MouseSdk/AiMouseSdk/AiMouseSdk/AiMouseSdk.m b/MouseSdk/AiMouseSdk/AiMouseSdk/AiMouseSdk.m index 4b23745..466dd18 100644 --- a/MouseSdk/AiMouseSdk/AiMouseSdk/AiMouseSdk.m +++ b/MouseSdk/AiMouseSdk/AiMouseSdk/AiMouseSdk.m @@ -64,7 +64,7 @@ } -(NSString *)version{ - return @"1.0.30"; + return @"1.0.31"; } -(AiDeviceInfoManager *)deviceInfoManager{ @@ -73,7 +73,7 @@ __weak typeof(self) ws = self; _deviceInfoManager.sendToBleBlock = ^(NSData * _Nonnull data) { if (ws.delegate) { - [ws showLog:[NSString stringWithFormat:@"[send] %@",data]]; + [ws showLog:[NSString stringWithFormat:@"[send][info] %@",data]]; [ws.delegate aiMouseSendDeviceInfoData:data]; } }; @@ -223,7 +223,7 @@ #pragma mark - deviceInfoManager -(void)sendDeviceDataToSdk:(NSData *)data{ - [self showLog:[NSString stringWithFormat:@"[receive][device] %@",data]]; + [self showLog:[NSString stringWithFormat:@"[receive][info] %@",data]]; if (self.connected == false) { if([AiMouseTools dataToHexString:data].length < 10){ if (self.delegate && [self.delegate respondsToSelector:@selector(hidDataError)]) [self.delegate hidDataError]; diff --git a/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate b/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate index 4741d5a..cde67d4 100644 Binary files a/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate and b/MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MouseSdk/MouseSdk/BleManager.m b/MouseSdk/MouseSdk/BleManager.m index d63c66e..57ee6ed 100644 --- a/MouseSdk/MouseSdk/BleManager.m +++ b/MouseSdk/MouseSdk/BleManager.m @@ -127,7 +127,6 @@ //收到蓝牙数据 - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error { NSData *data = characteristic.value; -// [self showLog:[NSString stringWithFormat:@"[receive] %@",data]]; if([characteristic.UUID.UUIDString isEqualToString:kAiUUID]){ //AI数据 [[AiMouse shared] sendAiDataToSdk:data]; diff --git a/MouseSdk/MouseSdk/ViewController.m b/MouseSdk/MouseSdk/ViewController.m index e8ba4ad..6f1ef58 100644 --- a/MouseSdk/MouseSdk/ViewController.m +++ b/MouseSdk/MouseSdk/ViewController.m @@ -127,6 +127,7 @@ if(isConnected){ self.typeLabel.stringValue = type == AiMouseConnectType_bluetooth ?@"连接模式:蓝牙":@"连接模式:hid"; self.connectLabel.stringValue = isConnected?@"连接状态:已连接":@"连接状态:未连接"; + [self geviceInfoAction]; } else{ self.typeLabel.stringValue = @"连接模式:--";