58 lines
1.8 KiB
Diff
58 lines
1.8 KiB
Diff
From: Isaac Hermida <isaac.hermida@digi.com>
|
|
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 <isaac.hermida@digi.com>
|
|
---
|
|
tools/hcitool.c | 10 ++++++----
|
|
1 file changed, 6 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/tools/hcitool.c b/tools/hcitool.c
|
|
index 3d5d4029d988..07053910fc9c 100644
|
|
--- a/tools/hcitool.c
|
|
+++ b/tools/hcitool.c
|
|
@@ -57,6 +57,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;
|
|
@@ -144,12 +146,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)) {
|
|
@@ -178,12 +180,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)) {
|