Diff between 89bf85768c4fcabb704c957cae56f839ecbbde70 and e496aceafa6b51cf7ca5171ee7c376350039ad05

Changed Files

File Additions Deletions Status
src/device.c +5 -0 modified
src/device.h +1 -0 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index 2268602..af0c593 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 99322b6..0f1f53f 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);