ios连接错误回调信息微调

This commit is contained in:
lishuo committed 2022-07-18 17:14:30 +08:00
1 parent 3e80edf0dc
commit 71ae54aabe
2 files changed
+5 -3

No files matched your search

+3 -1
View File
@@ -795,9 +795,11 @@ extern "C" {
- (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
{
NSLog(@"ConnectionError~~connectPeripheral:peripheral ");
if (error)
{
NSString *message = [NSString stringWithFormat:@"Error~%@", error.description];
NSString *identifier = [[peripheral identifier] UUIDString];
NSString *message = [NSString stringWithFormat:@"ConnectionError~%@~%@",identifier,error.description];
UnitySendMessage ("BluetoothLEReceiver", "OnBluetoothMessage", [message UTF8String] );
}
}