diff options
author | Alok Barsode <alok.barsode@azingo.com> | 2008-07-22 19:08:03 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@indt.org.br> | 2008-07-28 10:48:10 -0300 |
commit | d9ff801460ee610f98b97571311e4af13bb8e1a1 (patch) | |
tree | 2751a1d2b368ee3dbec08b245ad3c29130e5a279 /hcid/adapter.c | |
parent | b76fbc7d29f28a95a9ea25aae1f6f2d9c10adb19 (diff) |
Adding adapter_create.
Signed-off-by: Alok Barsode <alok.barsode@azingo.com>
Diffstat (limited to 'hcid/adapter.c')
-rw-r--r-- | hcid/adapter.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c index 2d0d6e21..f760ebd0 100644 --- a/hcid/adapter.c +++ b/hcid/adapter.c @@ -2539,3 +2539,24 @@ int adapter_update_ssp_mode(struct adapter *adapter, int dd, uint8_t mode) return 0; } + +struct adapter *adapter_create(int id) +{ + char path[MAX_PATH_LENGTH]; + struct adapter *adapter; + + snprintf(path, sizeof(path), "/hci%d", id); + + adapter = g_try_new0(struct adapter, 1); + if (!adapter) { + error("Failed to alloc memory to D-Bus path register data (%s)", + path); + return NULL; + } + + adapter->dev_id = id; + adapter->pdiscov_resolve_names = 1; + adapter->path = g_strdup(path); + + return adapter; +} |