Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v2] neard: Set device name in cache
From: Frédéric Danis @ 2012-11-07 14:40 UTC (permalink / raw)
  To: linux-bluetooth

If device existed previously, it has been removed before calling of
btd_event_remote_name(), so this just update storage cache and name
property change of device object is not emitted.
---
 plugins/neard.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/neard.c b/plugins/neard.c
index 8018977..8f8381c 100644
--- a/plugins/neard.c
+++ b/plugins/neard.c
@@ -42,6 +42,7 @@
 #include "storage.h"
 #include "agent.h"
 #include "hcid.h"
+#include "event.h"
 
 #define NEARD_NAME "org.neard"
 #define NEARD_PATH "/"
@@ -293,8 +294,8 @@ static int process_eir(struct btd_adapter *adapter, uint8_t *eir, size_t size,
 
 	/* TODO handle incomplete name? */
 	if (eir_data.name)
-		write_device_name(adapter_get_address(adapter), &eir_data.addr,
-						BDADDR_BREDR, eir_data.name);
+		btd_event_remote_name(adapter_get_address(adapter),
+					&eir_data.addr, eir_data.name);
 
 	if (eir_data.hash)
 		btd_adapter_add_remote_oob_data(adapter, &eir_data.addr,
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH BlueZ 1/2] AVRCP: Add supported events field to session structure
From: Johan Hedberg @ 2012-11-07 14:35 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1352284442-6855-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Wed, Nov 07, 2012, Luiz Augusto von Dentz wrote:
> This simplify detecting which events are available depending on the role
> and version of the session.
> ---
>  audio/avrcp.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)

Both patches have been applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH BlueZ 1/2] AVRCP: Add supported events field to session structure
From: Lucas De Marchi @ 2012-11-07 14:15 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1352284442-6855-1-git-send-email-luiz.dentz@gmail.com>

