Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/master 1656c2900 -> bb0acfb17


bleshell - fix a few bugs.


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

Branch: refs/heads/master
Commit: bb0acfb179a752dabd0df985075209274dea5055
Parents: 1656c29
Author: Christopher Collins <ccollins47...@gmail.com>
Authored: Mon Feb 1 20:10:52 2016 -0800
Committer: Christopher Collins <ccollins47...@gmail.com>
Committed: Mon Feb 1 20:11:12 2016 -0800

----------------------------------------------------------------------
 project/bleshell/src/main.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/bb0acfb1/project/bleshell/src/main.c
----------------------------------------------------------------------
diff --git a/project/bleshell/src/main.c b/project/bleshell/src/main.c
index e23ebd7..51e95d2 100755
--- a/project/bleshell/src/main.c
+++ b/project/bleshell/src/main.c
@@ -680,17 +680,17 @@ static int
 bleshell_on_disc_c(uint16_t conn_handle, struct ble_gatt_error *error,
                    struct ble_gatt_chr *chr, void *arg)
 {
-    intptr_t *svc_start_handle;
+    intptr_t svc_start_handle;
 
     bleshell_lock();
 
-    svc_start_handle = arg;
+    svc_start_handle = (intptr_t)arg;
 
     if (error != NULL) {
         bleshell_print_error("ERROR DISCOVERING CHARACTERISTIC", conn_handle,
                              error);
     } else if (chr != NULL) {
-        bleshell_chr_add(conn_handle, *svc_start_handle, chr);
+        bleshell_chr_add(conn_handle, svc_start_handle, chr);
     } else {
         /* Service discovery complete. */
     }
@@ -702,20 +702,16 @@ bleshell_on_disc_c(uint16_t conn_handle, struct 
ble_gatt_error *error,
 
 static int
 bleshell_on_disc_d(uint16_t conn_handle, struct ble_gatt_error *error,
-                   uint16_t chr_val_handle, struct ble_gatt_dsc *dsc,
+                   uint16_t chr_def_handle, struct ble_gatt_dsc *dsc,
                    void *arg)
 {
-    intptr_t *chr_def_handle;
-
     bleshell_lock();
 
-    chr_def_handle = arg;
-
     if (error != NULL) {
         bleshell_print_error("ERROR DISCOVERING DESCRIPTOR", conn_handle,
                              error);
     } else if (dsc != NULL) {
-        bleshell_dsc_add(conn_handle, *chr_def_handle, dsc);
+        bleshell_dsc_add(conn_handle, chr_def_handle, dsc);
     } else {
         /* Descriptor discovery complete. */
     }
@@ -934,7 +930,7 @@ bleshell_disc_all_chrs(uint16_t conn_handle, uint16_t 
start_handle,
 
     svc_start_handle = start_handle;
     rc = ble_gattc_disc_all_chrs(conn_handle, start_handle, end_handle,
-                                 bleshell_on_disc_c, &svc_start_handle);
+                                 bleshell_on_disc_c, (void *)svc_start_handle);
     return rc;
 }
 
@@ -975,12 +971,10 @@ int
 bleshell_disc_all_dscs(uint16_t conn_handle, uint16_t chr_def_handle,
                        uint16_t chr_end_handle)
 {
-    intptr_t chr_def_handle_iptr;
     int rc;
 
-    chr_def_handle_iptr = chr_def_handle;
     rc = ble_gattc_disc_all_dscs(conn_handle, chr_def_handle, chr_end_handle,
-                                 bleshell_on_disc_d, &chr_def_handle_iptr);
+                                 bleshell_on_disc_d, NULL);
     return rc;
 }
 

Reply via email to