OSDN Git Service

device: Add device_name_known convenience function
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 11 Oct 2012 10:07:32 +0000 (12:07 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 12 Oct 2012 15:02:34 +0000 (18:02 +0300)
src/device.c
src/device.h

index 2268602..af0c593 100644 (file)
@@ -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;
index 99322b6..0f1f53f 100644 (file)
@@ -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);