quick_blue icon indicating copy to clipboard operation
quick_blue copied to clipboard

[Windows] Expose isPaired and canPair

Open fotiDim opened this issue 3 years ago • 6 comments

I would like to monitor the pairing status so that I prompt the user to pair through Windows settings if needed. There are the isPaired and the carPair properties. I would be great of those would be exposed on the Flutter side.

fotiDim avatar Mar 12 '22 10:03 fotiDim

Is there similiar APIs on other platforms?

Sunbreak avatar Mar 12 '22 11:03 Sunbreak

As I read for iOS at least the answer is no. It could be indirectly inferred by trying to write some value and see if it succeeds or not. I guess https://github.com/woodemi/quick_blue/issues/54 needs to be addressed first in that case.

fotiDim avatar Mar 15 '22 21:03 fotiDim

BluetoothLEAdvertisementWatcher VS DeviceWatcher

// auto aqsFilter = BluetoothDevice::GetDeviceSelectorFromPairingState(true) + L" AND System.Devices.Aep.IsConnected:=System.StructuredQueryType.Boolean#True";

auto aqsFilter = BluetoothDevice::GetDeviceSelectorFromPairingState(true);
auto requestedProperties = {
  L"System.Devices.Aep.IsConnected",
  L"System.Devices.Aep.DeviceAddress"
};
deviceWatcher = DeviceInformation::CreateWatcher(aqsFilter, requestedProperties, DeviceInformationKind::AssociationEndpoint);

Yongle-Fu avatar Mar 21 '22 11:03 Yongle-Fu

Is there any chance that you could solve the #43 ?

Sunbreak avatar Mar 21 '22 12:03 Sunbreak

As you may know, there isn't API for monitor a pairing status in iOS. In Android, there is a Broadcast intent ACTION_BOND_STATE_CHANGED

And also, each OS can retrieve bonded devices from system. (I am not sure if windows has the similar API.)

iOS

retrievePeripheralsWithIdentifiers: and retrieveConnectedPeripheralsWithServices:

Best Practices for Interacting with a Remote Peripheral Device

Android

getBondedDevices

Find Bluetooth devices  |  Android Developers

ymmtyuhei avatar Apr 04 '22 04:04 ymmtyuhei

Thanks a lot for the info

I'll take a look at it this weekend

Sunbreak avatar Apr 06 '22 02:04 Sunbreak