diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-10-11 12:07:32 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-10-12 18:02:34 +0300 |
commit | e496aceafa6b51cf7ca5171ee7c376350039ad05 (patch) | |
tree | 80599599b749bbefc0f62fa382ef614ff2bfaefb /src | |
parent | 89bf85768c4fcabb704c957cae56f839ecbbde70 (diff) |
device: Add device_name_known convenience function
Diffstat (limited to 'src')
-rw-r--r-- | src/device.c | 5 | ||||
-rw-r--r-- | src/device.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c index 22686028..af0c5937 100644 --- a/src/device.c +++ b/src/device.c @@ -1536,6 +1536,11 @@ void device_get_name(struct btd_device *device, char *name, size_t len) strncpy(name, device->name, len); } +bool device_name_known(struct btd_device *device) +{ + return device->name[0] != '\0'; +} + uint16_t btd_device_get_vendor(struct btd_device *device) { return device->vendor; diff --git a/src/device.h b/src/device.h index 99322b68..0f1f53f9 100644 --- a/src/device.h +++ b/src/device.h @@ -31,6 +31,7 @@ struct btd_device *device_create(struct btd_adapter *adapter, void device_set_name(struct btd_device *device, const char *name); void device_get_name(struct btd_device *device, char *name, size_t len); +bool device_name_known(struct btd_device *device); uint16_t btd_device_get_vendor(struct btd_device *device); uint16_t btd_device_get_vendor_src(struct btd_device *device); uint16_t btd_device_get_product(struct btd_device *device); |