This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Discovering a VS UUID Characterisic, but it shows UUID as 0

Hi,

I am running SDK15, and using the example ble_app_interactive in ble_central and peripheral. I am trying to discover services and characteristic from a peripheral device, using NRF52 DK as a central device. There is a lot of services and VS services and characteristic in the peripheral. I can discover the services, and see the VS UUID services. As seen on picture:

But when i try to discover the characteristics in the VS services, it writes out the UUID as 0. I have also made it print out it handles and it does have it's handles Both things is shown in pictures below.

The UUID is 0. This is by using gatt characteristics <address> 2EAF.

If i then try to write gatt characteristics <address> AE62. I still don't get UUID, but my progam also crashes and gives me error code 11, but this is in the CCCD descriptor, as seen on picture:

I have made extra logging. I have also increased NRF_SDH_BLE_VS_UUID_COUNT in sdk_config. I have also increased my maximum characterstics and services. Hope you can help.

Regards Andreas 

Parents
  • Hi Dresse, 

    Please post a full log of your test, including the commands you type in. I don't see the part where you find the VS services I would suggest you also test first with connecting to ble_app_uart, just to test if it would work with a simple custom profile. 

  • Alright, I now have the full log. I have added some extra text to the program, so I know where it is, hope you can see past that. The first log file, show the communation between the hearingaid, and the Nordic.

     

    =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2018.11.20 11:16:30 =~=~=~=~=~=~=~=~=~=~=~=
    
      advertiseballocbonded_devicesclear
      clear_devicescliconnectconnected_devices
      device_namedevicesdisconnectgatt
      historykey_replylogmpu
      numericpairparametersprivacy
      queueremove_bondresizescan
    uart_cli:~$ conn    scvan on      an onScan started
    uart_cli:~$ <info> app: Scanning
    uart_cli:~$ devicesDevice 00:16:94:1B:29:7A PXC 550
    Device 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    uart_cli:~$ devicesDevice 00:16:94:1B:29:7A PXC 550
    Device 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device E2:4E:06:F7:E3:BC tkr
    Device 7D:20:E7:E5:49:8D 24:31:41:5a:1a:14
    Device 00:16:94:28:DF:13 MB 660 MS
    uart_cli:~$ devicesDevice 00:16:94:1B:29:7A PXC 550
    Device 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device E2:4E:06:F7:E3:BC tkr
    Device 7D:20:E7:E5:49:8D 24:31:41:5a:1a:14
    Device 00:16:94:28:DF:13 MB 660 MS
    Device 08:DF:1F:DB:08:A2 LE-B35C
    Device 00:16:94:28:4F:D3 MB 660 MS
    Device 6A:99:24:40:D5:B1 DUT-SLAVE
    Device 58:0E:A3:72:C2:D5 DUT-SLAVE
    Device 47:2E:8C:88:AC:44 [LG] webOS TV UJ630V
    Device A0:6F:AA:46:31:D1 612MANJ6A687 UW341C
    Device C8:0A:9C:09:3E:38 Tile
    Device F0:DF:FB:66:20:1F Tile
    uart_cli:~$ devicesDevice 00:16:94:1B:29:7A PXC 550
    Device 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device E2:4E:06:F7:E3:BC tkr
    Device 7D:20:E7:E5:49:8D 24:31:41:5a:1a:14
    Device 00:16:94:28:DF:13 MB 660 MS
    Device 08:DF:1F:DB:08:A2 LE-B35C
    Device 00:16:94:28:4F:D3 MB 660 MS
    Device 6A:99:24:40:D5:B1 DUT-SLAVE
    Device 58:0E:A3:72:C2:D5 DUT-SLAVE
    Device 47:2E:8C:88:AC:44 [LG] webOS TV UJ630V
    Device A0:6F:AA:46:31:D1 612MANJ6A687 UW341C
    Device C8:0A:9C:09:3E:38 Tile
    Device F0:DF:FB:66:20:1F Tile
    uart_cli:~$ devicesDevice 00:16:94:1B:29:7A PXC 550
    Device 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device E2:4E:06:F7:E3:BC tkr
    Device 7D:20:E7:E5:49:8D 24:31:41:5a:1a:14
    Device 00:16:94:28:DF:13 MB 660 MS
    Device 08:DF:1F:DB:08:A2 LE-B35C
    Device 00:16:94:28:4F:D3 MB 660 MS
    Device 6A:99:24:40:D5:B1 DUT-SLAVE
    Device 58:0E:A3:72:C2:D5 DUT-SLAVE
    Device 47:2E:8C:88:AC:44 [LG] webOS TV UJ630V
    Device A0:6F:AA:46:31:D1 612MANJ6A687 UW341C
    Device C8:0A:9C:09:3E:38 Tile
    Device F0:DF:FB:66:20:1F Tile
    uart_cli:~$ devicesDevice 00:16:94:1B:29:7A PXC 550
    Device 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device E2:4E:06:F7:E3:BC tkr
    Device 7D:20:E7:E5:49:8D 24:31:41:5a:1a:14
    Device 00:16:94:28:DF:13 MB 660 MS
    Device 08:DF:1F:DB:08:A2 LE-B35C
    Device 00:16:94:28:4F:D3 MB 660 MS
    Device 6A:99:24:40:D5:B1 DUT-SLAVE
    Device 58:0E:A3:72:C2:D5 DUT-SLAVE
    Device 47:2E:8C:88:AC:44 [LG] webOS TV UJ630V
    Device A0:6F:AA:46:31:D1 612MANJ6A687 UW341C
    Device C8:0A:9C:09:3E:38 Tile
    Device F0:DF:FB:66:20:1F Tile
    uart_cli:~$ devicesDevice 00:16:94:1B:29:7A PXC 550
    Device 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device E2:4E:06:F7:E3:BC tkr
    Device 7D:20:E7:E5:49:8D 24:31:41:5a:1a:14
    Device 00:16:94:28:DF:13 MB 660 MS
    Device 08:DF:1F:DB:08:A2 LE-B35C
    Device 00:16:94:28:4F:D3 MB 660 MS
    Device 6A:99:24:40:D5:B1 DUT-SLAVE
    Device 58:0E:A3:72:C2:D5 DUT-SLAVE
    Device 47:2E:8C:88:AC:44 [LG] webOS TV UJ630V
    Device A0:6F:AA:46:31:D1 612MANJ6A687 UW341C
    Device C8:0A:9C:09:3E:38 Tile
    Device F0:DF:FB:66:20:1F Tile
    Device 7E:E7:30:C3:9F:96 ac_hi_test_hi_ECC5
    Device 6C:E2:A9:F8:EE:29 [LG] webOS TV UJ634V
    uart_cli:~$ connect ac_hi_test_hi_ECC5uart_cli:~$ uart_cli:~$ <info> app: CENTRAL: Connecting...
    uart_cli:~$ Connected to address: uart_cli:~$ 7E uart_cli:~$ E7 uart_cli:~$ 30 uart_cli:~$ C3 uart_cli:~$ 9F uart_cli:~$ 96 uart_cli:~$ 
    uart_cli:~$ <info> app: CENTRAL: Connected, handle: 0.
    uart_cli:~$ <info> app: Data length updated to 27 bytes.
    uart_cli:~$ Current MTU: 158
    uart_cli:~$ MTU changed successfully
    uart_cli:~$ pair LESC 7E:E7:30:C3:9F:96 Start pairing
    uart_cli:~$ <info> app: PERIPHERAL: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 0
    uart_cli:~$ <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Bonding
    uart_cli:~$ gatt 
      characteristicsindicationnotificationread
      serviceswrite
    uart_cli:~$ gatt 
      characteristicsindicationnotificationread
      serviceswrite
    uart_cli:~$ gatt services 7E:E7:30:C3:9F:96 uart_cli:~$ <info> app: GATT Services
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Services count: 9
    uart_cli:~$ Found service UUIDs: 
    uart_cli:~$ UUID: 1800 type: 0x1
    uart_cli:~$ UUID: 1801 type: 0x1
    uart_cli:~$ UUID: 180A type: 0x1
    uart_cli:~$ UUID: 180F type: 0x1
    uart_cli:~$ UUID: 0 type: 0x2
    uart_cli:~$ UUID: 0 type: 0x3
    uart_cli:~$ UUID: 0 type: 0x4
    uart_cli:~$ UUID: 0 type: 0x5
    uart_cli:~$ UUID: 0 type: 0x6
    uart_cli:~$ gatt services 7E:E7:30:C3:9F:96uart_cli:~$ <info> app: GATT Services
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Services count: 9
    uart_cli:~$ Found service UUIDs: 
    uart_cli:~$ UUID: 1800 type: 0x1
    uart_cli:~$ UUID: 1801 type: 0x1
    uart_cli:~$ UUID: 180A type: 0x1
    uart_cli:~$ UUID: 180F type: 0x1
    uart_cli:~$ UUID: F4BD type: 0x2
    uart_cli:~$ UUID: F2B4 type: 0x3
    uart_cli:~$ UUID: 3049 type: 0x4
    uart_cli:~$ UUID: 2EAF type: 0x5
    uart_cli:~$ UUID: AE62 type: 0x6
    uart_cli:~$ gatt characteristics 7E:E7:30:C3:9F:96 2EAFuart_cli:~$ <info> app: Count: 7
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 5C
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 5D
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 0
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 5E
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 5F
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 0
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 60
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 61
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 0
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 62
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 63
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 0
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 64
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 65
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 0
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 66
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 67
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 0
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 68
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 69
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 0
    uart_cli:~$ Characteristic UUID: 0
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 1 uart_cli:~$ write_wo_resp: 0 uart_cli:~$ write: 0 uart_cli:~$ notify: 0
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Characteristic UUID: 0
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 1 uart_cli:~$ write_wo_resp: 0 uart_cli:~$ write: 0 uart_cli:~$ notify: 0
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Characteristic UUID: 0
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 1 uart_cli:~$ write_wo_resp: 0 uart_cli:~$ write: 0 uart_cli:~$ notify: 0
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Characteristic UUID: 0
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 1 uart_cli:~$ write_wo_resp: 0 uart_cli:~$ write: 0 uart_cli:~$ notify: 0
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Characteristic UUID: 0
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 0 uart_cli:~$ write_wo_resp: 1 uart_cli:~$ write: 1 uart_cli:~$ notify: 0
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Characteristic UUID: 0
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 1 uart_cli:~$ write_wo_resp: 0 uart_cli:~$ write: 0 uart_cli:~$ notify: 0
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Characteristic UUID: 0
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 1 uart_cli:~$ write_wo_resp: 0 uart_cli:~$ write: 1 uart_cli:~$ notify: 1
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Number of characteristics: 7
    uart_cli:~$ <info> app: Discovers Descriptors
    uart_cli:~$ <info> app: err_code: 0
    uart_cli:~$ <info> app: Count in descriptor: 1
    uart_cli:~$ <info> app: Count in descriptor: 0
    uart_cli:~$ No descriptors for characteristic, notifications and indications not possible
    uart_cli:~$ gatt characteristics 7E:E7:30:C3:9F:96 2EAF    AE62uart_cli:~$ <info> app: Count: 4
    <info> app: m_srv_char.char_decl.handle: 93
    <info> app: m_srv_char.char_value_handle: 94
    <info> app: m_srv_char.char_data.uuid: 0
    <info> app: m_srv_char.char_decl.handle: 95
    <info> app: m_srv_char.char_value_handle: 96
    <info> app: m_srv_char.char_data.uuid: 0
    <info> app: m_srv_char.char_decl.handle: 98
    <info> app: m_srv_char.char_value_handle: 99
    <info> app: m_srv_char.char_data.uuid: 0
    <info> app: m_srv_char.char_decl.handle: 9B
    <info> app: m_srv_char.char_value_handle: 9C
    <info> app: m_srv_char.char_data.uuid: 0
    Characteristic UUID: 0
    Parameters:
    broadcast: 0 read: 0 write_wo_resp: 1 write: 0 notify: 0
    indicate: 0 auth_signed_wr: 0
    Characteristic UUID: 0
    Parameters:
    broadcast: 0 read: 0 write_wo_resp: 0 write: 0 notify: 1
    indicate: 0 auth_signed_wr: 0
    Characteristic UUID: 0
    Parameters:
    broadcast: 0 read: 1 write_wo_resp: 1 write: 1 notify: 1
    indicate: 0 auth_signed_wr: 0
    Characteristic UUID: 0
    Parameters:
    broadcast: 0 read: 0 write_wo_resp: 1 write: 1 notify: 0
    indicate: 0 auth_signed_wr: 0
    Number of characteristics: 4
    <info> app: Discovers Descriptors
    <info> app: err_code: 0
    <info> app: Discovers Descriptors
    <info> app: err_code: 11
    <error> app: Fatal error
    <warning> app: System reset
    
    
    uart_cli:~$ BLE app with command line interface example started.
    uart_cli:~$ Press Tab to view all available commands.
    uart_cli:~$ co  connect 0uart_cli:~$ uart_cli:~$ <info> app: Scanning
    uart_cli:~$ Connected to address: uart_cli:~$ 40 uart_cli:~$ 4F uart_cli:~$ 0C uart_cli:~$ 33 uart_cli:~$ 57 uart_cli:~$ 2E uart_cli:~$ 
    uart_cli:~$ <info> app: CENTRAL: Connected, handle: 0.
    uart_cli:~$ <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Encryption
    uart_cli:~$ Current MTU: 158
    uart_cli:~$ MTU changed successfully
    uart_cli:~$ <info> app: Data length updated to 27 bytes.
    uart_cli:~$ gatt services 40:4F:0C:33:57:2E uart_cli:~$ <info> app: GATT Services
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Services count: 9
    uart_cli:~$ Found service UUIDs: 
    uart_cli:~$ UUID: 1800 type: 0x1
    uart_cli:~$ UUID: 1801 type: 0x1
    uart_cli:~$ UUID: 180A type: 0x1
    uart_cli:~$ UUID: 180F type: 0x1
    uart_cli:~$ UUID: 0 type: 0x2
    uart_cli:~$ UUID: 0 type: 0x3
    uart_cli:~$ UUID: 0 type: 0x4
    uart_cli:~$ UUID: 0 type: 0x5
    uart_cli:~$ UUID: 0 type: 0x6
    uart_cli:~$ gatt services 40:4F:0C:33:57:2Euart_cli:~$ <info> app: GATT Services
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Services count: 9
    uart_cli:~$ Found service UUIDs: 
    uart_cli:~$ UUID: 1800 type: 0x1
    uart_cli:~$ UUID: 1801 type: 0x1
    uart_cli:~$ UUID: 180A type: 0x1
    uart_cli:~$ UUID: 180F type: 0x1
    uart_cli:~$ UUID: F4BD type: 0x2
    uart_cli:~$ UUID: F2B4 type: 0x3
    uart_cli:~$ UUID: 3049 type: 0x4
    uart_cli:~$ UUID: 2EAF type: 0x5
    uart_cli:~$ UUID: AE62 type: 0x6
    uart_cli:~$ gatt che aracteristics 40:4F:0C:33:57:2E 180Fuart_cli:~$ <info> app: Count: 1
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 1C
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 1D
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 2A19
    uart_cli:~$ Characteristic UUID: 2A19
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 1 uart_cli:~$ write_wo_resp: 0 uart_cli:~$ write: 0 uart_cli:~$ notify: 1
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Number of characteristics: 1
    uart_cli:~$ <info> app: Discovers Descriptors
    uart_cli:~$ <info> app: err_code: 0
    uart_cli:~$ <info> app: Count in descriptor: 0
    uart_cli:~$ No descriptors for characteristic, notifications and indications not possible
    uart_cli:~$ 

    I also did a test where I try to connect, to my phone, and setting up my GATT server on my phone with a custom service UUID, and custom characteristic UUID. And that worked perfectly:

    =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2018.11.20 11:21:45 =~=~=~=~=~=~=~=~=~=~=~=
    
      advertiseballocbonded_devicesclear
      clear_devicescliconnectconnected_devices
      device_namedevicesdisconnectgatt
      historykey_replylogmpu
      numericpairparametersprivacy
      queueremove_bondresizescan
    uart_cli:~$ scan onScan started
    uart_cli:~$ <info> app: Scanning
    uart_cli:~$ devicesDevice 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device 74:AB:5C:BE:02:E0 Galaxy S9
    Device 00:16:94:1E:2F:51 MB 660 MS
    uart_cli:~$ connect Galaxy S9uart_cli:~$  uart_cli:~$ connect Galaxy S9uart_cli:~$  uart_cli:~$ scan onScan started
    uart_cli:~$ <info> app: Scanning
    uart_cli:~$ deivcesdeivces: command not found
    uart_cli:~$ v devicesDevice 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device 74:AB:5C:BE:02:E0 Galaxy S9
    Device 00:16:94:1E:2F:51 MB 660 MS
    Device C8:0A:9C:09:3E:38 Tile
    Device 58:0E:A3:72:C2:D5 DUT-SLAVE
    Device 6A:99:24:40:D5:B1 DUT-SLAVE
    uart_cli:~$ connect Galaxy S9uart_cli:~$  uart_cli:~$ connect 74:AB:5C. :BE:02:E0uart_cli:~$ uart_cli:~$ <info> app: CENTRAL: Connecting...
    uart_cli:~$ Connected to address: uart_cli:~$ 74 uart_cli:~$ AB uart_cli:~$ 5C uart_cli:~$ BE uart_cli:~$ 02 uart_cli:~$ E0 uart_cli:~$ 
    uart_cli:~$ <info> app: CENTRAL: Connected, handle: 1.
    uart_cli:~$ Current MTU: 247
    uart_cli:~$ MTU changed successfully
    uart_cli:~$ <info> app: Data length updated to 251 bytes.
    uart_cli:~$ <info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 1
    uart_cli:~$ <info> app: PERIPHERAL: BLE_GAP_EVT_PASSKEY_DISPLAY: passkey=402446 match_req=1
    uart_cli:~$ <info> app: Type /numeric accept/ to confirm, /numeric reject/ to reject
    uart_cli:~$ Connection parameters update success
    uart_cli:~$ gatt services 
      40:4F:0C:33:57:2E74:AB:5C:BE:02:E0
    uart_cli:~$ gatt services 74:AB:5C:BE:02:E0 uart_cli:~$ <info> app: GATT Services
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Services count: 5
    uart_cli:~$ Found service UUIDs: 
    uart_cli:~$ UUID: 1801 type: 0x1
    uart_cli:~$ UUID: 1800 type: 0x1
    uart_cli:~$ UUID: 0 type: 0x7
    uart_cli:~$ UUID: 181C type: 0x1
    uart_cli:~$ UUID: 180F type: 0x1
    uart_cli:~$ <info> app: PERIPHERAL: BLE_GAP_EVT_AUTH_STATUS: status=0x1 bond=0x0 lv4: 0
    uart_cli:~$ <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x1, procedure: Bonding, error: 1
    uart_cli:~$ <info> app: CENTRAL: Disconnected, handle: 1, reason: 0x13
    uart_cli:~$ connect 1uart_cli:~$ uart_cli:~$ <info> app: Try again with correct peer ID.
    uart_cli:~$ bonded_devices Peers count: 1 
    ID: 0  address: 40:4F:0C:33:57:2E
    uart_cli:~$ connectr          devicesDevice 70:21:3B:A6:4F:D4 32:c8:53:30:31:30
    Device 74:AB:5C:BE:02:E0 Galaxy S9
    Device 00:16:94:1E:2F:51 MB 660 MS
    Device C8:0A:9C:09:3E:38 Tile
    Device 58:0E:A3:72:C2:D5 DUT-SLAVE
    Device 6A:99:24:40:D5:B1 DUT-SLAVE
    Device D1:43:9F:52:61:E0 tkr
    Device DB:AB:F6:1A:AE:D9 Tile
    Device 47:2E:8C:88:AC:44 [LG] webOS TV UJ630V
    Device 00:16:94:28:DB:DD MB 660 MS
    uart_cli:~$ s clear_devices uart_cli:~$ devicesuart_cli:~$ scan ion   onScan started
    uart_cli:~$ <info> app: Scanning
    uart_cli:~$ deivce    vicesDevice 47:2E:8C:88:AC:44 [LG] webOS TV UJ630V
    Device 63:E6:16:87:34:95 DUT-SLAVE
    uart_cli:~$ devicesDevice 47:2E:8C:88:AC:44 [LG] webOS TV UJ630V
    Device 63:E6:16:87:34:95 DUT-SLAVE
    Device 76:96:79:E1:F2:69 Galaxy S9
    Device DB:AB:F6:1A:AE:D9 Tile
    Device 5E:55:46:9F:0C:D3 32:c8:53:30:31:30
    uart_cli:~$ connect Galaxyuart_cli:~$ uart_cli:~$ <info> app: Device not found
    uart_cli:~$ connect Galaxy      76:96:79:E1:F2:69uart_cli:~$ uart_cli:~$ <info> app: CENTRAL: Connecting...
    uart_cli:~$ Connected to address: uart_cli:~$ 76 uart_cli:~$ 96 uart_cli:~$ 79 uart_cli:~$ E1 uart_cli:~$ F2 uart_cli:~$ 69 uart_cli:~$ 
    uart_cli:~$ <info> app: CENTRAL: Connected, handle: 1.
    uart_cli:~$ Current MTU: 247
    uart_cli:~$ MTU changed successfully
    uart_cli:~$ pair LESC 
      40:4F:0C:33:57:2E76:96:79:E1:F2:69
    uart_cli:~$ pair LESC <info> app: Data length updated to 251 bytes.
    uart_cli:~$ pair LESC 76:96:79:E1:F2:69 
      mitmoob
    uart_cli:~$ pair LESC 76:96:79:E1:F2:69 Start pairing
    uart_cli:~$ <info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 1
    uart_cli:~$ Connection parameters update success
    uart_cli:~$ <info> app: PERIPHERAL: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 0
    uart_cli:~$ <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 1, procedure: Bonding
    uart_cli:~$ Connection parameters update success
    uart_cli:~$ gatt e services 
      40:4F:0C:33:57:2E76:96:79:E1:F2:69
    uart_cli:~$ gatt services 76:96:79:E1:F2:69 uart_cli:~$ <info> app: GATT Services
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Services count: 5
    uart_cli:~$ Found service UUIDs: 
    uart_cli:~$ UUID: 1801 type: 0x1
    uart_cli:~$ UUID: 1800 type: 0x1
    uart_cli:~$ UUID: AAA0 type: 0x7
    uart_cli:~$ UUID: 181C type: 0x1
    uart_cli:~$ UUID: 180F type: 0x1
    uart_cli:~$ gatt characteristics 
      40:4F:0C:33:57:2E76:96:79:E1:F2:69
    uart_cli:~$ gatt characteristics 76:96:79:E1:F2:69 AAA0uart_cli:~$ <info> app: Count: 2
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 29
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 2A
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: AAA1
    uart_cli:~$ <info> app: m_srv_char.char_decl.handle: 2F
    uart_cli:~$ <info> app: m_srv_char.char_value_handle: 30
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: AAA2
    uart_cli:~$ Characteristic UUID: AAA1
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 1 uart_cli:~$ write_wo_resp: 0 uart_cli:~$ write: 0 uart_cli:~$ notify: 1
    uart_cli:~$ indicate: 0 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Characteristic UUID: AAA2
    uart_cli:~$ Parameters:
    uart_cli:~$ broadcast: 0 uart_cli:~$ read: 0 uart_cli:~$ write_wo_resp: 1 uart_cli:~$ write: 1 uart_cli:~$ notify: 0
    uart_cli:~$ indicate: 1 uart_cli:~$ auth_signed_wr: 0
    uart_cli:~$ Number of characteristics: 2
    uart_cli:~$ <info> app: Discovers Descriptors
    uart_cli:~$ <info> app: err_code: 0
    uart_cli:~$ <info> app: Count in descriptor: 1
    uart_cli:~$ gatt read 
      40:4F:0C:33:57:2E76:96:79:E1:F2:69
    uart_cli:~$ gatt read 76:96:79:E1:F2:69 AAA1uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ Read data:
    uart_cli:~$ 0x1E uart_cli:~$ 0x0 uart_cli:~$ 
    uart_cli:~$ 

    I think it has to do with some settings in the config file or where ever. The hearing aid have 5 custom VS UUID services and quite a few VS UUID characteristics. I have already turned up NRF_SDH_BLE_VS_UUID_COUNT, but perhaps I have to turn another setting up?

  • And another thing, if I connect to the hearingaid using my phone, and using nrf connect, I get all services and characteristics, so the hearingaids works just fine.

  • Thanks Dresse,  I have reproduced the issue here with the ble_app_uart. Seems like we have an issue if it's not the 16 bit Bluetooth UUID. I will investigate a little bit more and get back to you.

  • Hi Dresse, 

    I found that in the code, when we find an 128 bit UUID we only assign the value of the 128 bit UUID base into the UUID database, without assigning the 16 bit short UUID of that service to the service uuid. So that why they were all 0. So if you add this line of code

                    mp_device_srv[conn_handle]->services[i].uuid.uuid = (uuid.uuid128[13]<<8)+uuid.uuid128[12];

    after  

    err_code = sd_ble_uuid_vs_add(&uuid, &mp_device_srv[conn_handle]->services[i].uuid.type);
    APP_ERROR_CHECK(err_code);

    inside on_read_rsp() in ble_m.c , then you should be able to see the UUID on the first time when you do service discovery. 

    In addition , in characteristic discovery we won't take in to account that the characteristic may have different base UUID, we assume that the characteristic would have same base uuid as the service. 

    Could you update the code, and also let me know what the problem you currently have ?  I would suggest you to test with the ble_app_uart first before you test with your device. 

  • So, I don't quite understand what you mean about base uuid. I have attached one of the custom uuid, that is in the hearing aid.

     

    I still have my problem of not being able to see the custom characteristics inside the custom service, well I can see it, but I can't see the specific uuid for it. But if I understand what you said correctly, because my custom characteristics, does not have the same base uuid as the service, it can't see it?

    And you are suggesting me to test with ble_app_uart, but do you mean ble_app_uart_c? Because my nrf52 dk is acting as a central and connecting with a peripheral.

