I am trying to use bluetoothctl (bluez5.42) to register profile. I run bluetoothctl as below:
bluez-5.42/dev/client# ./bluetoothctl
[NEW] Controller 00:50:43:22:29:D9 pe-lt571-0 [default]
[bluetooth]# register-profile 00000017-0000-1000-8000-00805f9
Failed to register profile: org.freedesktop.DBus.Error.UnknownMethod
Just to add I am on Linux kernel 4.4. I have run bluetoothd before I started bluetoothctl. Also, I checked to do the same using d-feet, I got same error.
Why am I getting the unknown method error? Is it some setup issue?
I get the following on dbus monitor
method call sender=:1.89 -> dest=org.bluez serial=20 path=/org/bluez/hci0; interface=org.bluez.GattManager1; member=RegisterProfile
object path "/org/bluez/profile"
array [
string "00000100-0000-1000-8000-00805f9"
]
array [
]
There is no method called RegisterProfile on org.bluez.GattManager1 DBus interface. Its a bug in bluetoothctl code of bluez-5.42, fixed in bluez-5.46. RegisterProfile method is on org.bluez.ProfileManager1 interface.
From bluez-5.46 and later register-profile with bluetoothctl doesn't exist. If you want to register a bluetooth profile, have a look at test/test-hfp python script in bluez source directory. It shows how to use RegisterProfile method on org.bluez.ProfileManager1. Also see doc/profile-api.txt to know about the methods available on this interface.
Or if you want to register GATT services, see test/test-gatt-profile python script and doc/gatt-api.txt in bluez source.