summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrédéric Danis <frederic.danis@linux.intel.com>2012-10-24 16:34:04 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-10-25 12:33:14 +0300
commit284af7784999c5ffad91d04f48e4c99bffee86de (patch)
tree0fbd5a3284380894aaf360a7aba8457d7d42391f /src
parent7ad6749035e0a3358833083928b858c6412e0093 (diff)
adapter: Read name in storage at init
Diffstat (limited to 'src')
-rw-r--r--src/adapter.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 9ed8af2c..6333837d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2497,6 +2497,18 @@ void btd_adapter_unref(struct btd_adapter *adapter)
g_free(path);
}
+static void load_config(struct btd_adapter *adapter)
+{
+ char name[MAX_NAME_LENGTH + 1];
+
+ /* Get name */
+ if (read_local_name(&adapter->bdaddr, name) < 0)
+ adapter->name = NULL;
+ else
+ adapter->name = g_strdup(name);
+
+}
+
gboolean adapter_init(struct btd_adapter *adapter, gboolean up)
{
adapter->up = up;
@@ -2516,6 +2528,7 @@ gboolean adapter_init(struct btd_adapter *adapter, gboolean up)
if (main_opts.gatt_enabled)
btd_adapter_gatt_server_start(adapter);
+ load_config(adapter);
load_drivers(adapter);
btd_profile_foreach(probe_profile, adapter);
clear_blocked(adapter);