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

question about scanning in ble_app_hrs_rscs_relay which is always disconnected with heart rate monitor?

When i use ble_app_hrs to connect with hrs demo(ble_app_hrs example), everything is ok.But when i connect to a heart rate monitor, it always disconnect.The print information is:

[DM]: Disconnect Reason 0x0008

[DM]: --> device_context_store

[DM]:[DI 00]:[CI 00]: -> No update in bonding information.

[DM]: --> gattc_context_store

[DM]: Notifying application of event 0x12

[APPL]: >> DM_EVT_DISCONNECTION

[DM]: >> dm_whitelist_create

[DM]: Created whitelist, number of IRK = 0x00, number of addr = 0x01

[DM]: << dm_whitelist_create

[APPL]: << DM_EVT_DISCONNECTION

[DM]:[CI 0x00]: Freeing connection instance

[DM]:[00]: Freed connection instance.

[DM]: Initializing Connection Instance 0x00000000.

[APPL]: 180d

[DM]: Request to allocation connection instance

[DM]:[00]: Connection Instance Allocated.

[DM]: Searching for device 0xB6 0x99 0x7F 0x04 0xA5 0x78.

[DM]:[DI 0x00]: Device type 0x00.

[DM]: Device Addr 0xB6 0x99 0x7F 0x04 0xA5 0x78.

[DM]: Found device at instance 0x00

[DM]:[00]:[Block ID 0x0003F800]:Loading bond information at 20002f14, size 0x0000001C, offset 0x00000018.

[DM]:[0x00]:[0xFF]: Bond context Event

[DM]: Notifying application of event 0x21

[APPL]: >> DM_EVT_LINK_SECURED

[APPL]: << DM_EVT_DEVICE_CONTEXT_LOADED

[DM]:[00]:Loading service context at 20002f30, size 0x0000000C, offset 0x00000034.

[DM]: --> gattc_context_load

[DM]: Notifying application of event 0x11

[APPL]: >> DM_EVT_CONNECTION

[APPL]:[B6 99 7F 04 A5 78]: Connection Established

[DM]: >> dm_security_setup_req

[DM]: << dm_security_setup_req, 0x00000000

[APPL]: << DM_EVT_CONNECTION

[DM]: >> BLE_GAP_EVT_CONN_SEC_UPDATE, Mode 0x01, Level 0x02

[DM]: --> gattc_context_apply

[DM]: Notifying application of event 0x15

[APPL]: >> DM_LINK_SECURED_IND

[DB]: Starting discovery of service with UUID 0x180d for Connection handle 0

[APPL]: << DM_LINK_SECURED_IND

[DB]: Discovery of service with UUID 0x180d completed with success for Connectionhandle 0

[DB]: Starting discovery of service with UUID 0x180f for Connection handle 0

[DB]: Discovery of service with UUID 0x180f completed with success for Connectionhandle 0

[HRS_C]: Heart Rate Service discovered at peer.

[HRS_C]: Configuring CCCD. CCCD Handle = 19, Connection Handle = 0

[HRS_C]: SD Read/Write API returns Success..

Heart rate service discovered

[BAS_C]: Battery Service discovered at peer.

[APPL]: Battery Service discovered.

[APPL]: Reading battery level.

[BAS_C]: SD Read/Write API returns error. This message sending will be attempted again..

[APPL]: Enabling Battery Level Notification.

[BAS_C]: Configuring CCCD. CCCD Handle = 46, Connection Handle = 0

[BAS_C]: SD Read/Write API returns error. This message sending will be attempted again..

[BAS_C]: SD Read/Write API returns Success..

[APPL]: Battery Level Read as 100 %

Battery = 100 %

[BAS_C]: SD Read/Write API returns Success..

[APPL]: Battery Level received 100 %

Battery = 100 %

What is the problem? Thanks

i use sniffer to get the information below: This is the error information: image description image description

This is the heart rate monitor connect with iphone 6(ios 9.3), that is ok image description

the information file is wireshark format: the err device file:ble_hrm_err.pcapng the ok device fileble_hrm_ok.pcapng

than with the demo "ble_app_hrs_c" of "nRF51_SDK_10.0.0_dc26b5e" and there are something different,when i change the "MAX_CONNECTION_INTERVAL" from "MSEC_TO_UNITS(30, UNIT_1_25_MS)" to MSEC_TO_UNITS(130, UNIT_1_25_MS) after the time increase, i can get a hrm data like this:

Heart rate service discovered Battery = 80 % Battery = 80 % Heart Rate = 73 Heart rate service discovered Battery = 80 % Battery = 80 % Heart Rate = 77

i think there may be some params is error, but i cann't find it.

Related