On Wed, Nov 7, 2012 at 8:34 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This simplify detecting which events are available depending on the role
> and version of the session.
> ---
>  audio/avrcp.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/audio/avrcp.c b/audio/avrcp.c
> index 3d9ecc7..ab9ffbf 100644
> --- a/audio/avrcp.c
> +++ b/audio/avrcp.c
> @@ -197,6 +197,7 @@ struct avrcp {
>
>         unsigned int control_id;
>         unsigned int browsing_id;
> +       uint16_t supported_events;
>         uint16_t registered_events;
>         uint8_t transaction;
>         uint8_t transaction_events[AVRCP_EVENT_LAST + 1];
> @@ -858,12 +859,12 @@ static uint8_t avrcp_handle_get_capabilities(struct avrcp *session,
>
>                 return AVC_CTYPE_STABLE;
>         case CAP_EVENTS_SUPPORTED:
> -               pdu->params[1] = 5;
> -               pdu->params[2] = AVRCP_EVENT_STATUS_CHANGED;
> -               pdu->params[3] = AVRCP_EVENT_TRACK_CHANGED;
> -               pdu->params[4] = AVRCP_EVENT_TRACK_REACHED_START;
> -               pdu->params[5] = AVRCP_EVENT_TRACK_REACHED_END;
> -               pdu->params[6] = AVRCP_EVENT_SETTINGS_CHANGED;
> +               for (i = 0; i <= AVRCP_EVENT_LAST; i++) {
> +                       if (session->supported_events & (1 << i)) {
> +                               pdu->params[1]++;
> +                               pdu->params[pdu->params[1] + 1] = i;
> +                       }
> +               }
>
>                 pdu->params_len = htons(2 + pdu->params[1]);
>                 return AVC_CTYPE_STABLE;
> @@ -2064,6 +2065,11 @@ static void session_tg_init(struct avrcp *session)
>         }
>
>         session->control_handlers = tg_control_handlers;
> +       session->supported_events = (1 << AVRCP_EVENT_STATUS_CHANGED) |
> +                               (1 << AVRCP_EVENT_TRACK_CHANGED) |
> +                               (1 << AVRCP_EVENT_TRACK_REACHED_START) |
> +                               (1 << AVRCP_EVENT_TRACK_REACHED_END) |
> +                               (1 << AVRCP_EVENT_SETTINGS_CHANGED);
>
>         if (session->version >= 0x0104) {
>                 avrcp_register_notification(session,
> --
> 1.7.11.7
>

Ack

Lucas De Marchi

^ permalink raw reply

* [PATCH] neard: Set device name in cache and device object
From: Frédéric Danis @ 2012-11-07 11:02 UTC (permalink / raw)
  To: linux-bluetooth

---
 plugins/neard.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/neard.c b/plugins/neard.c
index 8018977..8f8381c 100644
--- a/plugins/neard.c
+++ b/plugins/neard.c
@@ -42,6 +42,7 @@
 #include "storage.h"
 #include "agent.h"
 #include "hcid.h"
+#include "event.h"
 
 #define NEARD_NAME "org.neard"
 #define NEARD_PATH "/"
@@ -293,8 +294,8 @@ static int process_eir(struct btd_adapter *adapter, uint8_t *eir, size_t size,
 
 	/* TODO handle incomplete name? */
 	if (eir_data.name)
-		write_device_name(adapter_get_address(adapter), &eir_data.addr,
-						BDADDR_BREDR, eir_data.name);
+		btd_event_remote_name(adapter_get_address(adapter),
+					&eir_data.addr, eir_data.name);
 
 	if (eir_data.hash)
 		btd_adapter_add_remote_oob_data(adapter, &eir_data.addr,
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH BlueZ 2/2] AVRCP: Add support for GetCapabilities PDU when acting as controller
From: Luiz Augusto von Dentz @ 2012-11-07 10:34 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1352284442-6855-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds GetCapabilities PDU id to controller handlers vtable so it is
able to respond it properly.
---
 audio/avrcp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/audio/avrcp.c b/audio/avrcp.c
index ab9ffbf..e3ce2fb 100644
--- a/audio/avrcp.c
+++ b/audio/avrcp.c
@@ -1412,6 +1412,8 @@ static const struct control_pdu_handler tg_control_handlers[] = {
 };
 
 static const struct control_pdu_handler ct_control_handlers[] = {
+		{ AVRCP_GET_CAPABILITIES, AVC_CTYPE_STATUS,
+					avrcp_handle_get_capabilities },
 		{ },
 };
 
-- 
1.7.11.7


^ permalink raw reply related

* [PATCH BlueZ 1/2] AVRCP: Add supported events field to session structure
From: Luiz Augusto von Dentz @ 2012-11-07 10:34 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This simplify detecting which events are available depending on the role
and version of the session.
---
 audio/avrcp.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/audio/avrcp.c b/audio/avrcp.c
index 3d9ecc7..ab9ffbf 100644
--- a/audio/avrcp.c
+++ b/audio/avrcp.c
@@ -197,6 +197,7 @@ struct avrcp {
 
 	unsigned int control_id;
 	unsigned int browsing_id;
+	uint16_t supported_events;
 	uint16_t registered_events;
 	uint8_t transaction;
 	uint8_t transaction_events[AVRCP_EVENT_LAST + 1];
@@ -858,12 +859,12 @@ static uint8_t avrcp_handle_get_capabilities(struct avrcp *session,
 
 		return AVC_CTYPE_STABLE;
 	case CAP_EVENTS_SUPPORTED:
-		pdu->params[1] = 5;
-		pdu->params[2] = AVRCP_EVENT_STATUS_CHANGED;
-		pdu->params[3] = AVRCP_EVENT_TRACK_CHANGED;
-		pdu->params[4] = AVRCP_EVENT_TRACK_REACHED_START;
-		pdu->params[5] = AVRCP_EVENT_TRACK_REACHED_END;
-		pdu->params[6] = AVRCP_EVENT_SETTINGS_CHANGED;
+		for (i = 0; i <= AVRCP_EVENT_LAST; i++) {
+			if (session->supported_events & (1 << i)) {
+				pdu->params[1]++;
+				pdu->params[pdu->params[1] + 1] = i;
+			}
+		}
 
 		pdu->params_len = htons(2 + pdu->params[1]);
 		return AVC_CTYPE_STABLE;
@@ -2064,6 +2065,11 @@ static void session_tg_init(struct avrcp *session)
 	}
 
 	session->control_handlers = tg_control_handlers;
+	session->supported_events = (1 << AVRCP_EVENT_STATUS_CHANGED) |
+				(1 << AVRCP_EVENT_TRACK_CHANGED) |
+				(1 << AVRCP_EVENT_TRACK_REACHED_START) |
+				(1 << AVRCP_EVENT_TRACK_REACHED_END) |
+				(1 << AVRCP_EVENT_SETTINGS_CHANGED);
 
 	if (session->version >= 0x0104) {
 		avrcp_register_notification(session,
-- 
1.7.11.7


^ permalink raw reply related

* Re: About a newer bluez version
From: Johan Hedberg @ 2012-11-06 22:29 UTC (permalink / raw)
  To: Pacho Ramos; +Cc: linux-bluetooth
In-Reply-To: <1352233126.15613.19.camel@belkin4>

Hi Pacho,

On Tue, Nov 06, 2012, Pacho Ramos wrote:
> Looks like there are a lot of fixed committed to git since bluez-4.101,
> do you plan to release a new tarball including them soon?

The reason why there has been a longer delay is that we're busy
preparing BlueZ 5. The target is to have 5.0 out still this year.

Johan

^ permalink raw reply

* [PATCH 3/3] Bluetooth: Fix updating advertising state flags and data
From: Johan Hedberg @ 2012-11-06 22:06 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1352239600-5840-1-git-send-email-johan.hedberg@gmail.com>

From: Johan Hedberg <johan.hedberg@intel.com>

This patch adds a callback for the HCI_LE_Set_Advertise_Enable command.
The callback is responsible for updating the HCI_LE_PERIPHERAL flag
updating as well as updating the advertising data flags field to
indicate undirected connectable advertising.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 include/net/bluetooth/hci.h |    2 ++
 net/bluetooth/hci_event.c   |   31 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 705e2f0..a7ed8fe 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -957,6 +957,8 @@ struct hci_cp_le_set_adv_data {
 	__u8		data[HCI_MAX_AD_LENGTH];
 } __packed;
 
+#define HCI_OP_LE_SET_ADV_ENABLE	0x200a
+
 #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
 struct hci_cp_le_set_scan_param {
 	__u8    type;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 7caea1a..9f5c5f2 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1190,6 +1190,33 @@ static void hci_cc_read_local_oob_data_reply(struct hci_dev *hdev,
 	hci_dev_unlock(hdev);
 }
 
+static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb)
+{
+	__u8 *sent, status = *((__u8 *) skb->data);
+
+	BT_DBG("%s status 0x%2.2x", hdev->name, status);
+
+	sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADV_ENABLE);
+	if (!sent)
+		return;
+
+	hci_dev_lock(hdev);
+
+	if (!status) {
+		if (*sent)
+			set_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags);
+		else
+			clear_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags);
+	}
+
+	hci_dev_unlock(hdev);
+
+	if (!test_bit(HCI_INIT, &hdev->flags))
+		hci_update_ad(hdev);
+
+	hci_req_complete(hdev, HCI_OP_LE_SET_ADV_ENABLE, status);
+}
+
 static void hci_cc_le_set_scan_param(struct hci_dev *hdev, struct sk_buff *skb)
 {
 	__u8 status = *((__u8 *) skb->data);
@@ -2585,6 +2612,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 		hci_cc_le_set_scan_param(hdev, skb);
 		break;
 
+	case HCI_OP_LE_SET_ADV_ENABLE:
+		hci_cc_le_set_adv_enable(hdev, skb);
+		break;
+
 	case HCI_OP_LE_SET_SCAN_ENABLE:
 		hci_cc_le_set_scan_enable(hdev, skb);
 		break;
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH 2/3] Bluetooth: Add support for setting LE advertising data
From: Johan Hedberg @ 2012-11-06 22:06 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1352239600-5840-1-git-send-email-johan.hedberg@gmail.com>

From: Johan Hedberg <johan.hedberg@intel.com>

This patch adds support for setting basing LE advertising data. The
three elements supported for now are the advertising flags, the TX power
and the friendly name.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 include/net/bluetooth/hci.h      |   15 ++++++
 include/net/bluetooth/hci_core.h |    4 ++
 net/bluetooth/hci_core.c         |   97 ++++++++++++++++++++++++++++++++++++++
 net/bluetooth/hci_event.c        |   11 ++++-
 4 files changed, 126 insertions(+), 1 deletion(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 344fea0..705e2f0 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -338,6 +338,13 @@ enum {
 #define EIR_SSP_RAND_R		0x0F /* Simple Pairing Randomizer R */
 #define EIR_DEVICE_ID		0x10 /* device ID */
 
+/* Low Energy Advertising Flags */
+#define LE_AD_LIMITED		0x01 /* Limited Discoverable */
+#define LE_AD_GENERAL		0x02 /* General Discoverable */
+#define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
+#define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
+#define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
+
 /* -----  HCI Commands ---- */
 #define HCI_OP_NOP			0x0000
 
@@ -942,6 +949,14 @@ struct hci_rp_le_read_adv_tx_power {
 	__s8	tx_power;
 } __packed;
 
+#define HCI_MAX_AD_LENGTH		31
+
+#define HCI_OP_LE_SET_ADV_DATA		0x2008
+struct hci_cp_le_set_adv_data {
+	__u8		length;
+	__u8		data[HCI_MAX_AD_LENGTH];
+} __packed;
+
 #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
 struct hci_cp_le_set_scan_param {
 	__u8    type;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ce6dbeb..ef5b85d 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -279,6 +279,8 @@ struct hci_dev {
 	struct le_scan_params	le_scan_params;
 
 	__s8			adv_tx_power;
+	__u8			adv_data[HCI_MAX_AD_LENGTH];
+	__u8			adv_data_len;
 
 	int (*open)(struct hci_dev *hdev);
 	int (*close)(struct hci_dev *hdev);
@@ -734,6 +736,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
 								u8 *randomizer);
 int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
 
+int hci_update_ad(struct hci_dev *hdev);
+
 void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
 
 int hci_recv_frame(struct sk_buff *skb);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 0af08f3..0af3ea8 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -594,6 +594,102 @@ done:
 	return err;
 }
 
+static u16 create_ad(struct hci_dev *hdev, u8 *data)
+{
+	u8 *ptr = data;
+	u16 ad_len = 0;
+	size_t name_len;
+	u8 flags = 0;
+
+	if (test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags))
+		flags |= LE_AD_GENERAL;
+
+	if (!lmp_bredr_capable(hdev))
+		flags |= LE_AD_NO_BREDR;
+
+	if (lmp_le_br_capable(hdev))
+		flags |= LE_AD_SIM_LE_BREDR_CTRL;
+
+	if (lmp_host_le_br_capable(hdev))
+		flags |= LE_AD_SIM_LE_BREDR_HOST;
+
+	if (flags) {
+		BT_DBG("adv flags 0x%02x", flags);
+
+		ptr[0] = 2;
+		ptr[1] = EIR_FLAGS;
+		ptr[2] = flags;
+
+		ad_len += 3;
+		ptr += 3;
+	}
+
+	if (hdev->adv_tx_power != HCI_TX_POWER_INVALID) {
+		ptr[0] = 2;
+		ptr[1] = EIR_TX_POWER;
+		ptr[2] = (u8) hdev->adv_tx_power;
+
+		ad_len += 3;
+		ptr += 3;
+	}
+
+	name_len = strlen(hdev->dev_name);
+	if (name_len > 0) {
+		size_t max_len = HCI_MAX_AD_LENGTH - ad_len - 2;
+
+		if (name_len > max_len) {
+			name_len = max_len;
+			ptr[1] = EIR_NAME_SHORT;
+		} else
+			ptr[1] = EIR_NAME_COMPLETE;
+
+		ptr[0] = name_len + 1;
+
+		memcpy(ptr + 2, hdev->dev_name, name_len);
+
+		ad_len += (name_len + 2);
+		ptr += (name_len + 2);
+	}
+
+	return ad_len;
+}
+
+int hci_update_ad(struct hci_dev *hdev)
+{
+	struct hci_cp_le_set_adv_data cp;
+	u16 len;
+	int err;
+
+	hci_dev_lock(hdev);
+
+	if (!lmp_le_capable(hdev)) {
+		err = -EINVAL;
+		goto unlock;
+	}
+
+	memset(&cp, 0, sizeof(cp));
+
+	len = create_ad(hdev, cp.data);
+
+	if (hdev->adv_data_len == len &&
+	    memcmp(cp.data, hdev->adv_data, len) == 0) {
+		err = 0;
+		goto unlock;
+	}
+
+	memcpy(hdev->adv_data, cp.data, sizeof(cp.data));
+	hdev->adv_data_len = len;
+
+	cp.length = cpu_to_le16(len);
+
+	err = hci_send_cmd(hdev, HCI_OP_LE_SET_ADV_DATA, sizeof(cp), &cp);
+
+unlock:
+	hci_dev_unlock(hdev);
+
+	return err;
+}
+
 /* ---- HCI ioctl helpers ---- */
 
 int hci_dev_open(__u16 dev)
@@ -651,6 +747,7 @@ int hci_dev_open(__u16 dev)
 		hci_dev_hold(hdev);
 		set_bit(HCI_UP, &hdev->flags);
 		hci_notify(hdev, HCI_DEV_UP);
+		hci_update_ad(hdev);
 		if (!test_bit(HCI_SETUP, &hdev->dev_flags) &&
 		    mgmt_valid_hdev(hdev)) {
 			hci_dev_lock(hdev);
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 09c6571..7caea1a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -204,6 +204,9 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
 	hdev->discovery.state = DISCOVERY_STOPPED;
 	hdev->inq_tx_power = HCI_TX_POWER_INVALID;
 	hdev->adv_tx_power = HCI_TX_POWER_INVALID;
+
+	memset(hdev->adv_data, 0, sizeof(hdev->adv_data));
+	hdev->adv_data_len = 0;
 }
 
 static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
@@ -226,6 +229,9 @@ static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
 
 	hci_dev_unlock(hdev);
 
+	if (!status && !test_bit(HCI_INIT, &hdev->flags))
+		hci_update_ad(hdev);
+
 	hci_req_complete(hdev, HCI_OP_WRITE_LOCAL_NAME, status);
 }
 
@@ -1091,8 +1097,11 @@ static void hci_cc_le_read_adv_tx_power(struct hci_dev *hdev,
 
 	BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
 
-	if (!rp->status)
+	if (!rp->status) {
 		hdev->adv_tx_power = rp->tx_power;
+		if (!test_bit(HCI_INIT, &hdev->flags))
+			hci_update_ad(hdev);
+	}
 
 	hci_req_complete(hdev, HCI_OP_LE_READ_ADV_TX_POWER, rp->status);
 }
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH 1/3] Bluetooth: Use proper invalid value for tx_power
From: Johan Hedberg @ 2012-11-06 22:06 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

The core specification defines 127 as the "not available" value (well,
"reserved" for BR/EDR and "not available" for LE - but essentially the
same). Therefore, instead of testing for 0 (which is in fact a valid
value) we should be using this invalid value to test if the tx_power is
available.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 include/net/bluetooth/hci.h |    3 +++
 net/bluetooth/hci_core.c    |    2 ++
 net/bluetooth/hci_event.c   |    2 ++
 net/bluetooth/mgmt.c        |    2 +-
 4 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 6c414f4..344fea0 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -319,6 +319,9 @@ enum {
 #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
 #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
 
+/* The core spec defines 127 as the "not available" value */
+#define HCI_TX_POWER_INVALID	127
+
 /* Extended Inquiry Response field types */
 #define EIR_FLAGS		0x01 /* flags */
 #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index c68c409..0af08f3 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1606,6 +1606,8 @@ struct hci_dev *hci_alloc_dev(void)
 	hdev->esco_type = (ESCO_HV1);
 	hdev->link_mode = (HCI_LM_ACCEPT);
 	hdev->io_capability = 0x03; /* No Input No Output */
+	hdev->inq_tx_power = HCI_TX_POWER_INVALID;
+	hdev->adv_tx_power = HCI_TX_POWER_INVALID;
 
 	hdev->sniff_max_interval = 800;
 	hdev->sniff_min_interval = 80;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c08ac7c..09c6571 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -202,6 +202,8 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
 			     BIT(HCI_PERIODIC_INQ));
 
 	hdev->discovery.state = DISCOVERY_STOPPED;
+	hdev->inq_tx_power = HCI_TX_POWER_INVALID;
+	hdev->adv_tx_power = HCI_TX_POWER_INVALID;
 }
 
 static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 26a0984..ad1054f 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -485,7 +485,7 @@ static void create_eir(struct hci_dev *hdev, u8 *data)
 		ptr += (name_len + 2);
 	}
 
-	if (hdev->inq_tx_power) {
+	if (hdev->inq_tx_power != HCI_TX_POWER_INVALID) {
 		ptr[0] = 2;
 		ptr[1] = EIR_TX_POWER;
 		ptr[2] = (u8) hdev->inq_tx_power;
-- 
1.7.10.4


^ permalink raw reply related

* About a newer bluez version
From: Pacho Ramos @ 2012-11-06 20:18 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]

Hello

Looks like there are a lot of fixed committed to git since bluez-4.101,
do you plan to release a new tarball including them soon?

Thanks for the info

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* [PATCH] bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027]
From: Marcos Chaparro @ 2012-11-06 19:19 UTC (permalink / raw)
  To: gustavo, marcel, johan.hedberg, linux-bluetooth
  Cc: linux-kernel, Marcos Chaparro

Added Atheros AR3011 internal bluetooth device found in Sony VAIO VPCEH to the
devices list.
Before this, the bluetooth module was identified as an Foxconn / Hai bluetooth
device [0489:e027], now it claims to be an AtherosAR3011 Bluetooth
[0cf3:3005].

T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0489 ProdID=e027 Rev= 0.01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Signed-off-by: Marcos Chaparro <marcos@mrkindustries.com.ar>
---
 drivers/bluetooth/ath3k.c |    1 +
 drivers/bluetooth/btusb.c |    1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index fc2de55..b00000e 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -67,6 +67,7 @@ static struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x13d3, 0x3304) },
 	{ USB_DEVICE(0x0930, 0x0215) },
 	{ USB_DEVICE(0x0489, 0xE03D) },
