diff options
author | Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com> | 2012-01-25 15:41:49 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-01-27 19:31:58 +0100 |
commit | 2c40326fff69f7c8cf89cde14b3a98bcaf55774b (patch) | |
tree | 77ed90764c87f93c9d717da3e39b7bb79c274d1e /src | |
parent | 2b42e25bfad80de03ade5677df14472f7021c87c (diff) | |
download | neard-2c40326fff69f7c8cf89cde14b3a98bcaf55774b.tar.gz neard-2c40326fff69f7c8cf89cde14b3a98bcaf55774b.tar.bz2 neard-2c40326fff69f7c8cf89cde14b3a98bcaf55774b.zip |
target: Provide method to get tag from target structure
Diffstat (limited to 'src')
-rw-r--r-- | src/target.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/target.c b/src/target.c index 0c8e602..aeeed92 100644 --- a/src/target.c +++ b/src/target.c @@ -477,6 +477,24 @@ fail: return NULL; } +struct near_tag *near_target_get_tag(uint32_t adapter_idx, uint32_t target_idx) +{ + struct near_target *target; + char *path; + + path = g_strdup_printf("%s/nfc%d/target%d", NFC_PATH, + adapter_idx, target_idx); + if (path == NULL) + return NULL; + + target = g_hash_table_lookup(target_hash, path); + g_free(path); + if (target == NULL) + return NULL; + + return target->tag; +} + struct near_tag *near_target_add_tag(uint32_t adapter_idx, uint32_t target_idx, size_t data_length) { |