Hey all, been working with mynewt for a week or so now, trying to
understand the code and slim the nimble stack down for nrf51822qfaa
targets. Playing with central role now (modified blecent), and Im having
some trouble searching for a single svc by uuid (to save peer struct
memory, rather than indexing them all)

Either I dont understand ble_gattc_disc_svc_by_uuid or it has problems.

Its returning successfully but with a different uuid than I would expect
and weird handles

2357:[ts=18414036ssb, mod=4 level=1] GATT procedure initiated: discover
service by uuid; uuid=0000180d-0000-1000-800000805f9b34fb
2360:[ts=18437472ssb, mod=4 level=0] host tx hci data; handle=1 length=27
2361:[ts=18445284ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x1b
0x00 0x17 0x00 0x04 0x00 0x06 0x01 0x00 0xff 0xff 0x00 0x28 0xfb 0x34 0x9b
0x5f 0x80 0x00 0x00 0x80 0x00 0x10 0x00 0x00 0x0d 0x18 0x00 0x00
2364:[ts=18468720ssb, mod=4 level=0] txed att command: find type value req;
conn=1 start_handle=0x0001 end_handle=0xffff attr_type=10240
2372:[ts=18531216ssb, mod=4 level=0] Number of Completed Packets:
num_handles=1
2374:[ts=18546840ssb, mod=4 level=0] handle:1 pkts:1
2379:[ts=18585900ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): handle=1
pb=2 len=9 data=0x05 0x00 0x04 0x00 0x01 0x06 0x01 0x00 0x0a
2382:[ts=18609336ssb, mod=4 level=0] rxed att command: error rsp; conn=1
req_op=6 handle=0x0001 error_code=10
2384:[ts=18624960ssb, mod=64 level=3] Service discovery complete; status=0
conn_handle=1


(gdb)  p (peer->svcs)->slh_first->svc
$4 = {
  start_handle = 16384,
  end_handle = 8192,
  uuid128 = "\365\r\000\000U\016\000\000U\016\000\000\000\000\000"
}
(gdb)
b blecent_on_svc_disc_complete
b blecent_on_chr_disc_complete

If I instead use ble_gattc_disc_all_svcs like the demo I get 3 services
found, and the one Im looking to find looks like:


839:[ts=6554652ssb, mod=4 level=1] GATT procedure initiated: discover all
services
841:[ts=6570276ssb, mod=4 level=0] host tx hci data; handle=1 length=11
843:[ts=6585900ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x0b 0x00
0x07 0x00 0x04 0x00 0x10 0x01 0x00 0xff 0xff 0x00 0x28
845:[ts=6601524ssb, mod=4 level=0] txed att command: read group type req;
conn=1 start_handle=0x0001 end_handle=0xffff
853:[ts=6664020ssb, mod=4 level=0] Number of Completed Packets:
num_handles=1
854:[ts=6671832ssb, mod=4 level=0] handle:1 pkts:1
859:[ts=6710892ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): handle=1
pb=2 len=24 data=0x14 0x00 0x04 0x00 0x11 0x06 0x01 0x00 0x0b 0x00 0x00
0x18 0x0c 0x00 0x0e 0x00 0x01 0x18 0x0f 0x00 0x14 0x00 0x0d 0x18
863:[ts=6742140ssb, mod=4 level=0] rxed att command: read group type rsp;
conn=1 length=6
865:[ts=6757764ssb, mod=4 level=0] host tx hci data; handle=1 length=11
866:[ts=6765576ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x0b 0x00
0x07 0x00 0x04 0x00 0x10 0x15 0x00 0xff 0xff 0x00 0x28
868:[ts=6781200ssb, mod=4 level=0] txed att command: read group type req;
conn=1 start_handle=0x0015 end_handle=0xffff
872:[ts=6812448ssb, mod=4 level=0] Number of Completed Packets:
num_handles=1
873:[ts=6820260ssb, mod=4 level=0] handle:1 pkts:1
878:[ts=6859320ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): handle=1
pb=2 len=18 data=0x0e 0x00 0x04 0x00 0x11 0x06 0x15 0x00 0x23 0x00 0x0a
0x18 0x24 0x00 0x26 0x00 0x0f 0x18
882:[ts=6890568ssb, mod=4 level=0] rxed att command: read group type rsp;
conn=1 length=6
884:[ts=6906192ssb, mod=4 level=0] host tx hci data; handle=1 length=11
885:[ts=6914004ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x0b 0x00
0x07 0x00 0x04 0x00 0x10 0x27 0x00 0xff 0xff 0x00 0x28
887:[ts=6929628ssb, mod=4 level=0] txed att command: read group type req;
conn=1 start_handle=0x0027 end_handle=0xffff
891:[ts=6960876ssb, mod=4 level=0] Number of Completed Packets:
num_handles=1
893:[ts=6976500ssb, mod=4 level=0] handle:1 pkts:1
897:[ts=7007812ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): handle=1
pb=2 len=26 data=0x16 0x00 0x04 0x00 0x11 0x14 0x27 0x00 0xff 0xff 0xa9
0x0b 0x97 0x06 0x6a 0x01 0xcf 0xee 0x7e 0x54 0x7b 0xac 0x49 0xff 0x17 0x62
901:[ts=7039060ssb, mod=4 level=0] rxed att command: read group type rsp;
conn=1 length=20
904:[ts=7062496ssb, mod=64 level=3] Service discovery complete; status=0
conn_handle=1

(gdb) p (peer->svcs)->slh_first->svc
$1 = {start_handle = 1, end_handle = 11, uuid128 =
"\373\064\233_\200\000\000\200\000\020\000\000\000\030\000"}
(gdb)

I dont know if its helpful, but I noticed ble_gattc_disc_svc_by_uuid is
using the find api (ble_att_clt_tx_find_type_value) instead of a read api
(ble_att_clt_tx_read_group_type in the case of ble_gattc_disc_all_svcs)


Im trying to understand hci packets now to see what those differences are,
but in the mean time I thought Id post.

Thanks for the stack and for any thoughts.

Reply via email to