diff options
author | Paulo Alcantara <paulo.alcantara@openbossa.org> | 2012-07-27 16:43:18 -0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-07-29 20:08:40 +0200 |
commit | b1a95619dec73a50fd32c953230ae6d3d11d6f17 (patch) | |
tree | c18ff60ad737d9b60571a7b77e915c9575885d7b /src/storage.c | |
parent | 6ef7f3244870bf0a0530059b439e40205d80758e (diff) |
storage: Store address type in "profiles" file
Diffstat (limited to 'src/storage.c')
-rw-r--r-- | src/storage.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/storage.c b/src/storage.c index c10f9aed..05fb0a8c 100644 --- a/src/storage.c +++ b/src/storage.c @@ -807,9 +807,10 @@ gboolean read_trust(const bdaddr_t *local, const char *addr, const char *service return ret; } -int write_device_profiles(bdaddr_t *src, bdaddr_t *dst, const char *profiles) +int write_device_profiles(bdaddr_t *src, bdaddr_t *dst, uint8_t dst_type, + const char *profiles) { - char filename[PATH_MAX + 1], addr[18]; + char filename[PATH_MAX + 1], key[20]; if (!profiles) return -EINVAL; @@ -818,8 +819,10 @@ int write_device_profiles(bdaddr_t *src, bdaddr_t *dst, const char *profiles) create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - ba2str(dst, addr); - return textfile_put(filename, addr, profiles); + ba2str(dst, key); + sprintf(&key[17], "#%hhu", dst_type); + + return textfile_put(filename, key, profiles); } int delete_entry(bdaddr_t *src, const char *storage, bdaddr_t *dst, |