Skip to contentSkip to conversation

Add new method - service discovery

PATCH New Jakub Pawlowski 2 participants 3 messages Oct 23, 2014 – Oct 28, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add new method - service discovery

This path enable usage of start service discovery method. Example usage:

Find all low energy devices advertising service with UUID 'abcd' and TxPower, that have pathloss less than 60 dB btmgmt find-service -u abcd -p 60 -l

Find all low energy devices advertising service with UUID 'abcd', and dont advertise TxPower and with RSSI over -50, or advertising TxPower and pathloss less than 60 dB btmgmt find-service -u abcd -r -50 -p 60 -l

#1 lore raw

PATCH 1/1 Add new method - service discovery

---
 lib/mgmt.h     |  26 ++++++++++++
 tools/btmgmt.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 154 insertions(+)
lib/mgmt.h +26 -0
index 46766a9..8f37937 100644
@@ -445,6 +445,32 @@ struct mgmt_cp_set_public_address {
 	bdaddr_t bdaddr;
 } __packed;
 
+#define MGMT_OP_START_SERVICE_DISCOVERY		0x003A
+
+#define MGMT_RANGE_NONE     0X00
+#define MGMT_RANGE_RSSI     0X01
+#define MGMT_RANGE_PATHLOSS 0X02
+
+struct mgmt_uuid_filter {
+	uint8_t range_method;
+	int8_t pathloss;
+	int8_t rssi;
+	uint8_t uuid[16];
+} __packed;
+
+struct mgmt_cp_start_service_discovery {
+	uint8_t type;
+	uint16_t filter_count;
+	struct mgmt_uuid_filter filter[0];
+} __packed;
+#define MGMT_START_SERVICE_DISCOVERY_SIZE	1
+
+#define MGMT_OP_STOP_SERVICE_DISCOVERY		0x003B
+struct mgmt_cp_stop_service_discovery {
+	uint8_t type;
+} __packed;
+#define MGMT_STOP_SERVICE_DISCOVERY_SIZE	1
+
 #define MGMT_EV_CMD_COMPLETE		0x0001
 struct mgmt_ev_cmd_complete {
 	uint16_t opcode;
tools/btmgmt.c +128 -0

140 lines not on this page · raw message

Signature · 1 line
2.1.0.rc2.206.gedb03e5
maintainer
#2 lore raw

Hi Jakub,

Quoted 4 lines

---
lib/mgmt.h | 26 ++++++++++++
tools/btmgmt.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2 files changed, 154 insertions(+)

patches to lib/ and other directories need to be separated.

Regards

Marcel