Hello,
Apologies as I'm very new to C and I may be missing something obvious. I have an actual ble Heart Rate device which I wish to connect to my pca10028 (nrf51422_xxAC.
I am using the example code from the following path.
C:\nordic\examples\ble_central\ble_apps_hrs_c\pca10028\s130\arm5_no_packs\ble_apps_hrs_c_s130_pca10028uvprojx
I've added the necessary files to get SEGGER_RTT_printf to send data to J-Link so I know where the program has execute. It appears the device connects to hrt successfully as it stops advertising.
This line in code fires suggesting it's found the device:
if(extracted_uuid == TARGET_UUID)
{ SEGGER_RTT_printf(0,"uuids match %d",TARGET_UUID);
and this line executes to suggest it had bonded
// Initiate bonding.
err_code = dm_security_setup_req(&m_dm_device_handle);
APP_ERROR_CHECK(err_code);
m_peer_count++;
if (m_peer_count < MAX_PEER_COUNT)
{
scan_start();
}
APPL_LOG("[APPL]: << DM_EVT_CONNECTION\r\n");
SEGGER_RTT_printf(0,"bonded %d", err_code);
But the Heart Rate Collector Handler or Battery Level Collector Handler never fire. So the last output I get on j-link is "bonded0"
Any help would be greatly appreciated.
UPDATE: I've replaced all logging information with SEGGER_RTT and this is the output. Disconnection happens after a minute or so
0> Heart rate collector example
0> sd_ble_enable: RAM START at 0x20001EB0
0> [DM]: >> dm_init.
0> [DM]: Storage handle 0x0003F800.
0> [DM]: >> dm_register.
0> [DM]: Application Instance allocated.
0> [DM]: Created whitelist, number of IRK = 0x00, number of addr = 0x00
0> [APPL]: 180D
0> [DM]:[00]: Connection Instance Allocated.
0> [APPL]: >> DM_EVT_CONNECTION
0> [DM]: >> dm_security_setup_req
0> [DM]: Allocated device instance 0x00
0> [DM]: Initiating authentication request
0> [APPL]: << DM_EVT_CONNECTION
0> [DM]: >> BLE_GAP_EVT_AUTH_STATUS, status 00000085
0> [APPL]: >> DM_EVT_SECURITY_SETUP_COMPLETE
0> [APPL]: << DM_EVT_SECURITY_SETUP_COMPLETE
0> [DM]: Disconnect Reason 0x0013
0> [APPL]: >> DM_EVT_DISCONNECTION
0> [DM]: >> dm_whitelist_create
0> [DM]: Created whitelist, number of IRK = 0x00, number of addr = 0x00
0> [APPL]: << DM_EVT_DISCONNECTION
0> [DM]:[00]: Freed connection instance.