Skip to contentSkip to conversation

doc/adapter-api.txt: StartFilteredDiscovery method.

PATCH Superseded Jakub Pawlowski 2 participants 2 messages Dec 12, 2014 Bluetooth drivers

v3 of 13 Superseded Latest is v13 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 doc/adapter-api.txt: StartFilteredDiscovery method.

This patch proposes new method, StartFilteredDiscovery to D-Bus Adapter API for desktop bluetoothd. It will allow for rapid discovery of nearby devices that advertise services.

---
 doc/adapter-api.txt | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
doc/adapter-api.txt +34 -0
index 74d235a..7e688ef 100644
@@ -22,6 +22,40 @@ Methods		void StartDiscovery()
 			Possible errors: org.bluez.Error.NotReady
 					 org.bluez.Error.Failed
 
+		void StartFilteredDiscovery(dict filter, string transport)
+
+			This method starts the device discovery session with
+			filtering by uuids, and rssi or pathloss value. Use
+			StopDiscovery to release the sessions acquired.
+
+			transport parameter:
+				"auto"	- interleaved scan, default value
+				"bredr"	- br/edr inquiry
+				"le"	- le only scan
+
+ 			Parameters that can be set in filter dictionary include
+ 			the following:
+
+			array{string} UUIDs : filtered service UUIDs (required)
+			int16 RSSI	: RSSI threshold value (optional)
+			uint16 pathloss	: Pathloss threshold value (optional)
+
+			When a device is found that advertise any UUID from
+			UUIDs, it will be reported if:
+			- pathloss and RSSI are both empty,
+			- only pathloss param is set, device advertise TX pwer, 
+			  and computed pathloss is less than pathloss param,
+			- only RSSI param is set, and received RSSI is higher
+			  than RSSI param,
+
+			This process will start creating Device objects as new
+			devices matching criteria are discovered. It will also
+			emit PropertiesChanged signal for already existing
+			Device objects, with updated RSSI value.
+
+			Possible errors: org.bluez.Error.NotReady
+					 org.bluez.Error.Failed
+
 		void StopDiscovery()
 
 			This method will cancel any previous StartDiscovery
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#1 lore raw

Hi Jakub,

Quoted 16 lines · Jakub Pawlowski

This patch proposes new method, StartFilteredDiscovery to D-Bus Adapter API for desktop bluetoothd. It will allow for rapid discovery of nearby devices that advertise services.

---
 doc/adapter-api.txt | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
doc/adapter-api.txt +0 -0
index 74d235a..7e688ef 100644
@@ -22,6 +22,40 @@ Methods              void StartDiscovery()
                        Possible errors: org.bluez.Error.NotReady

doc/adapter-api.txt Methods void StartDiscovery() · line 32

Quoted 10 lines
doc/adapter-api.txt +8 -0
                                         org.bluez.Error.Failed
 
+               void StartFilteredDiscovery(dict filter, string transport)
+
+                       This method starts the device discovery session with
+                       filtering by uuids, and rssi or pathloss value. Use
+                       StopDiscovery to release the sessions acquired.
+
+                       transport parameter:
+                               "auto"  - interleaved scan, default value

I would explain this a little further, just saying "default value" doesn't seem to do it justice. Say that "auto" will cause a BR/EDR & LE interleaved scan on dual-mode controllers, on single-mode (LE-only/BREDR-only) controllers it will work on whatever the controller supports.

Quoted 15 lines
doc/adapter-api.txt +15 -0
+                               "bredr" - br/edr inquiry
+                               "le"    - le only scan
+
+                       Parameters that can be set in filter dictionary include
+                       the following:
+
+                       array{string} UUIDs : filtered service UUIDs (required)
+                       int16 RSSI      : RSSI threshold value (optional)
+                       uint16 pathloss : Pathloss threshold value (optional)
+
+                       When a device is found that advertise any UUID from
+                       UUIDs, it will be reported if:
+                       - pathloss and RSSI are both empty,
+                       - only pathloss param is set, device advertise TX pwer,
+                         and computed pathloss is less than pathloss param,

doc/adapter-api.txt Methods void StartDiscovery() · line 57

Quoted 10 lines
doc/adapter-api.txt +10 -0
+                       - only RSSI param is set, and received RSSI is higher
+                         than RSSI param,
+
+                       This process will start creating Device objects as new
+                       devices matching criteria are discovered. It will also
+                       emit PropertiesChanged signal for already existing
+                       Device objects, with updated RSSI value.
+
+                       Possible errors: org.bluez.Error.NotReady
+                                        org.bluez.Error.Failed

You probably want to add org.bluez.Error.InvalidArguments as a possible error. You'll have to check that the filter dictionary contains values of the correct type (since it's type is a{sv}) and the "transport" argument contains auto/le/bredr. For anything else, you should return the InvalidArguments error.

Quoted 11 lines
doc/adapter-api.txt +1 -1
+
                void StopDiscovery()
 
                        This method will cancel any previous StartDiscovery
--

2.2.0.rc0.207.ga3a616c

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

Thanks,
Arman