We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoConnectAfterDisconnect 我设置断线重连为NO,回调的错误码是bluetoothErrorStateDisconnect重新开启设备还是能自动重连,设置YES回调的是bluetoothErrorStateDisconnectTring, 我看源代码逻辑有没看出问题
重开设备有时一直回调这个方法,已经连接成功隔几秒又走一次又提示连接成功,无限循环了,根本停不下来 #pragma mark - connect peripheral
(void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral { EasyLog_R(@"蓝牙连接上一个设备:%@ , %@",peripheral,peripheral.identifier);
EasyPeripheral *existedP = nil ; for (NSString *tempIden in [self.connectedDeviceDict allKeys]) { if ([tempIden isEqualToString:peripheral.identifier.UUIDString]) { existedP = self.connectedDeviceDict[tempIden] ; break ; } }
if (!existedP) { for (NSString *tempIden in [self.foundDeviceDict allKeys]) { if ([tempIden isEqualToString:peripheral.identifier.UUIDString]) { existedP = self.foundDeviceDict[tempIden] ; break ; } }
if (existedP) { [self.connectedDeviceDict setObject:existedP forKey:peripheral.identifier.UUIDString]; } else{ existedP = [[EasyPeripheral alloc]initWithPeripheral:peripheral central:self]; [self.connectedDeviceDict setObject:existedP forKey:peripheral.identifier.UUIDString]; if (_blueToothSearchDeviceCallback) { _blueToothSearchDeviceCallback(existedP,searchFlagTypeAdded); } [self.foundDeviceDict setObject:existedP forKey:peripheral.identifier.UUIDString]; }
} [existedP dealDeviceConnectWithError:nil];
}
图片上传一直失败
有空能看看吗
The text was updated successfully, but these errors were encountered:
谢谢!
Sorry, something went wrong.
好的。我明天去公司了看看,家里没有设备。你加我qq(455158249)好沟通点。
好的,多谢
这个是无限连接的视频 在这里打断点就会重现
我录了两个屏您先看看 自动连接设置为NO还是能自动重连.zip
无限连接视频.zip
大神太给力了,以上问题全部解决,可以放心使用
No branches or pull requests
autoConnectAfterDisconnect 我设置断线重连为NO,回调的错误码是bluetoothErrorStateDisconnect重新开启设备还是能自动重连,设置YES回调的是bluetoothErrorStateDisconnectTring,

我看源代码逻辑有没看出问题
重开设备有时一直回调这个方法,已经连接成功隔几秒又走一次又提示连接成功,无限循环了,根本停不下来
#pragma mark - connect peripheral
(void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral
{
EasyLog_R(@"蓝牙连接上一个设备:%@ , %@",peripheral,peripheral.identifier);
EasyPeripheral *existedP = nil ;
for (NSString *tempIden in [self.connectedDeviceDict allKeys]) {
if ([tempIden isEqualToString:peripheral.identifier.UUIDString]) {
existedP = self.connectedDeviceDict[tempIden] ;
break ;
}
}
if (!existedP) {
for (NSString *tempIden in [self.foundDeviceDict allKeys]) {
if ([tempIden isEqualToString:peripheral.identifier.UUIDString]) {
existedP = self.foundDeviceDict[tempIden] ;
break ;
}
}
}
[existedP dealDeviceConnectWithError:nil];
}
图片上传一直失败
有空能看看吗
The text was updated successfully, but these errors were encountered: