-5

We upgraded our embedded firmware's Silicon Labs IDE Simp Studio from v4 to v5 (which has substantial BLE enhancements).

PROBLEM...
Now our iphone Swift app, using corebluetooth, has connection trouble to our embedded.

DEBUGGING WE HAVE TRIED......
After installation of prior firmware, iOS app connects and operates without problem. Tried alternate embedded device: same problem.

OUR iOS BLE ............

internal func centralManagerDidUpdateState(_ central: CBCentralManager) 
{

    switch central.state {
    case .poweredOn:
            start_peripheral_scan()          

    case .poweredOff:
        start_comm_recovery( false )
        return

    case .resetting:
        return
    case .unauthorized:
        if #available(iOS 13.0, *) {
            switch central.authorization {
            case .denied:
            case .restricted:
            default:
            }
        } else {
        }
        return
    case .unknown:
        return
    case .unsupported:
        return
    @unknown default:
        return
    }
    // NEXT:    didDiscover
}



func start_peripheral_scan()       
{
    if centralManager == nil { handle_fault("start_peripheral_scan:  centralManager == nil") }
    centralManager.scanForPeripherals(withServices: nil,                   ///////////////////   S T A R T   S C A N N I N G   //////////////////////
        options: [CBCentralManagerScanOptionAllowDuplicatesKey: true])

}                                                                 



func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral,
                    advertisementData: [String: Any], rssi RSSI: NSNumber) 
{
    . . .    // verifies peripheral.name is desired device.   
    if is_my_device
    {
        centralManager.connect(peripheral, options: nil)      
        // Attempts connection.  But this occurs only once after uploading firmware to our embedded device.
        // If our app 
    }
}
Doug Null
  • 7,989
  • 15
  • 69
  • 148
  • 1
    Perhaps show some code and give more detail on what debugging you have tried and what happens. Does you central discover your peripheral? Does it connect? Can it scan services and characteristics? At what point does it fail? – Paulw11 Feb 15 '23 at 01:24

1 Answers1

0

No, there wasn't. Problem was app failed to await Core Bluetooth POWER ON event before starting BLE scan.

Doug Null
  • 7,989
  • 15
  • 69
  • 148