All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] lib/mgmt: Add New Connection Parameter Event
@ 2014-07-01 22:26 Andre Guedes
  2014-07-01 22:26 ` [PATCH 2/2] monitor: Add support for decoding New Connection Parameter event Andre Guedes
  2014-07-01 22:49 ` [PATCH 1/2] lib/mgmt: Add New Connection Parameter Event Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Andre Guedes @ 2014-07-01 22:26 UTC (permalink / raw)
  To: linux-bluetooth

This patch adds struct and macro for New Connection Parameter Event.
---
 lib/mgmt.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/mgmt.h b/lib/mgmt.h
index 6db3883..df4697f 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -564,6 +564,16 @@ struct mgmt_ev_device_removed {
 	struct mgmt_addr_info addr;
 } __packed;
 
+#define MGMT_EV_NEW_CONN_PARAM		0x001c
+struct mgmt_ev_new_conn_param {
+	struct mgmt_addr_info addr;
+	uint8_t store_hint;
+	uint16_t min_interval;
+	uint16_t max_interval;
+	uint16_t latency;
+	uint16_t timeout;
+} __packed;
+
 static const char *mgmt_op[] = {
 	"<0x0000>",
 	"Read Version",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] monitor: Add support for decoding New Connection Parameter event
  2014-07-01 22:26 [PATCH 1/2] lib/mgmt: Add New Connection Parameter Event Andre Guedes
@ 2014-07-01 22:26 ` Andre Guedes
  2014-07-01 22:49 ` [PATCH 1/2] lib/mgmt: Add New Connection Parameter Event Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Andre Guedes @ 2014-07-01 22:26 UTC (permalink / raw)
  To: linux-bluetooth

---
 monitor/control.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/monitor/control.c b/monitor/control.c
index 083f65d..c4568d8 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -580,6 +580,33 @@ static void mgmt_device_removed(uint16_t len, const void *buf)
 	packet_hexdump(buf, len);
 }
 
+static void mgmt_new_conn_param(uint16_t len, const void *buf)
+{
+	const struct mgmt_ev_new_conn_param *ev = buf;
+	char addr[18];
+	uint16_t min, max, latency, timeout;
+
+	if (len < sizeof(*ev)) {
+		printf("* Malformed New Connection Parameter control\n");
+		return;
+	}
+
+	ba2str(&ev->addr.bdaddr, addr);
+	min = le16_to_cpu(ev->min_interval);
+	max = le16_to_cpu(ev->max_interval);
+	latency = le16_to_cpu(ev->latency);
+	timeout = le16_to_cpu(ev->timeout);
+
+	printf("@ New Conn Param: %s (%d) hint %d min 0x%4.4x max 0x%4.4x "
+		"latency 0x%4.4x timeout 0x%4.4x\n", addr, ev->addr.type,
+		ev->store_hint, min, max, latency, timeout);
+
+	buf += sizeof(*ev);
+	len -= sizeof(*ev);
+
+	packet_hexdump(buf, len);
+}
+
 void control_message(uint16_t opcode, const void *data, uint16_t size)
 {
 	switch (opcode) {
@@ -658,6 +685,9 @@ void control_message(uint16_t opcode, const void *data, uint16_t size)
 	case MGMT_EV_DEVICE_REMOVED:
 		mgmt_device_removed(size, data);
 		break;
+	case MGMT_EV_NEW_CONN_PARAM:
+		mgmt_new_conn_param(size, data);
+		break;
 	default:
 		printf("* Unknown control (code %d len %d)\n", opcode, size);
 		packet_hexdump(data, size);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] lib/mgmt: Add New Connection Parameter Event
  2014-07-01 22:26 [PATCH 1/2] lib/mgmt: Add New Connection Parameter Event Andre Guedes
  2014-07-01 22:26 ` [PATCH 2/2] monitor: Add support for decoding New Connection Parameter event Andre Guedes
@ 2014-07-01 22:49 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2014-07-01 22:49 UTC (permalink / raw)
  To: Andre Guedes; +Cc: linux-bluetooth

Hi Andre,

> This patch adds struct and macro for New Connection Parameter Event.
> ---
> lib/mgmt.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)

both patches have been applied.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-01 22:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 22:26 [PATCH 1/2] lib/mgmt: Add New Connection Parameter Event Andre Guedes
2014-07-01 22:26 ` [PATCH 2/2] monitor: Add support for decoding New Connection Parameter event Andre Guedes
2014-07-01 22:49 ` [PATCH 1/2] lib/mgmt: Add New Connection Parameter Event Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.