Reply
  • So, I don't quite understand what you mean about base uuid. I have attached one of the custom uuid, that is in the hearing aid.

     

    I still have my problem of not being able to see the custom characteristics inside the custom service, well I can see it, but I can't see the specific uuid for it. But if I understand what you said correctly, because my custom characteristics, does not have the same base uuid as the service, it can't see it?

    And you are suggesting me to test with ble_app_uart, but do you mean ble_app_uart_c? Because my nrf52 dk is acting as a central and connecting with a peripheral.

Children
  • Hi Dresse, 

    Yes you can test with the ble_app_uart. The GAP role is a little bit different but the service discovery from the GATT client is the same. 
    We have the base UUID which is the 128 bit UUID and the short 16 bit UUID which is byte 12 and 13 inside the 128 bit UUID. This is explained in the description of sd_ble_uuid_vs_add() 

    You can use nRF Connect on the phone and do service discovery for the ble_app_uart you can see how the service and characteristic share the same base UUID and only byte 12 and 13 are different. 

    In your att table, I can see that all characteristics and service have different base UUID. 

    In this case you would need to modify the ble_m.c library to support UUID read on the characteristic discovery, the same way as we have in the service discovery. Please have a look at  on_primary_srv_discovery_rsp() and on_read_rsp() function, where we do a sd_ble_gattc_read() on each service that has the uuid.type == BLE_UUID_TYPE_UNKNOWN

    You would need to add the code to do the same when doing characteristic discovery. 

    I'm a little bit busy at the moment, if I managed to have time I can try to implement but I would suggest you to try first. 

  • Thanks, that explains a lot! I will try to implement it myself.

  • I have been trying to implement it myself, but I am kind of stuck. Inside on_characteristics_discovery_rsp, I have made a check each characteristic that has uuid.type == BLE_UUID_TYPE_UNKNOWN:

            // Save characteristics data.
           for (uint8_t i = offset; i < bytes_to_copy; i++)
           {
               m_srv_char.char_data[i].decl_handle      = p_char_disc_rsp_evt->chars[i].handle_decl;
               m_srv_char.char_data[i].value_handle     = p_char_disc_rsp_evt->chars[i].handle_value;
               m_srv_char.char_data[i].uuid             = p_char_disc_rsp_evt->chars[i].uuid;
               m_srv_char.char_data[i].notify           = p_char_disc_rsp_evt->chars[i].char_props.notify;
               m_srv_char.char_data[i].cccd_desc_handle = 0;
    
           }
    
           // If service UUID type is unknown, then try to search for the 128-bit UUID.
           for (uint8_t i = offset; i < bytes_to_copy; i++)
           {
        	   if (m_srv_char.char_data[i].uuid.type == BLE_UUID_TYPE_UNKNOWN){
        		   NRF_LOG_INFO("Characteristic is unknown");
        		   m_vendor_uuid_read_char = true;
    			   // Look for characteristic 128-bit UUID.
    			   err_code = sd_ble_gattc_read(conn_handle, m_srv_char.char_data[i].decl_handle, 0);
    			   APP_ERROR_CHECK(err_code);
    			   return;
    			 }
    
               // If characteritics is last.
               if (i == (count - 1))
               {
                   m_vendor_uuid_read_char = false;
                   // Print services UUID. When you first discover services, the 128-bit UUIDs may not be displayed.
                   // In such case, you should rediscover the services.
                   uuid_print(p_ble_gattc_evt->conn_handle, mp_device_srv[conn_handle]->services);
               }
               offset++;
           }

    After it gets all characteristics, and the types, it check whether one of them is VS UUID, then it calls err_code = sd_ble_gattc_read(conn_handle, m_srv_char.char_data[i].decl_handle, 0);, with decl_handle for the characteristic which type is unknown. I also made a new bool m_vendor_uuid_read_char, so that when i enter on_read_rsp, I know what I asked for. Inside on_read_rsp, I kinda made the same af with service discovery:

        else if(m_vendor_uuid_read_char){
            // Save characteristics uuid data.
           for (uint8_t i = 0; i < m_srv_char.count; i++)
           {
        	   NRF_LOG_INFO("Handle search: %d And reached handle: %d", m_srv_char.char_data[i].decl_handle, p_read_rsp->handle)
        	   if(p_read_rsp->handle == m_srv_char.char_data[i].decl_handle){
        		   NRF_LOG_RAW_INFO("Data len: %d Read data:\r\n", p_read_rsp->len);
    			  for (uint8_t i = 0; i < p_read_rsp->len; i++)
    			  {
    				  NRF_LOG_RAW_INFO("0x%X ", p_read_rsp->data[i]);
    			  }
    			  NRF_LOG_RAW_INFO("\r\n");
        		  memcpy(uuid.uuid128, p_read_rsp->data, sizeof(uuid.uuid128));
        		  err_code = sd_ble_uuid_vs_add(&uuid, &m_srv_char.char_data[i].uuid.type);
        		  APP_ERROR_CHECK(err_code);
        		  m_srv_char.char_data[i].uuid.uuid = (uuid.uuid128[13]<<8)+uuid.uuid128[12];
        		  NRF_LOG_INFO("m_srv_char.char_data.uuid: %X", m_srv_char.char_data[i].uuid.uuid);
        		  break;
        	   }
           }
    
    
           for (uint8_t i = 0; i < m_srv_char.count; i++)
           {
        	   if (m_srv_char.char_data[i].uuid.type == BLE_UUID_TYPE_UNKNOWN)
    			  {
        		   m_vendor_uuid_read_char = true;
    				  // Look for service 128-bit UUID.
    				  err_code = sd_ble_gattc_read(conn_handle, m_srv_char.char_data[i].decl_handle , 0);
    				  APP_ERROR_CHECK(err_code);
    				  return;
    			  }
    
        	   if(i == (m_srv_char.count -1)){
        		   NRF_LOG_INFO("Characteristics count: %d", m_srv_char.count);
        		   // Print services UUID. When you first discover services, the 128-bit UUIDs may not be displayed.
        		   // In such case, you should rediscover the services.
        		   m_vendor_uuid_read_char = false;
        		   uuid_char_print(m_srv_char);
        	   }
           }
           return;
        }

    But now im facing some problems, my data length in p_read_rsp->len, is 19 when receiving the response. I think it might have to do that, i'm asking for the handle of the characteristic declaration, and I it might send more data, than just the char uuid. I'm basically doing the same as in when doing custom Service Discovery. And I have also uploaded my log file for a full overview.

    =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2018.11.22 15:22:18 =~=~=~=~=~=~=~=~=~=~=~=
    
    
    uart_cli:~$ BLE app with command line interface example started.
    uart_cli:~$ Press Tab to view all available commands.
    uart_cli:~$ 
      advertiseballocbonded_devicesclear
      clear_devicescliconnectconnected_devices
      device_namedevicesdisconnectgatt
      historykey_replylogmpu
      numericpairparametersprivacy
      queueremove_bondresizescan
    uart_cli:~$ connect 1uart_cli:~$ uart_cli:~$ <info> app: Scanning
    uart_cli:~$ Connected to address: uart_cli:~$ 08 uart_cli:~$ AE uart_cli:~$ D6 uart_cli:~$ 81 uart_cli:~$ 3F uart_cli:~$ 26 uart_cli:~$ 
    uart_cli:~$ <info> app: CENTRAL: Connected, handle: 0.
    uart_cli:~$ <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Encryption
    uart_cli:~$ Current MTU: 247
    uart_cli:~$ MTU changed successfully
    uart_cli:~$ <info> app: Data length updated to 251 bytes.
    uart_cli:~$ <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Encryption
    uart_cli:~$ gatt services 08:AE:D6:81:3F:26 Connection parameters update success
    uart_cli:~$ gatt services 08:AE:D6:81:3F:26 uart_cli:~$ <info> app: GATT Services
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Saving all Service DATA
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ Data len: 16 Read data:
    uart_cli:~$ 0xFF uart_cli:~$ 0xEE uart_cli:~$ 0xDD uart_cli:~$ 0xCC uart_cli:~$ 0xBB uart_cli:~$ 0xAA uart_cli:~$ 0x0 uart_cli:~$ 0x80 uart_cli:~$ 0x0 uart_cli:~$ 0x10 uart_cli:~$ 0x0 uart_cli:~$ 0x0 uart_cli:~$ 0xA0 uart_cli:~$ 0xAA uart_cli:~$ 0x0 uart_cli:~$ 0x0 uart_cli:~$ <info> app: Service type: 0
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ Data len: 16 Read data:
    uart_cli:~$ 0x63 uart_cli:~$ 0xA0 uart_cli:~$ 0x39 uart_cli:~$ 0x38 uart_cli:~$ 0xC8 uart_cli:~$ 0xE8 uart_cli:~$ 0xB1 uart_cli:~$ 0x87 uart_cli:~$ 0xD1 uart_cli:~$ 0x43 uart_cli:~$ 0xC2 uart_cli:~$ 0xC4 uart_cli:~$ 0x62 uart_cli:~$ 0xAE uart_cli:~$ 0x23 uart_cli:~$ 0xA uart_cli:~$ <info> app: Service type: 0
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ Data len: 16 Read data:
    uart_cli:~$ 0x5A uart_cli:~$ 0xBF uart_cli:~$ 0x9F uart_cli:~$ 0xD9 uart_cli:~$ 0x68 uart_cli:~$ 0x43 uart_cli:~$ 0xF3 uart_cli:~$ 0xAC uart_cli:~$ 0x74 uart_cli:~$ 0x4F uart_cli:~$ 0x53 uart_cli:~$ 0x21 uart_cli:~$ 0xAF uart_cli:~$ 0x2E uart_cli:~$ 0x77 uart_cli:~$ 0x56 uart_cli:~$ <info> app: Service type: 0
    uart_cli:~$ <info> app: Services count: 7
    uart_cli:~$ Found service UUIDs: 
    uart_cli:~$ UUID: 1801 type: 0x1
    uart_cli:~$ UUID: 1800 type: 0x1
    uart_cli:~$ UUID: AAA0 type: 0x2
    uart_cli:~$ UUID: 181C type: 0x1
    uart_cli:~$ UUID: 180F type: 0x1
    uart_cli:~$ UUID: AE62 type: 0x3
    uart_cli:~$ UUID: 2EAF type: 0x4
    uart_cli:~$ gatt characteristics 08:AE:D6:81:3F:26 AE62uart_cli:~$ <info> app: Count: 2
    uart_cli:~$ <info> app: Characteristic is unknown
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Handle search: 62 And reached handle: 62
    uart_cli:~$ Data len: 19 Read data:
    uart_cli:~$ 0x1A uart_cli:~$ 0x3F uart_cli:~$ 0x0 uart_cli:~$ 0x87 uart_cli:~$ 0xFC uart_cli:~$ 0x4D uart_cli:~$ 0xEF uart_cli:~$ 0x6C uart_cli:~$ 0x1 uart_cli:~$ 0x30 uart_cli:~$ 0x94 uart_cli:~$ 0x64 uart_cli:~$ 0x47 uart_cli:~$ 0x2 uart_cli:~$ 0x30 uart_cli:~$ 0x2E uart_cli:~$ 0xB5 uart_cli:~$ 0xFA uart_cli:~$ 0x6E uart_cli:~$ 
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: 247
    uart_cli:~$ <info> app: Enters VS UUID Discovery
    uart_cli:~$ <info> app: Handle search: 62 And reached handle: 65
    uart_cli:~$ <info> app: Handle search: 65 And reached handle: 65
    uart_cli:~$ Data len: 19 Read data:
    uart_cli:~$ 0x2 uart_cli:~$ 0x42 uart_cli:~$ 0x0 uart_cli:~$ 0x33 uart_cli:~$ 0xC2 uart_cli:~$ 0x53 uart_cli:~$ 0x49 uart_cli:~$ 0xA8 uart_cli:~$ 0x9B uart_cli:~$ 0x3B uart_cli:~$ 0xB1 uart_cli:~$ 0xB9 uart_cli:~$ 0x4B uart_cli:~$ 0xB6 uart_cli:~$ 0x70 uart_cli:~$ 0x69 uart_cli:~$ 0x6F uart_cli:~$ 0xEE uart_cli:~$ 0xEB uart_cli:~$ 
    uart_cli:~$ <info> app: m_srv_char.char_data.uuid: B64B
    uart_cli:~$ <info> app: Characteristics count: 2
    uart_cli:~$ Found characteristics UUID: 
    uart_cli:~$ UUID: 247 type: 0x5
    uart_cli:~$ UUID: B64B type: 0x6
    uart_cli:~$ 

  • Hi,

    It's pretty strange to see 19 bytes. I can see the UUID is actually inside that 19 bytes , started from 0x87 ended with 0x6E . It's your first characteristic's UUID.

    Could you try to open a new application and try just to do a sd_ble_gattc_read() on that exact handle of the characteristic and see what response you have 16 or 19  bytes ? Then test with a known example (ble_app_uart) so we can reproduce here. 

  • Hi Hung,

    I thought to let you know, that right now, i'm testing with my phone as a peripheral, where I am using nrf connect app, and then I have entered my custom service UUID and custom characteristic. I'm not going to work until monday, to get the hearingaid. I haven't been able to use the correct hearingaid, since I made the custom code to characteristic, but I'm simulating it with my phone. But I don't think that should be a problem?

    Now moving on to the test, I tested it by creating a new command for the CLI, where when I called the command, it would go straight to a sd_ble_gattc_read() with the exact handle i.e. 62, and this gave me the same response with 19 bytes.

    I tried to build a new project with ble_app_uart, but that use an extra J-link right? I don't have that, but I don't know if it is easy to direct it to the normal uart connection, so that I can see it via PuTTy?

Related