Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 50963cc29 -> ab1cfd442


nimble/gatt: unify discovery api

This patch unifies api to make it consistent across all discovery
methods. Always pass true range of attributes to search (start-handle,
end-handle).


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/fecfe796
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/fecfe796
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/fecfe796

Branch: refs/heads/develop
Commit: fecfe796b0bc9d4759253f068d4c497290c4cec1
Parents: 65f8fe3
Author: Michał Narajowski <[email protected]>
Authored: Tue Jan 24 12:04:08 2017 +0100
Committer: Michał Narajowski <[email protected]>
Committed: Tue Jan 24 12:04:08 2017 +0100

----------------------------------------------------------------------
 apps/bletiny/src/bletiny.h              |  4 ++--
 apps/bletiny/src/main.c                 |  4 ++--
 net/nimble/host/include/host/ble_gatt.h |  4 ++--
 net/nimble/host/pts/pts-gatt.txt        |  4 ++--
 net/nimble/host/src/ble_gattc.c         | 10 +++++-----
 5 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/fecfe796/apps/bletiny/src/bletiny.h
----------------------------------------------------------------------
diff --git a/apps/bletiny/src/bletiny.h b/apps/bletiny/src/bletiny.h
index 3c11b1d..8cf6832 100644
--- a/apps/bletiny/src/bletiny.h
+++ b/apps/bletiny/src/bletiny.h
@@ -133,8 +133,8 @@ int bletiny_disc_all_chrs(uint16_t conn_handle, uint16_t 
start_handle,
                            uint16_t end_handle);
 int bletiny_disc_chrs_by_uuid(uint16_t conn_handle, uint16_t start_handle,
                                uint16_t end_handle, const ble_uuid_t *uuid);
-int bletiny_disc_all_dscs(uint16_t conn_handle, uint16_t chr_val_handle,
-                           uint16_t chr_end_handle);
+int bletiny_disc_all_dscs(uint16_t conn_handle, uint16_t start_handle,
+                          uint16_t end_handle);
 int bletiny_disc_full(uint16_t conn_handle);
 int bletiny_find_inc_svcs(uint16_t conn_handle, uint16_t start_handle,
                            uint16_t end_handle);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/fecfe796/apps/bletiny/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c
index 66db32b..35c0dd2 100755
--- a/apps/bletiny/src/main.c
+++ b/apps/bletiny/src/main.c
@@ -694,7 +694,7 @@ bletiny_disc_full_dscs(uint16_t conn_handle)
                 bletiny_full_disc_prev_chr_val <= chr->chr.def_handle) {
 
                 rc = bletiny_disc_all_dscs(conn_handle,
-                                           chr->chr.val_handle + 1,
+                                           chr->chr.val_handle,
                                            chr_end_handle(svc, chr));
                 if (rc != 0) {
                     bletiny_full_disc_complete(rc);
@@ -1156,7 +1156,7 @@ bletiny_disc_all_dscs(uint16_t conn_handle, uint16_t 
start_handle,
 {
     int rc;
 
-    rc = ble_gattc_disc_all_dscs(conn_handle, start_handle - 1, end_handle,
+    rc = ble_gattc_disc_all_dscs(conn_handle, start_handle, end_handle,
                                  bletiny_on_disc_d, NULL);
     return rc;
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/fecfe796/net/nimble/host/include/host/ble_gatt.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/ble_gatt.h 
b/net/nimble/host/include/host/ble_gatt.h
index 50b3aad..d3c1d2b 100644
--- a/net/nimble/host/include/host/ble_gatt.h
+++ b/net/nimble/host/include/host/ble_gatt.h
@@ -155,8 +155,8 @@ int ble_gattc_disc_all_chrs(uint16_t conn_handle, uint16_t 
start_handle,
 int ble_gattc_disc_chrs_by_uuid(uint16_t conn_handle, uint16_t start_handle,
                                uint16_t end_handle, const ble_uuid_t *uuid,
                                ble_gatt_chr_fn *cb, void *cb_arg);
-int ble_gattc_disc_all_dscs(uint16_t conn_handle, uint16_t chr_val_handle,
-                            uint16_t chr_end_handle,
+int ble_gattc_disc_all_dscs(uint16_t conn_handle, uint16_t start_handle,
+                            uint16_t end_handle,
                             ble_gatt_dsc_fn *cb, void *cb_arg);
 int ble_gattc_read(uint16_t conn_handle, uint16_t attr_handle,
                    ble_gatt_attr_fn *cb, void *cb_arg);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/fecfe796/net/nimble/host/pts/pts-gatt.txt
----------------------------------------------------------------------
diff --git a/net/nimble/host/pts/pts-gatt.txt b/net/nimble/host/pts/pts-gatt.txt
index b9916b0..d0eb0cc 100644
--- a/net/nimble/host/pts/pts-gatt.txt
+++ b/net/nimble/host/pts/pts-gatt.txt
@@ -51,8 +51,8 @@ GATT/CL/GAD/BV-05-C   PASS    b conn peer_addr=<addr>
                                <repeat>
 GATT/CL/GAD/BV-06-C    PASS    b conn peer_addr=<addr>
                                b disc svc conn=<handle>
-                               b disc chr conn=<handle> start=<svc-start-hdl> 
end=<svc-end-hdl>
-                               b disc dsc conn=<handle> start=<start hdl> 
end=<end hdl>
+                               b disc chr conn=<handle> start=<start-hdl> 
end=<end-hdl>
+                               b disc dsc conn=<handle> start=<start-hdl> 
end=<end-hdl>
                                <answer YES>
                                b term conn=<handle>
                                <repeat>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/fecfe796/net/nimble/host/src/ble_gattc.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gattc.c b/net/nimble/host/src/ble_gattc.c
index e448c8b..8b12d18 100644
--- a/net/nimble/host/src/ble_gattc.c
+++ b/net/nimble/host/src/ble_gattc.c
@@ -2818,8 +2818,8 @@ ble_gattc_disc_all_dscs_rx_complete(struct ble_gattc_proc 
*proc, int status)
  * @return                      0 on success; nonzero on failure.
  */
 int
-ble_gattc_disc_all_dscs(uint16_t conn_handle, uint16_t chr_val_handle,
-                        uint16_t chr_end_handle,
+ble_gattc_disc_all_dscs(uint16_t conn_handle, uint16_t start_handle,
+                        uint16_t end_handle,
                         ble_gatt_dsc_fn *cb, void *cb_arg)
 {
 #if !MYNEWT_VAL(BLE_GATT_DISC_ALL_DSCS)
@@ -2839,9 +2839,9 @@ ble_gattc_disc_all_dscs(uint16_t conn_handle, uint16_t 
chr_val_handle,
 
     proc->op = BLE_GATT_OP_DISC_ALL_DSCS;
     proc->conn_handle = conn_handle;
-    proc->disc_all_dscs.chr_val_handle = chr_val_handle;
-    proc->disc_all_dscs.prev_handle = chr_val_handle;
-    proc->disc_all_dscs.end_handle = chr_end_handle;
+    proc->disc_all_dscs.chr_val_handle = start_handle;
+    proc->disc_all_dscs.prev_handle = start_handle;
+    proc->disc_all_dscs.end_handle = end_handle;
     proc->disc_all_dscs.cb = cb;
     proc->disc_all_dscs.cb_arg = cb_arg;
 

Reply via email to