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

hrs_c) how to add 'on_read_rsp' function

Hi, I'm using nRF52832 Software Development Kit, PCA10040, S132.
I'm trying to connect the hrs central to my device and read the data from that.
But the feature of my device is that after it's connected, it doesn't send data until it's brought to the skin.

I am trying to read the data by changing the battery UUID.
'BLE_GATTC_EVT_READ_RSP' calls but fails to read data, so 'BLE_GATTC_EVT_HVX' is not called and 'on_hvx' is also not called.
I think I should activate the 'on_read_rsp' function to get the data from my device.
(I think I should call the function one more time.)

So when I press button 3, I want to call one of those functions, but I don't know how to approach it.
I wrote a case statement about pressing button, and I just need to call it.
 case BSP_INDICATE_ALERT_2:
    m_leds_clear = true;
    bsp_board_led_invert(BSP_LED_BUTTON_3);
    err_code = app_timer_start(m_bsp_leds_tmr, APP_TIMER_TICKS(BSP_BUTTON_PUSH_INTERVAL), NULL);
        
    //add here something...?  

    break;
I don't know if this is the right approach, but I can't think of anything else.
Anyway, is there a way to call the 'on_read_rsp' function again?

Besides what I thought, please tell me various solutions.
BR,
lyrics
  • but your screenshot is from a connection with a peripheral.

    Yes.. 

    Those screenshots show 'My own device' connected to the nRF connect.
    Because it was to explain what data I wanted to receive through the picture.

    In other words, I would like to connect with my own device through the example of hrs_c, as if it were connected to nRF. And I want to read the data that my device sends.
    (Just in case, I organized it one more time. I hope you understand)

    So these are not connected at the same time?

    It is not connected at the same time, but only with hrs_c and my own device.

    What kind of data? Is it heart rate data, or can you use the ble_app_uart peripheral? 

    The data my device sends is not a heart rate.
    It sends long data continuously, such as the yellow underline of screenshots.

    or can you use the ble_app_uart peripheral? 

    I'm not sure I understand. My device is like beacon.. I can't use that example.

  • lyrics said:
    I'm not sure I understand. My device is like beacon.. I can't use that example.

     If you intend to connect to the device and send a lot of custom data, then that is not a beacon. It is a BLE peripheral. I suggest you try the ble_app_uart example. If that is not feasible for you, please explain why.

    BR,

    Edvin

  • Hi, Edvin

    I suggest you try the ble_app_uart example.

    Now I understand. I will try this example.:)

    Thank you for reply!

Related