I've created a custom service for a demonstration. I can view the see the device in Master Control Panel and view notifications and write to a characteristic that is writeable (to control an LED). The custom service uses a 128-bit UUID. That custom service has a temperature and an LED characteristic. The peripheral also includes the standard battery service. Because of the overall size of the services that must be advertised, I end up using a scan response in addition to the main advertisement. I can see that Master Control Panel can see both the advertising data and the scan response. I have followed somewhat the ble_app_uart_c and the nus service as a model for advertising the custom service and scanning for it on the central. However, I simply can't seem to capture the advertising report or parse it in a way that lets my central find the peripheral.
I'm looking for advice on how to debug this. The area I've focused on is is the on_ble_evt handler, which looks for (among other things), an evt_id BLE_GAP_EVT_ADV_REPORT.
When it sees this, it calls is_uuid_present with my ble_uuid_t structure as the target. Setting breakpoints and stepping in IAR doesn't really work for me. I think the SoftDevice gets time to execute between debugger stepping and Asserts. So I've instrumented the code with some print information. One of the things I display is any report with the scanrsp bit set. I never see this message displayed. I also display when any 128-bit service is found in the field_type. I never see this message either.
I'm not sure what to do because MCP shows that my device is advertising and once connected/bonded to it, I can see the notifications and write to the LED characteristic. I don't know why my central device won't pick up the advertising/scanrsp data, though.
I'm attaching the main for the central and peripheral as well as the service files for each: whts and whts_c.