Can't find services using ble_db_discovery_start()

Using FreeRTOS and SDK 15.3 on nRF52840 and SES, SD 140

I'm following along with the NUS example project in this particular release and have a problem I'm a little stumped by:

My board is acting both as a peripheral and client which is looking to connect to another board (running same environment basically).

I've got my board scanning and connecting to the target board (and I see it connecting on the other side).  I eventually need to grab 2 primary UUIDs (128bit) on the target and subscribe to notifications of one of them.  Right now I'm just trying to get to the point of getting notifications on the one that I'm interested in. 

This target is sctructured with 128bit UUID base of {0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E} (little endian) and I'm after the UUID with 0x0001 as the characteristic I'm after (that has a uint16 and a uint32 value to it).

Following the example of the NUS, I add that using sd_ble_uuid_vs_add with code patterned after the NUS

uint32_t ble_rwp_c_init(ble_rwp_c_t * p_ble_rwp_c, ble_rwp_c_init_t * p_ble_rwp_c_init)
{
    uint32_t      err_code;
    ble_uuid_t    uart_uuid;
    ble_uuid128_t rwp_pbase_uuid = RWP_PBASE_UUID;

    VERIFY_PARAM_NOT_NULL(p_ble_rwp_c);
    VERIFY_PARAM_NOT_NULL(p_ble_rwp_c_init);

    err_code = sd_ble_uuid_vs_add(&rwp_pbase_uuid, &p_ble_rwp_c->uuid_type);  
    Assert(err_code == NRF_SUCCESS, "sd_ble_uuid_vs_add 1");

    uart_uuid.type = p_ble_rwp_c->uuid_type;
    uart_uuid.uuid = BLE_UUID_RWP_P_CHARACTERISTIC;  //0x0001

    p_ble_rwp_c->conn_handle           = BLE_CONN_HANDLE_INVALID;
    p_ble_rwp_c->evt_handler           = p_ble_rwp_c_init->evt_handler;
    p_ble_rwp_c->handles.rwp_tx_handle = BLE_GATT_HANDLE_INVALID;      
    p_ble_rwp_c->handles.rwp_rx_handle = BLE_GATT_HANDLE_INVALID;

    return ble_db_discovery_evt_register(&uart_uuid);
}

After this, I fire off the scanner looking for that other board with an autoconnect flag (which it does).  Once I get the BLE_GAP_EVT_CONNECTED I fire off the ble_db_discovery_start() to gather what I can find about this thing.

That said, it never does see the other board: Logs of this section:

[92.322] BLE_C: Connected to C9:8B:EA:A8:49:EB <<-- correct target

[92.323] BLE_C: CENTRAL: Connected, Searching db on conn_handle 0x0

<debug> ble_db_disc: Starting discovery of service with UUID 0x1 on connection handle 0x0. <-- This ain't right...

<debug> nrf_sdh_ble: BLE event: 0x55.
<debug> nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 247 bytes.
<debug> nrf_ble_gatt: Updating ATT MTU to 247 bytes (desired: 247) on connection 0x0.
[92.324] BLE_C: Unhandled central event 0x55
<debug> nrf_sdh_ble: BLE event: 0x3A.
<debug> nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
<debug> ble_db_disc: Starting discovery of service with UUID 0x1 on connection handle 0x0.
[92.354] BLE_C: Unhandled central event 0x3A

<debug> nrf_sdh_ble: BLE event: 0x30. .
<debug> ble_db_disc: Service UUID 0x1 not found.
[92.413] db_disc_handler: callback
[92.413] BLE_C: Unhandled central event 0x30

NOTE: The things in square brackets are my code putting out debug.  The things in the angle brackets are Nordic code debug statements

Q: I see that as a client I need to use sd_ble_uuid_vs_add()  But as a peripheral, I'm using the same call to add a bunch of services that I'm offering as a peripheral

Otherwise, I'm kinda at a loss as to how to get this found and connected up here.  Any hints?

Parents Reply Children
Related