Re: [PATCH 3/4] sdp: Make sdp_record_add to be handled by adapter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Grzegorz,

On 26/08/2013 15:07, Grzegorz Kolodziejczyk wrote:
<snip>
diff --git a/src/adapter.c b/src/adapter.c
index fd20d61..8e897ce 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -6307,6 +6307,37 @@ void adapter_start_sdp_server(uint16_t sdp_mtu, uint32_t sdp_flags) {
  		adapter_foreach(adapter_service_insert, services->data);
  }

+int adapter_add_record_to_server(const bdaddr_t *device, sdp_record_t *rec)
+{
+	int chck;
+	struct btd_adapter *adapter;
+
+	chck = add_record_to_server(device, rec);
+
+	//  Check if rec handle error occure
+	//
+	//  0       - Ok
+	//
+	//  handle == 0xffffffff
+	//  -ENOSPC - next handle < 0x10000
+	//
+	//  -EEXIST - record already exist

Please use C89 coding style for comments, like defined for the Linux kernel. I.e.:
	/*
	 * comment
	 * comment
	 */

+	if (chck == 0) {
+		//  Add rec for each adapter

idem here ( /* comment */ )

+		if (bacmp(device, BDADDR_ANY) == 0) {
+			adapter_foreach(adapter_service_insert, rec);
+			return chck;
+		}
+
+		//  Add rec for single adapter

and here

+		adapter = adapter_find(device);
+		if (adapter)
+			adapter_service_insert(adapter, rec);
+	}
+
+	return chck;
+}
+

Regards

Fred

--
Frederic Danis                            Open Source Technology Center
frederic.danis@xxxxxxxxx                              Intel Corporation

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux