Skip to content

Commit

Permalink
Properly convert peripheral UUID for isConnected on iOS (#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
peitschie committed Sep 12, 2024
1 parent b5518ca commit 4c3f0ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ios/BLECentralPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,13 @@ - (void)stopScan:(CDVInvokedUrlCommand*)command {


- (void)isConnected:(CDVInvokedUrlCommand*)command {
NSUUID *uuid = [self getUUID:command argumentAtIndex:0];
if (uuid == nil) {
return;
}

CBPeripheral *peripheral = [self findPeripheralByUUID:uuid];
CDVPluginResult *pluginResult = nil;
CBPeripheral *peripheral = [self findPeripheralByUUID:[command argumentAtIndex:0]];

if (peripheral && peripheral.state == CBPeripheralStateConnected) {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
} else {
Expand Down

0 comments on commit 4c3f0ea

Please sign in to comment.