summaryrefslogtreecommitdiff
path: root/profiles/sap
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/sap
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/sap')
-rw-r--r--profiles/sap/manager.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/profiles/sap/manager.c b/profiles/sap/manager.c
index 9fa9c56e5..b563d7b0d 100644
--- a/profiles/sap/manager.c
+++ b/profiles/sap/manager.c
@@ -22,8 +22,11 @@
#include <config.h>
#endif
+#include <stdbool.h>
+
#include "log.h"
#include "adapter.h"
+#include "device.h"
#include "manager.h"
#include "server.h"
@@ -51,10 +54,10 @@ static void sap_server_remove(struct btd_adapter *adapter)
sap_server_unregister(path);
}
-static struct btd_adapter_driver sap_server_driver = {
- .name = "sap-server",
- .probe = sap_server_probe,
- .remove = sap_server_remove,
+static struct btd_profile sap_profile = {
+ .name = "sap-server",
+ .adapter_probe = sap_server_probe,
+ .adapter_remove = sap_server_remove,
};
int sap_manager_init(DBusConnection *conn)
@@ -67,14 +70,14 @@ int sap_manager_init(DBusConnection *conn)
return -1;
}
- btd_register_adapter_driver(&sap_server_driver);
+ btd_profile_register(&sap_profile);
return 0;
}
void sap_manager_exit(void)
{
- btd_unregister_adapter_driver(&sap_server_driver);
+ btd_profile_unregister(&sap_profile);
dbus_connection_unref(connection);
connection = NULL;