From 6e76f9f7e484b2599745a454fe1cefdb7d07b0b8 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Mon, 11 Jul 2016 11:49:09 +0200 Subject: [PATCH] bluez5: include hcitool patches (increase "conn" limit and "refresh" typo) Add a couple of bluez patches: one for increasing the number of connection showed with "hcitool con" command and remove "refresh" option in hcitool help that is not supported. The qca6564 chip can support more than 10 simultaneous BLE connections. https://jira.digi.com/browse/DEL-2735 Signed-off-by: Isaac Hermida --- ...-not-show-unsupported-refresh-option.patch | 22 +++++++ ...ase-the-shown-connection-limit-to-20.patch | 57 +++++++++++++++++++ .../bluez/bluez5_5.33.bbappend | 6 +- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/0021-hcitool-do-not-show-unsupported-refresh-option.patch create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/0022-hcitool-increase-the-shown-connection-limit-to-20.patch diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/0021-hcitool-do-not-show-unsupported-refresh-option.patch b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/0021-hcitool-do-not-show-unsupported-refresh-option.patch new file mode 100644 index 000000000..0d0375dad --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/0021-hcitool-do-not-show-unsupported-refresh-option.patch @@ -0,0 +1,22 @@ +From: Isaac Hermida +Date: Fri, 8 Jul 2016 12:19:33 +0200 +Subject: [PATCH] hcitool: do not show unsupported refresh option + +Signed-off-by: Isaac Hermida +--- + tools/hcitool.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/hcitool.c b/tools/hcitool.c +index 02c4ebe1b71b..229c22c49909 100644 +--- a/tools/hcitool.c ++++ b/tools/hcitool.c +@@ -568,7 +568,7 @@ static struct option scan_options[] = { + + static const char *scan_help = + "Usage:\n" +- "\tscan [--length=N] [--numrsp=N] [--iac=lap] [--flush] [--class] [--info] [--oui] [--refresh]\n"; ++ "\tscan [--length=N] [--numrsp=N] [--iac=lap] [--flush] [--class] [--info] [--oui]\n"; + + static void cmd_scan(int dev_id, int argc, char **argv) + { diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/0022-hcitool-increase-the-shown-connection-limit-to-20.patch b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/0022-hcitool-increase-the-shown-connection-limit-to-20.patch new file mode 100644 index 000000000..fd81a1960 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/0022-hcitool-increase-the-shown-connection-limit-to-20.patch @@ -0,0 +1,57 @@ +From: Isaac Hermida +Date: Fri, 8 Jul 2016 10:42:57 +0200 +Subject: [PATCH] hcitool: increase the shown connection limit to 20 + +Created a variable to set the number of connections to shown and increase that +value so we can list more current LE connections. + +https://jira.digi.com/browse/DEL-2735 + +Signed-off-by: Isaac Hermida +--- + tools/hcitool.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/tools/hcitool.c b/tools/hcitool.c +index 229c22c49909..ae70c9c0d3b4 100644 +--- a/tools/hcitool.c ++++ b/tools/hcitool.c +@@ -69,6 +69,8 @@ + #define EIR_TX_POWER 0x0A /* transmit power level */ + #define EIR_DEVICE_ID 0x10 /* device ID */ + ++#define MAX_CONNECTIONS_SHOWN 20 /* Max number of "hcitool conn" items to shown */ ++ + #define for_each_opt(opt, long, short) while ((opt=getopt_long(argc, argv, short ? short:"+", long, NULL)) != -1) + + static volatile int signal_received = 0; +@@ -156,12 +158,12 @@ static int conn_list(int s, int dev_id, long arg) + if (id != -1 && dev_id != id) + return 0; + +- if (!(cl = malloc(10 * sizeof(*ci) + sizeof(*cl)))) { ++ if (!(cl = malloc(MAX_CONNECTIONS_SHOWN * sizeof(*ci) + sizeof(*cl)))) { + perror("Can't allocate memory"); + exit(1); + } + cl->dev_id = dev_id; +- cl->conn_num = 10; ++ cl->conn_num = MAX_CONNECTIONS_SHOWN; + ci = cl->conn_info; + + if (ioctl(s, HCIGETCONNLIST, (void *) cl)) { +@@ -190,12 +192,12 @@ static int find_conn(int s, int dev_id, long arg) + struct hci_conn_info *ci; + int i; + +- if (!(cl = malloc(10 * sizeof(*ci) + sizeof(*cl)))) { ++ if (!(cl = malloc(MAX_CONNECTIONS_SHOWN * sizeof(*ci) + sizeof(*cl)))) { + perror("Can't allocate memory"); + exit(1); + } + cl->dev_id = dev_id; +- cl->conn_num = 10; ++ cl->conn_num = MAX_CONNECTIONS_SHOWN; + ci = cl->conn_info; + + if (ioctl(s, HCIGETCONNLIST, (void *) cl)) { diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.33.bbappend b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.33.bbappend index 559688781..ea0c71714 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.33.bbappend +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.33.bbappend @@ -2,7 +2,11 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" -SRC_URI += "file://bluez-init" +SRC_URI += " \ + file://bluez-init \ + file://0021-hcitool-do-not-show-unsupported-refresh-option.patch \ + file://0022-hcitool-increase-the-shown-connection-limit-to-20.patch \ +" SRC_URI_append_ccimx6ul = " \ file://0001-bluetooth-Add-bluetooth-support-for-QCA6174-chip.patch \