demo增加获取设备信息
authorliangzhenying <867174124@qq.com>
Thu, 20 Jun 2024 04:05:23 +0000 (12:05 +0800)
committerliangzhenying <867174124@qq.com>
Thu, 20 Jun 2024 04:05:23 +0000 (12:05 +0800)
MouseSdk/AiMouseSdk/AiMouseSdk/AiMouseSdk.m
MouseSdk/MouseSdk.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
MouseSdk/MouseSdk/BleManager.m
MouseSdk/MouseSdk/ViewController.m

index 4b23745..466dd18 100644 (file)
@@ -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];
             }
         };
 
 #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];
index 4741d5a..cde67d4 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 d63c66e..57ee6ed 100644 (file)
 //收到蓝牙数据
 - (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];
index e8ba4ad..6f1ef58 100644 (file)
         if(isConnected){
             self.typeLabel.stringValue = type == AiMouseConnectType_bluetooth ?@"连接模式:蓝牙":@"连接模式:hid";
             self.connectLabel.stringValue = isConnected?@"连接状态:已连接":@"连接状态:未连接";
+            [self geviceInfoAction];
         }
         else{
             self.typeLabel.stringValue = @"连接模式:--";