l-behrens
l-behrens

Reputation: 15

DBus Bluez5 CancelPairing()

When I Pair a device with a bt adapter a new debus object path of the form: /org/bluez/${bt_device}/dev_${mac} appears. Inspecting org.bluez.Device1 on this object there is a method called: CancelPairing() advertised.

Calling this method returns: g-io-error-quark: GDBus.Error:org.bluez.Error.DoesNotExist: Does Not Exist

I try to pair devices and dissolve bt pairings in python using bluez5 dbus api through pydbus. Can You help me to achieve that? :)

Upvotes: 0

Views: 897

Answers (1)

kaylum
kaylum

Reputation: 14044

The bluez Device API documentation describes the CancelPairing method. It is not for removing an existing pairing that has already completed. It is used to:

cancel a pairing operation initiated by the Pair method

The key word is "operation". That is, if you start a pairing and then decide not to complete it you can call CancelPairing.

For whatever reason, there is no Unpair DBUS API. To remove a pairing, the entire device should be removed with the Adapter1.RemoveDevice API as documented here

Upvotes: 1

Related Questions