}
-(NSString *)version{
- return @"1.0.30";
+ return @"1.0.31";
}
-(AiDeviceInfoManager *)deviceInfoManager{
__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];
//收到蓝牙数据
- (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];
if(isConnected){
self.typeLabel.stringValue = type == AiMouseConnectType_bluetooth ?@"连接模式:蓝牙":@"连接模式:hid";
self.connectLabel.stringValue = isConnected?@"连接状态:已连接":@"连接状态:未连接";
+ [self geviceInfoAction];
}
else{
self.typeLabel.stringValue = @"连接模式:--";