summaryrefslogtreecommitdiff
path: root/profiles/deviceinfo
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-09-03 14:11:36 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-09-03 14:16:15 +0300
commit813b674bce1aab009e7f2d14d1825f603330563d (patch)
treecae198a1ee959b3cafd9f528e8c3ccacebbd77ae /profiles/deviceinfo
parentc7c092bca3f13348f2f92e72999ee585f98e7974 (diff)
downloadbluez-813b674bce1aab009e7f2d14d1825f603330563d.tar.gz
Add profile abstraction (replaces btd_device drivers)
This patch removes the btd_device_driver concept and replaces it with btd_profile. The new construct also contains the necessary parts for adapter drivers, so btd_adapter_driver is only needed for non-profile related functionality (most of which is in plugins/*). The main purpose of this new construct is to facilitate a centralized connection creation mechanism for profiles, ultimately enabling the addition of a Device.Connect() method instead of requiring a UI to know to call e.g. Input.Connect or Audio.Connect. This feature will also be extended to externally implemented profiles once the internal implementation gets more stable, such as OBEX (obexd) and HFP (oFono). The new D-Bus interface will also partially restore functionality which was previously available through the Serial interface.
Diffstat (limited to 'profiles/deviceinfo')
-rw-r--r--profiles/deviceinfo/deviceinfo.c2
-rw-r--r--profiles/deviceinfo/manager.c15
2 files changed, 10 insertions, 7 deletions
diff --git a/profiles/deviceinfo/deviceinfo.c b/profiles/deviceinfo/deviceinfo.c
index ca849adfd..e7c442fac 100644
--- a/profiles/deviceinfo/deviceinfo.c
+++ b/profiles/deviceinfo/deviceinfo.c
@@ -24,6 +24,8 @@
#include <config.h>
#endif
+#include <stdbool.h>
+
#include <glib.h>
#include <bluetooth/uuid.h>
diff --git a/profiles/deviceinfo/manager.c b/profiles/deviceinfo/manager.c
index 1d5991871..914ec4060 100644
--- a/profiles/deviceinfo/manager.c
+++ b/profiles/deviceinfo/manager.c
@@ -22,6 +22,7 @@
#include <glib.h>
#include <errno.h>
+#include <stdbool.h>
#include <bluetooth/uuid.h>
#include "adapter.h"
@@ -62,19 +63,19 @@ static void deviceinfo_driver_remove(struct btd_device *device)
deviceinfo_unregister(device);
}
-static struct btd_device_driver deviceinfo_device_driver = {
- .name = "deviceinfo-driver",
- .uuids = BTD_UUIDS(DEVICE_INFORMATION_UUID),
- .probe = deviceinfo_driver_probe,
- .remove = deviceinfo_driver_remove
+static struct btd_profile deviceinfo_profile = {
+ .name = "deviceinfo",
+ .remote_uuids = BTD_UUIDS(DEVICE_INFORMATION_UUID),
+ .device_probe = deviceinfo_driver_probe,
+ .device_remove = deviceinfo_driver_remove
};
int deviceinfo_manager_init(void)
{
- return btd_register_device_driver(&deviceinfo_device_driver);
+ return btd_profile_register(&deviceinfo_profile);
}
void deviceinfo_manager_exit(void)
{
- btd_unregister_device_driver(&deviceinfo_device_driver);
+ btd_profile_unregister(&deviceinfo_profile);
}