+	{ USB_DEVICE(0x0489, 0xE027) },
 
 	/* Atheros AR9285 Malbec with sflash firmware */
 	{ USB_DEVICE(0x03F0, 0x311D) },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index debda27..ee82f2f 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -124,6 +124,7 @@ static struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
 	{ USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
 	{ USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
+	{ USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE },
 
 	/* Atheros AR9285 Malbec with sflash firmware */
 	{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH] ath3k: Add support for VAIO VPCEH [0489:e027]
From: Gustavo Padovan @ 2012-11-06 11:02 UTC (permalink / raw)
  To: Marcos Chaparro
  Cc: Marcel Holtmann, Johan Hedberg, linux-bluetooth, linux-kernel
In-Reply-To: <201211012138.20988.marcos@mrkindustries.com.ar>

Hi Marcos, 

* Marcos Chaparro <marcos@mrkindustries.com.ar> [2012-11-01 21:38:20 -0300]:

> Added Atheros AR3011 internal bluetooth device found in Sony VAIO VPCEH to the 
> devices list.
> Before this, the bluetooth module was identified as an Foxconn / Hai bluetooth 
> device [0489:e027], now it claims to be an AtherosAR3011 Bluetooth 
> [0cf3:3005].
> 
> # cat /sys/kernel/debug/usb/devices
> T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
> D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
> P:  Vendor=0489 ProdID=e027 Rev= 0.01
> C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
> E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
> I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
> I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
> I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
> I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
> E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
> 
> Signed-off by: Marcos A Chaparro <marcos@mrkindustries.com.ar>
> ---
> 
> Updated usb /sys/kernel/debug/usb/devices output. A complete powercycle flushed 
> the device firmware.
> 
> diff --git a/linux-3.7-rc3.orig/drivers/bluetooth/ath3k.c b/linux-3.7-
> rc3.new/drivers/bluetooth/ath3k.c
> index fc2de55..b00000e 100644
> --- a/linux-3.7-rc3.orig/drivers/bluetooth/ath3k.c
> +++ b/linux-3.7-rc3.new/drivers/bluetooth/ath3k.c
> @@ -67,6 +67,7 @@ static struct usb_device_id ath3k_table[] = {
>         { USB_DEVICE(0x13d3, 0x3304) },
>         { USB_DEVICE(0x0930, 0x0215) },
>         { USB_DEVICE(0x0489, 0xE03D) },
> +       { USB_DEVICE(0x0489, 0xE027) },
>  
>         /* Atheros AR9285 Malbec with sflash firmware */
>         { USB_DEVICE(0x03F0, 0x311D) },
> diff --git a/linux-3.7-rc3.orig/drivers/bluetooth/btusb.c b/linux-3.7-
> rc3.new/drivers/bluetooth/btusb.c
> index debda27..ee82f2f 100644
> --- a/linux-3.7-rc3.orig/drivers/bluetooth/btusb.c
> +++ b/linux-3.7-rc3.new/drivers/bluetooth/btusb.c
> @@ -124,6 +124,7 @@ static struct usb_device_id blacklist_table[] = {
>         { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
>         { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
>         { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
> +       { USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE },
>  
>         /* Atheros AR9285 Malbec with sflash firmware */
>         { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },

Please generate your patch with git format-patch. It is currently not applying
because your patch has a few wrong information. Then use git send-email to
send your patch.

	Gustavo

^ permalink raw reply

* Multiple adapters do not work
From: Sietse Achterop @ 2012-11-06  9:10 UTC (permalink / raw)
  To: linux-bluetooth

     Dear list,

I am trying to use multiple adapters to	control	multiple bluetooth devices.
But it doesn't work. I already mailed it to this list but got no replay.
I know that normally this isn't	the way	to do this, but I am trying to avoid another
problem.

I bind 4 devices to 4 adapters as follows:

  rfcomm -i hci0 bind rfcomm1 10:00:E8:6C:D8:14 1
  rfcomm -i hci1 bind rfcomm2 10:00:E8:6C:D8:1D 1
  rfcomm -i hci2 bind rfcomm3 10:00:E8:6C:EC:98 1
  rfcomm -i hci3 bind rfcomm4 10:00:E8:6C:D7:D9 1

But, using minicom, I can only connect to the first device,
the others give	either
   cannot open /dev/rfcomm3: Connection refused
or
   cannot open /dev/rfcomm4: No such file or directory

All devices are available:
  crw-rw---- 1 root dialout 216, 1 Nov  6 09:49 /dev/rfcomm1
  crw-rw---- 1 root dialout 216, 2 Nov  6 09:46 /dev/rfcomm2
  crw-rw---- 1 root dialout 216, 3 Nov  6 09:46 /dev/rfcomm3
  crw-rw---- 1 root dialout 216, 4 Nov  6 09:46 /dev/rfcomm4

What am I doing wrong?
 (Using	Ubuntu 12.04 with bluez-4.101 install from source.)

   Regards,
     Sietse


PS On a side note: I think there is a bug in the rfcomm manual page.

   I don't understand the desciption of	the -i parameter, but it is the	same for years,	The desciption looks mangled.
     -i <hciX> | <bdaddr>
              The command is applied to device -A Enable authentication.  -E Enable encryption.  -S Secure connection.  -M Become the master of a piconet.  hciX , which must be the
name or
              the address of an installed Bluetooth device. If not specified, the command will be use the first available Bluetooth device.
   The mentioning of -A	to -M should be	removed	I guess.

^ permalink raw reply

* Re: [RFC 0/3] LE Connection parameter tuning (first step)
From: Vinicius Costa Gomes @ 2012-11-05 14:52 UTC (permalink / raw)
  To: Kim Schulz; +Cc: linux-bluetooth
In-Reply-To: <2375c7de623938c6e2f1fe8e7687db7d@server1.devteam.dk>

Hi,

On 14:42 Mon 05 Nov, Kim Schulz wrote:
> Den 2012-11-05 14:25, Vinicius Costa Gomes skrev:
> >Hi,
> >
> >Right now, we are using only one set of (hardcoded) connection
> >parameters for LE.  I guess the first step to have different
> >connection parameters classes for different Profiles requirements
> >(think "Low Latency", "Low Power", etc.) is to have a nice set of
> >parameters. For that we need to measure and see which are the sweet
> >spots, This series aims to help the measuring part.
> >
> >This is an idea so we can easily change the connection parameters
> >without need for recompiling the kernel side, so tests can be more
> >practical.
> >
> [snip]
> 
> 
> Good idea to split them out as every single profile defines their
> own. Have you
> concidered what should happen if two LE connections to two different
> profils should
> happen at the same time and the connection parameters are different?
> i.e. should bluez
> maybe have a per-profile set of connection parameters?

The current plan is to have the most restrictive (in terms of latency)
set of parameters to prevail over the others.

> Also make room in the struct for Preferred Connection Paramters (the
> values read
> from the peer DB after connection) as these can differ from the ones
> the profile proposes.

I don't think that this information should be in the kernel side, but thank
you for reminding me of this. About the problem, that could be dealt with
having that as another set of parameters (perhaps with a higher priority). 

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


Cheers,
-- 
Vinicius

^ permalink raw reply

* Re: [RFC 0/3] LE Connection parameter tuning (first step)
From: Kim Schulz @ 2012-11-05 13:42 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1352121943-18001-1-git-send-email-vinicius.gomes@openbossa.org>

Den 2012-11-05 14:25, Vinicius Costa Gomes skrev:
> Hi,
>
> Right now, we are using only one set of (hardcoded) connection
> parameters for LE.  I guess the first step to have different
> connection parameters classes for different Profiles requirements
> (think "Low Latency", "Low Power", etc.) is to have a nice set of
> parameters. For that we need to measure and see which are the sweet
> spots, This series aims to help the measuring part.
>
> This is an idea so we can easily change the connection parameters
> without need for recompiling the kernel side, so tests can be more
> practical.
>
[snip]


Good idea to split them out as every single profile defines their own. 
Have you
concidered what should happen if two LE connections to two different 
profils should
happen at the same time and the connection parameters are different? 
i.e. should bluez
maybe have a per-profile set of connection parameters?
Also make room in the struct for Preferred Connection Paramters (the 
values read
from the peer DB after connection) as these can differ from the ones 
the profile proposes.

-- 
Kim Schulz

^ permalink raw reply

* [RFC 3/3] Bluetooth: Add support for setting LE connection parameters via debugfs
From: Vinicius Costa Gomes @ 2012-11-05 13:25 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes
In-Reply-To: <1352121943-18001-1-git-send-email-vinicius.gomes@openbossa.org>

This will allow for much more pratical measures of the impact of
different connection parameters in different scenarios.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
---
 net/bluetooth/hci_sysfs.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index a9554ec..8474d02 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -550,6 +550,48 @@ static int le_conn_parameters_show(struct seq_file *f, void *p)
 	return 0;
 }
 
+static ssize_t le_conn_parameters_write(struct file *filp,
+					const char __user *ubuf,
+					size_t cnt, loff_t *ppos)
+{
+	struct seq_file *seqf = filp->private_data;
+	struct hci_dev *hdev = seqf->private;
+	struct le_conn_params params;
+	char buffer[36];
+	int n;
+
+	/* No partial writes */
+	if (*ppos != 0)
+		return 0;
+
+	/* Format: '0x0000 0x0000 0x0000 0x0000 0x0000' length 35 */
+	if (cnt != 35)
+		return -ENOSPC;
+
+	memset(buffer, 0, sizeof(buffer));
+
+	n = copy_from_user(buffer, ubuf, cnt);
+	if (n < 0)
+		return n;
+
+	memset(&params, 0, sizeof(params));
+
+	n = sscanf(buffer, "%hx %hx %hx %hx %hx", &params.scan_interval,
+		   &params.scan_window, &params.conn_interval_min,
+		   &params.conn_interval_max, &params.supervision_timeout);
+
+	if (n < 5)
+		return -EINVAL;
+
+	hci_dev_lock(hdev);
+
+	memcpy(&hdev->le_conn_params, &params, sizeof(params));
+
+	hci_dev_unlock(hdev);
+
+	return cnt;
+}
+
 static int le_conn_parameters_open(struct inode *inode, struct file *file)
 {
 	return single_open(file, le_conn_parameters_show, inode->i_private);
@@ -557,6 +599,7 @@ static int le_conn_parameters_open(struct inode *inode, struct file *file)
 
 static const struct file_operations le_conn_parameters_fops = {
 	.open		= le_conn_parameters_open,
+	.write		= le_conn_parameters_write,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
 	.release	= single_release,
-- 
1.7.12.4


^ permalink raw reply related

* [RFC 2/3] Bluetooth: Add LE connection parameters to debugfs
From: Vinicius Costa Gomes @ 2012-11-05 13:25 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes
In-Reply-To: <1352121943-18001-1-git-send-email-vinicius.gomes@openbossa.org>

Only reading the parameters is supported for now.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
---
 net/bluetooth/hci_sysfs.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 55cceee..a9554ec 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -532,6 +532,36 @@ static int auto_accept_delay_get(void *data, u64 *val)
 DEFINE_SIMPLE_ATTRIBUTE(auto_accept_delay_fops, auto_accept_delay_get,
 			auto_accept_delay_set, "%llu\n");
 
+
+static int le_conn_parameters_show(struct seq_file *f, void *p)
+{
+	struct hci_dev *hdev = f->private;
+	struct le_conn_params *params = &hdev->le_conn_params;
+
+	hci_dev_lock(hdev);
+
+	seq_printf(f, "0x%.4x 0x%.4x 0x%.4x 0x%.4x 0x%.4x\n",
+		   params->scan_interval, params->scan_window,
+		   params->conn_interval_min, params->conn_interval_max,
+		   params->supervision_timeout);
+
+	hci_dev_unlock(hdev);
+
+	return 0;
+}
+
+static int le_conn_parameters_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, le_conn_parameters_show, inode->i_private);
+}
+
+static const struct file_operations le_conn_parameters_fops = {
+	.open		= le_conn_parameters_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+
 void hci_init_sysfs(struct hci_dev *hdev)
 {
 	struct device *dev = &hdev->dev;
@@ -573,6 +603,10 @@ int hci_add_sysfs(struct hci_dev *hdev)
 
 	debugfs_create_file("auto_accept_delay", 0444, hdev->debugfs, hdev,
 			    &auto_accept_delay_fops);
+
+	debugfs_create_file("le_conn_parameters", 0644, hdev->debugfs, hdev,
+			    &le_conn_parameters_fops);
+
 	return 0;
 }
 
-- 
1.7.12.4


^ permalink raw reply related

* [RFC 1/3] Bluetooth: Keep the LE connection parameters in its own structure
From: Vinicius Costa Gomes @ 2012-11-05 13:25 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes
In-Reply-To: <1352121943-18001-1-git-send-email-vinicius.gomes@openbossa.org>

This will allow for easier parameterization of these fields. This is
the first step for allowing to change the parameters during runtime.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
---
 include/net/bluetooth/hci_core.h | 10 ++++++++++
 net/bluetooth/hci_conn.c         | 11 ++++++-----
 net/bluetooth/hci_event.c        | 10 ++++++++++
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ce6dbeb..f477d43 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -123,6 +123,14 @@ struct le_scan_params {
 	int timeout;
 };
 
+struct le_conn_params {
+	u16 scan_interval;
+	u16 scan_window;
+	u16 conn_interval_min;
+	u16 conn_interval_max;
+	u16 supervision_timeout;
+};
+
 #define HCI_MAX_SHORT_NAME_LENGTH	10
 
 struct amp_assoc {
@@ -278,6 +286,8 @@ struct hci_dev {
 	struct work_struct	le_scan;
 	struct le_scan_params	le_scan_params;
 
+	struct le_conn_params	le_conn_params;
+
 	__s8			adv_tx_power;
 
 	int (*open)(struct hci_dev *hdev);
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 25bfce0..d8ff5c0 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -35,6 +35,7 @@ static void hci_le_create_connection(struct hci_conn *conn)
 {
 	struct hci_dev *hdev = conn->hdev;
 	struct hci_cp_le_create_conn cp;
+	struct le_conn_params *params = &hdev->le_conn_params;
 
 	conn->state = BT_CONNECT;
 	conn->out = true;
@@ -42,13 +43,13 @@ static void hci_le_create_connection(struct hci_conn *conn)
 	conn->sec_level = BT_SECURITY_LOW;
 
 	memset(&cp, 0, sizeof(cp));
-	cp.scan_interval = __constant_cpu_to_le16(0x0060);
-	cp.scan_window = __constant_cpu_to_le16(0x0030);
+	cp.scan_interval = __cpu_to_le16(params->scan_interval);
+	cp.scan_window = __cpu_to_le16(params->scan_window);
 	bacpy(&cp.peer_addr, &conn->dst);
 	cp.peer_addr_type = conn->dst_type;
-	cp.conn_interval_min = __constant_cpu_to_le16(0x0028);
-	cp.conn_interval_max = __constant_cpu_to_le16(0x0038);
-	cp.supervision_timeout = __constant_cpu_to_le16(0x002a);
+	cp.conn_interval_min = __cpu_to_le16(params->conn_interval_min);
+	cp.conn_interval_max = __cpu_to_le16(params->conn_interval_max);
+	cp.supervision_timeout = __cpu_to_le16(params->supervision_timeout);
 	cp.min_ce_len = __constant_cpu_to_le16(0x0000);
 	cp.max_ce_len = __constant_cpu_to_le16(0x0000);
 
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c08ac7c..3675dbd 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1298,6 +1298,16 @@ static void hci_cc_write_le_host_supported(struct hci_dev *hdev,
 			hdev->host_features[0] |= LMP_HOST_LE_BREDR;
 		else
 			hdev->host_features[0] &= ~LMP_HOST_LE_BREDR;
+
+		if (sent->le || sent->simul) {
+			struct le_conn_params *params = &hdev->le_conn_params;
+
+			params->scan_interval = 0x0060;
+			params->scan_window = 0x0030;
+			params->conn_interval_min = 0x0028;
+			params->conn_interval_max = 0x0038;
+			params->supervision_timeout = 0x002a;
+		}
 	}
 
 	if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
-- 
1.7.12.4


^ permalink raw reply related

* [RFC 0/3] LE Connection parameter tuning (first step)
From: Vinicius Costa Gomes @ 2012-11-05 13:25 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

Hi,

Right now, we are using only one set of (hardcoded) connection
parameters for LE.  I guess the first step to have different
connection parameters classes for different Profiles requirements
(think "Low Latency", "Low Power", etc.) is to have a nice set of
parameters. For that we need to measure and see which are the sweet
spots, This series aims to help the measuring part.

This is an idea so we can easily change the connection parameters
without need for recompiling the kernel side, so tests can be more
practical.

It works, but just lightly tested. This is more to get some feedback
on how to proceed with the LE connection parameters thing.

Cheers,


Vinicius Costa Gomes (3):
  Bluetooth: Keep the LE connection parameters in its own structure
  Bluetooth: Add LE connection parameters to debugfs
  Bluetooth: Add support for setting LE connection parameters via
    debugfs

 include/net/bluetooth/hci_core.h | 10 ++++++
 net/bluetooth/hci_conn.c         | 11 +++---
 net/bluetooth/hci_event.c        | 10 ++++++
 net/bluetooth/hci_sysfs.c        | 77 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 103 insertions(+), 5 deletions(-)

-- 
1.7.12.4


^ permalink raw reply

* [PATCH v2 20/20] test: Enable speed and cadence calculation in test-cyclingspeed
From: Andrzej Kaczmarek @ 2012-11-05  8:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1352105705-13988-1-git-send-email-andrzej.kaczmarek@tieto.com>

This patch allows to enable instantenous speed and cadence calculation
based on measurement received from remote device.

To enable calculations additional parameter "--circumference <value>"
needs to be used when calling script which sets wheel circumference in mm.

Both speed and cadence are enabled at the same time. Speed is calculated
in km/h and cadence in rpm.
---
 test/test-cyclingspeed | 71 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 69 insertions(+), 2 deletions(-)

diff --git a/test/test-cyclingspeed b/test/test-cyclingspeed
index 92fe935..841456c 100755
--- a/test/test-cyclingspeed
+++ b/test/test-cyclingspeed
@@ -14,23 +14,86 @@ import dbus.service
 import dbus.mainloop.glib
 from optparse import OptionParser, make_option
 
+class MeasurementQ:
+	def __init__(self, wrap_v):
+		self._now = [None, None]
+		self._prev = [None, None]
+		self._wrap_v = wrap_v
+
+	def can_calc(self):
+		return ((self._now[0] is not None)
+			and (self._now[1] is not None)
+			and (self._prev[0] is not None)
+			and (self._prev[1] is not None))
+
+	def delta_v(self):
+		delta = self._now[0] - self._prev[0]
+		if (delta < 0) and (self._wrap_v):
+			delta = delta + 65536
+		return delta
+
+	def delta_t(self):
+		delta = self._now[1] - self._prev[1]
+		if delta < 0:
+			delta = delta + 65536
+		return delta
+
+	def put(self, data):
+		self._prev = self._now
+		self._now = data
+
 class Watcher(dbus.service.Object):
+	_wheel = MeasurementQ(False)
+	_crank = MeasurementQ(True)
+	_circumference = None
+
+	def enable_calc(self, v):
+		self._circumference = v
+
 	@dbus.service.method("org.bluez.CyclingSpeedWatcher",
 					in_signature="oa{sv}", out_signature="")
 	def MeasurementReceived(self, device, measure):
 		print("Measurement received from %s" % device)
 
+		rev = None
+		evt = None
 		if "WheelRevolutions" in measure:
+			rev = measure["WheelRevolutions"]
 			print("WheelRevolutions: ", measure["WheelRevolutions"])
-
 		if "LastWheelEventTime" in measure:
+			evt = measure["LastWheelEventTime"]
 			print("LastWheelEventTime: ", measure["LastWheelEventTime"])
+		self._wheel.put( [rev, evt] )
 
+		rev = None
+		evt = None
 		if "CrankRevolutions" in measure:
+			rev = measure["CrankRevolutions"]
 			print("CrankRevolutions: ", measure["CrankRevolutions"])
-
 		if "LastCrankEventTime" in measure:
+			evt = measure["LastCrankEventTime"]
 			print("LastCrankEventTime: ", measure["LastCrankEventTime"])
+		self._crank.put( [rev, evt] )
+
+		if self._circumference is None:
+			return
+
+		if self._wheel.can_calc():
+			delta_v = self._wheel.delta_v()
+			delta_t = self._wheel.delta_t()
+
+			if (delta_v >= 0) and (delta_t > 0):
+				speed = delta_v * self._circumference * 1024 / delta_t # mm/s
+				speed = speed * 0.0036 # mm/s -> km/h
+				print("(calculated) Speed: %.2f km/h" % speed)
+
+		if self._crank.can_calc():
+			delta_v = self._crank.delta_v()
+			delta_t = self._crank.delta_t()
+
+			if delta_t > 0:
+				cadence = delta_v * 1024 / delta_t
+				print("(calculated) Cadence: %d rpm" % cadence)
 
 def properties_changed(interface, changed, invalidated):
 	if "Location" in changed:
@@ -46,6 +109,8 @@ if __name__ == "__main__":
 			type="string", dest="adapter"),
 		make_option("-b", "--device", action="store",
 			type="string", dest="address"),
+		make_option("-c", "--circumference", action="store",
+			type="int", dest="circumference"),
 		]
 
 	parser = OptionParser(option_list=option_list)
@@ -77,6 +142,8 @@ if __name__ == "__main__":
 
 	watcher_path = "/test/watcher"
 	watcher = Watcher(bus, watcher_path)
+	if options.circumference:
+		watcher.enable_calc(options.circumference)
 	cscmanager.RegisterWatcher(watcher_path)
 
 	csc = dbus.Interface(bus.get_object("org.bluez", device_path),
-- 
1.8.0


^ permalink raw reply related

* [PATCH v2 19/20] test: Add cyclingspeed test script
From: Andrzej Kaczmarek @ 2012-11-05  8:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1352105705-13988-1-git-send-email-andrzej.kaczmarek@tieto.com>

---
 Makefile.tools         |   2 +-
 test/test-cyclingspeed | 124 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+), 1 deletion(-)
 create mode 100755 test/test-cyclingspeed

diff --git a/Makefile.tools b/Makefile.tools
index f7c85ef..ee62d83 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -215,4 +215,4 @@ EXTRA_DIST += test/sap_client.py test/hsplay test/hsmicro \
 		test/test-health test/test-health-sink test/service-record.dtd \
 		test/service-did.xml test/service-spp.xml test/service-opp.xml \
 		test/service-ftp.xml test/simple-player test/test-nap \
-		test/test-heartrate test/test-alert
+		test/test-heartrate test/test-alert test/test-cycling
diff --git a/test/test-cyclingspeed b/test/test-cyclingspeed
new file mode 100755
index 0000000..92fe935
--- /dev/null
+++ b/test/test-cyclingspeed
@@ -0,0 +1,124 @@
+#!/usr/bin/python
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+'''
+Cycling Speed and Cadence test script
+'''
+
+import gobject
+
+import sys
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+from optparse import OptionParser, make_option
+
+class Watcher(dbus.service.Object):
+	@dbus.service.method("org.bluez.CyclingSpeedWatcher",
+					in_signature="oa{sv}", out_signature="")
+	def MeasurementReceived(self, device, measure):
+		print("Measurement received from %s" % device)
+
+		if "WheelRevolutions" in measure:
+			print("WheelRevolutions: ", measure["WheelRevolutions"])
+
+		if "LastWheelEventTime" in measure:
+			print("LastWheelEventTime: ", measure["LastWheelEventTime"])
+
+		if "CrankRevolutions" in measure:
+			print("CrankRevolutions: ", measure["CrankRevolutions"])
+
+		if "LastCrankEventTime" in measure:
+			print("LastCrankEventTime: ", measure["LastCrankEventTime"])
+
+def properties_changed(interface, changed, invalidated):
+	if "Location" in changed:
+		print("Sensor location: %s" % changed["Location"])
+
+if __name__ == "__main__":
+	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+	bus = dbus.SystemBus()
+
+	option_list = [
+		make_option("-i", "--adapter", action="store",
+			type="string", dest="adapter"),
+		make_option("-b", "--device", action="store",
+			type="string", dest="address"),
+		]
+
+	parser = OptionParser(option_list=option_list)
+
+	(options, args) = parser.parse_args()
+
+	if not options.address:
+		print("Usage: %s [-i <adapter>] -b <bdaddr> [-c <value>] [cmd]" % (sys.argv[0]))
+		print("Possible commands:")
+		print("\tShowSupportedLocations")
+		print("\tSetLocation <location>")
+		print("\tSetCumulativeWheelRevolutions <value>")
+		sys.exit(1)
+
+	manager = dbus.Interface(bus.get_object("org.bluez", "/"),
+					"org.bluez.Manager")
+	if options.adapter:
+		adapter_path = manager.FindAdapter(options.adapter)
+	else:
+		adapter_path = manager.DefaultAdapter()
+
+	adapter = dbus.Interface(bus.get_object("org.bluez", adapter_path),
+							"org.bluez.Adapter")
+
+	device_path = adapter.FindDevice(options.address)
+
+	cscmanager = dbus.Interface(bus.get_object("org.bluez", adapter_path),
+						"org.bluez.CyclingSpeedManager")
+
+	watcher_path = "/test/watcher"
+	watcher = Watcher(bus, watcher_path)
+	cscmanager.RegisterWatcher(watcher_path)
+
+	csc = dbus.Interface(bus.get_object("org.bluez", device_path),
+						"org.bluez.CyclingSpeed")
+
+	bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+				path=device_path,
+				dbus_interface="org.freedesktop.DBus.Properties",
+				signal_name="PropertiesChanged")
+
+	device_prop = dbus.Interface(bus.get_object("org.bluez", device_path),
+					"org.freedesktop.DBus.Properties")
+
+	properties = device_prop.GetAll("org.bluez.CyclingSpeed")
+
+	if "Location" in properties:
+		print("Sensor location: %s" % properties["Location"])
+	else:
+		print("Sensor location is not supported")
+
+	if len(args) > 0:
+		if args[0] == "ShowSupportedLocations":
+			if properties["MultipleSensorLocationsSupported"]:
+				print("Supported locations: ", properties["SupportedLocations"])
+			else:
+				print("Multiple sensor locations not supported")
+
+		elif args[0] == "SetLocation":
+			if properties["MultipleSensorLocationsSupported"]:
+				device_prop.Set("org.bluez.CyclingSpeed", "Location", args[1])
+			else:
+				print("Multiple sensor locations not supported")
+
+		elif args[0] == "SetCumulativeWheelRevolutions":
+			if properties["WheelRevolutionDataSupported"]:
+				csc.SetCumulativeWheelRevolutions(dbus.UInt32(args[1]))
+			else:
+				print("Wheel revolution data not supported")
+
+		else:
+			print("Unknown command")
+			sys.exit(1)
+
+	mainloop = gobject.MainLoop()
+	mainloop.run()
-- 
1.8.0


^ permalink raw reply related

* [PATCH v2 18/20] build: Add CSCP API document to EXTRA_DIST
From: Andrzej Kaczmarek @ 2012-11-05  8:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1352105705-13988-1-git-send-email-andrzej.kaczmarek@tieto.com>

---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 092ac6f..d2dc65e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -412,7 +412,7 @@ EXTRA_DIST += doc/manager-api.txt \
 		doc/sap-api.txt doc/media-api.txt doc/assigned-numbers.txt \
 		doc/supported-features.txt doc/alert-api.txt doc/mgmt-api.txt \
 		doc/oob-api.txt doc/proximity-api.txt doc/heartrate-api.txt \
-		doc/thermometer-api.txt
+		doc/thermometer-api.txt doc/cyclingspeed-api.txt
 
 AM_CFLAGS += @DBUS_CFLAGS@ @GLIB_CFLAGS@
 
-- 
1.8.0


^ permalink raw reply related

* [PATCH v2 17/20] doc: Rename cycling API to cyclingspeed
From: Andrzej Kaczmarek @ 2012-11-05  8:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1352105705-13988-1-git-send-email-andrzej.kaczmarek@tieto.com>

---
 doc/cycling-api.txt      | 100 -----------------------------------------------
 doc/cyclingspeed-api.txt | 100 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 100 insertions(+), 100 deletions(-)
 delete mode 100644 doc/cycling-api.txt
 create mode 100644 doc/cyclingspeed-api.txt

diff --git a/doc/cycling-api.txt b/doc/cycling-api.txt
deleted file mode 100644
index 08e11c8..0000000
--- a/doc/cycling-api.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-Cycling Speed and Cadence API description
-*****************************************
-
-Copyright (C) 2012	Tieto Poland
-
-Cycling Speed and Cadence Manager hierarchy
-===========================================
-
-Service		org.bluez
-Interface	org.bluez.CyclingSpeedManager
-Object path	[variable prefix]/{hci0,hci1,...}
-
-Methods		RegisterWatcher(object agent)
-
-			Registers a watcher to monitor cycling speed and
-			cadence measurements.
-
-			Possible Errors: org.bluez.Error.InvalidArguments
-
-		UnregisterWatcher(object agent)
-
-			Unregisters a watcher.
-
-Cycling Speed and Cadence Profile hierarchy
-===========================================
-
-Service		org.bluez
-Interface	org.bluez.CyclingSpeed
-Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-Methods		SetCumulativeWheelRevolutions(uint32 value)
-
-			Sets cumulative wheel revolutions value if
-			Cumulative Wheel Revolutions feature is supported.
-
-			Possible Errors: org.bluez.Error.NotSupported
-
-Properties	string Location (optional) [readwrite]
-
-			Current sensor location, if supported.
-			If Multiple Sensor Locations feature is supported,
-			this property can be set to one of values read from
-			SupportedLocations property.
-
-			Possible values: "other", "top-of-shoe", "in-shoe",
-					"hip", "front-wheel", "left-crank",
-					"right-crank", "left-pedal",
-					"right-pedal", "front-hub",
-					"rear-dropout", "chainstay",
-					"rear-wheel", "rear-hub"
-
-		array{string} SupportedLocations (optional) [readonly]
-
-			List of locations supported by sensor, only present
-			if Multiple Sensor Locations feature is supported.
-
-		boolean WheelRevolutionDataSupported [readonly]
-
-			true if sensor can read and set Cumulative Wheel
-			Revolutions value, false otherwise.
-
-		boolean MultipleSensorLocationsSupported [readonly]
-
-			true if sensor supports Multiple Sensor Locations
-			feature and can set Location, false otherwise.
-
-Cycling Speed and Cadence Watcher hierarchy
-===========================================
-
-Service		unique name
-Interface	org.bluez.CyclingSpeedWatcher
-Object path	freely definable
-
-Methods		void MeasurementReceived(object device, dict measurement)
-
-			This callback is called whenever wheel and/or crank
-			revolutions measurement is received from sensor.
-
-			Measurement:
-
-				uint32 WheelRevolutions (optional):
-
-					Cumulative number of wheel revolutions.
-
-				uint16 LastWheelEventTime (optional):
-
-					Time of last event from wheel sensor.
-					Value is expressed in 1/1024 second
-					units and can roll over during a ride.
-
-				uint16 CrankRevolutions (optional):
-
-					Cumulative number of crank revolutions.
-					This value can occasionally roll over.
-
-				uint16 LastCrankEventTime (optional):
-
-					Time of last event from crank sensor.
-					Value is expressed in 1/1024 second
-					units and can roll over during a ride.
diff --git a/doc/cyclingspeed-api.txt b/doc/cyclingspeed-api.txt
new file mode 100644
index 0000000..08e11c8
--- /dev/null
+++ b/doc/cyclingspeed-api.txt
@@ -0,0 +1,100 @@
+Cycling Speed and Cadence API description
+*****************************************
+
+Copyright (C) 2012	Tieto Poland
+
+Cycling Speed and Cadence Manager hierarchy
+===========================================
+
+Service		org.bluez
+Interface	org.bluez.CyclingSpeedManager
+Object path	[variable prefix]/{hci0,hci1,...}
+
+Methods		RegisterWatcher(object agent)
+
+			Registers a watcher to monitor cycling speed and
+			cadence measurements.
+
+			Possible Errors: org.bluez.Error.InvalidArguments
+
+		UnregisterWatcher(object agent)
+
+			Unregisters a watcher.
+
+Cycling Speed and Cadence Profile hierarchy
+===========================================
+
+Service		org.bluez
+Interface	org.bluez.CyclingSpeed
+Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+Methods		SetCumulativeWheelRevolutions(uint32 value)
+
+			Sets cumulative wheel revolutions value if
+			Cumulative Wheel Revolutions feature is supported.
+
+			Possible Errors: org.bluez.Error.NotSupported
+
+Properties	string Location (optional) [readwrite]
+
+			Current sensor location, if supported.
+			If Multiple Sensor Locations feature is supported,
+			this property can be set to one of values read from
+			SupportedLocations property.
+
+			Possible values: "other", "top-of-shoe", "in-shoe",
+					"hip", "front-wheel", "left-crank",
+					"right-crank", "left-pedal",
+					"right-pedal", "front-hub",
+					"rear-dropout", "chainstay",
+					"rear-wheel", "rear-hub"
+
+		array{string} SupportedLocations (optional) [readonly]
+
+			List of locations supported by sensor, only present
+			if Multiple Sensor Locations feature is supported.
+
+		boolean WheelRevolutionDataSupported [readonly]
+
+			true if sensor can read and set Cumulative Wheel
+			Revolutions value, false otherwise.
+
+		boolean MultipleSensorLocationsSupported [readonly]
+
+			true if sensor supports Multiple Sensor Locations
+			feature and can set Location, false otherwise.
+
+Cycling Speed and Cadence Watcher hierarchy
+===========================================
+
+Service		unique name
+Interface	org.bluez.CyclingSpeedWatcher
+Object path	freely definable
+
+Methods		void MeasurementReceived(object device, dict measurement)
+
+			This callback is called whenever wheel and/or crank
+			revolutions measurement is received from sensor.
+
+			Measurement:
+
+				uint32 WheelRevolutions (optional):
+
+					Cumulative number of wheel revolutions.
+
+				uint16 LastWheelEventTime (optional):
+
+					Time of last event from wheel sensor.
+					Value is expressed in 1/1024 second
+					units and can roll over during a ride.
+
+				uint16 CrankRevolutions (optional):
+
+					Cumulative number of crank revolutions.
+					This value can occasionally roll over.
+
+				uint16 LastCrankEventTime (optional):
+
+					Time of last event from crank sensor.
+					Value is expressed in 1/1024 second
+					units and can roll over during a ride.
-- 
1.8.0


^ permalink raw reply related

* [PATCH v2 16/20] doc: Remove Get-/SetProperties from CSC API document
From: Andrzej Kaczmarek @ 2012-11-05  8:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1352105705-13988-1-git-send-email-andrzej.kaczmarek@tieto.com>

cyclingspeed plugin uses DBus.Properties instead of custom methods.
---
 doc/cycling-api.txt | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/doc/cycling-api.txt b/doc/cycling-api.txt
index adbcd33..08e11c8 100644
--- a/doc/cycling-api.txt
+++ b/doc/cycling-api.txt
@@ -28,31 +28,13 @@ Service		org.bluez
 Interface	org.bluez.CyclingSpeed
 Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
 
-Methods		void SetProperty(string name, variant value)
-
-			Changes the value of the specified property. Only
-			read-write properties can be changed. On success
-			this will emit a PropertyChanged signal.
-
-			Possible Errors: org.bluez.Error.InvalidArguments
-
-		dict GetProperties()
-
-			Returns all properties for the interface. See the
-			Properties section for the available properties.
-
-		SetCumulativeWheelRevolutions(uint32 value)
+Methods		SetCumulativeWheelRevolutions(uint32 value)
 
 			Sets cumulative wheel revolutions value if
 			Cumulative Wheel Revolutions feature is supported.
 
 			Possible Errors: org.bluez.Error.NotSupported
 
-Signals		PropertyChanged(string name, variant value)
-
-			This signal indicates a changed value of the given
-			property.
-
 Properties	string Location (optional) [readwrite]
 
 			Current sensor location, if supported.
-- 
1.8.0


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox