Environment
- Device: Edge 840, firmware 31.33
- ConnectIQ-API-Version: 6.0.0
- ConnectIQ-Version: 6.0.0
- App type: Data Field
- minSdkVersion in manifest: 3.2.0
What I'm trying to do
I'm writing a Data Field that connects as a BLE central to a third-party BLE peripheral (not a Garmin sensor) and talks to it over a custom GATT service/characteristics. Scanning, profile registration, and advertisement filtering all work correctly. The problem is that after pairDevice() returns a valid, non-null Device object, onConnectedStateChanged() is never called - not with CONNECTION_STATE_CONNECTED, not with any disconnected/error state either. Just silence.
Remarks
- On the first run, Bluetooth confirmation about open connection is being displayed and I accepted it.
- I always test on real device, not in simulator.
What I've verified so far
registerProfile()succeeds:onProfileRegisterfires withstatus == STATUS_SUCCESSfor my service UUID.onScanResults()correctly identifies the target device by its advertised service UUID.getAvailableConnectionCount()returns6immediately before callingpairDevice(), so this isn't the documented "max 3 concurrent connections" limit.pairDevice(result)returns a non-nullDeviceobject (confirmed viaSystem.println), so the call itself isn't failing outright.- After that, I waited well beyond any reasonable connection/bonding timeout (
up to ~20-30 seconds across multiple runs), andonConnectedStateChangedsimply never fires - no success, no failure.
Minimal repro
function onScanResults(scanResults as Iterator) as Void {
for (var item = scanResults.next(); item != null; item = scanResults.next()) {
var result = item as ScanResult;
if (isTargetAdvert(result)) {
stopScan();
var device = pairDevice(result);
System.println("pairDevice() returned: " + device);
// device is non-null here, but onConnectedStateChanged is
// never subsequently invoked for it.
return;
}
}
}
function onConnectedStateChanged(device as Device, state as BluetoothLowEnergy.ConnectionState) as Void {
// This never runs, in either branch.
System.println("onConnectedStateChanged: " + state);
}
Questions
- Is a non-null return from
pairDevice()actually a guarantee that a connection attempt was started at the radio/GATT level, or can it return aDevicehandle even when the attempt silently fails to begin? - Are there known issues with BLE central connections to non-Garmin peripherals on Edge 840 / firmware 31.33 / CIQ API 6.0.0?
- If the peripheral requires GATT-level encryption/bonding, would that surface as a native OS-level pairing/passkey prompt on the Edge's screen? If so, is there any API-level signal (callback, state, log) that such a prompt is pending, since my Data Field has no visibility into that beyond the missing callback?
- Is there any additional API call needed beyond
pairDevice()to actually initiate/complete the GATT connection, or ispairDevice()supposed to be sufficient on its own?
Any pointers - even just "check X" - would be appreciated.
Update
I tried with this CIQ app: https://apps.garmin.com/en-US/apps/9bcc8b66-8385-4afb-b93e-f69e01422284
When I hit "Connect", labels turn orange, and never green. So I believe this is blocking my desire to connect to this camera.