summaryrefslogtreecommitdiffstats
path: root/binding/bluetooth-api.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-01-14 01:47:11 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-01-14 16:56:23 -0800
commit11aaf468edbacac397d1d8b20b032eb35cf028ea (patch)
tree0fdfdd973ac6f42c8a295ed0fb8f255f092506d6 /binding/bluetooth-api.c
parenta445a9c8d9bce48af471a4e8ddfb962da051bfd7 (diff)
binding: bluetooth: replace rfkill code with network servicehalibut_7.90.0halibut/7.90.0guppy_6.99.4guppy/6.99.47.90.06.99.4
Remove bluetooth-rfkill.c and replace with agl-service-network calls which in turn allows ConnMan to correctly manage bluetooth rfkill state. Bug-AGL: SPEC-2124 Change-Id: Ibe0460be0f29957f99ea06975a1fa12d01840080 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/bluetooth-api.c')
-rw-r--r--binding/bluetooth-api.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/binding/bluetooth-api.c b/binding/bluetooth-api.c
index 3f66033..52d4f19 100644
--- a/binding/bluetooth-api.c
+++ b/binding/bluetooth-api.c
@@ -544,8 +544,6 @@ static struct bluetooth_state *bluetooth_init(GMainLoop *loop)
g_mutex_init(&ns->cw_mutex);
ns->next_cw_id = 1;
- bluetooth_monitor_init();
-
g_timeout_add_seconds(5, bluetooth_autoconnect, ns);
return ns;
@@ -623,6 +621,7 @@ err_no_loop:
static int init(afb_api_t api)
{
struct init_data init_data, *id = &init_data;
+ json_object *args = NULL;
gint64 end_time;
int ret;
@@ -639,6 +638,16 @@ static int init(afb_api_t api)
return ret;
}
+ ret = afb_daemon_require_api("network-manager", 1);
+ if (ret < 0) {
+ AFB_ERROR("Cannot request network manager service");
+ return ret;
+ }
+
+ args = json_object_new_object();
+ json_object_object_add(args , "technology", json_object_new_string("bluetooth"));
+ afb_api_call_sync(api, "network-manager", "enable_technology", args, NULL, NULL, NULL);
+
global_thread = g_thread_new("agl-service-bluetooth",
bluetooth_func,
id);