bsp button no release event after connect to the nRFConnect.

Hi,

I want to use the bsp button to our project, so I tested on the example "ble_app_blinky",

I modified the app button to bsp button,  add two custom events to the bsp_event_t enum in the bsp.h, and then test, 

Before connect to the android App nRF Connect, the bsp button can work ok, BSP_BUTTON_ACTION_PUSH , BSP_BUTTON_ACTION_RELEASE, BSP_BUTTON_ACTION_LONG_PUSH are all work ok. 

After connect to the nRF Connect, there are problem,  only BSP_BUTTON_ACTION_PUSH can work, BSP_BUTTON_ACTION_RELEASE and LONG_PUSH  can not work.

Attached the code, would you please help me to review?  why it can only detect push event,  can not detect release and long push event after conncet to the App ?  Thank you very much.

Best wishes,

Susan

Parents
  • Hi,

    I tested you code, but I see all events on the log, even after connecting with nRF Connect on Android:

    <info> app: button short released
    <info> app: button released state: 0
    <info> app: button short pressed
    <info> app: button pressed state: 1
    <info> app: button long pressed 
    <info> app: button short released
    <info> app: button released state: 0
    <info> app: Connected
    <info> app: button short pressed
    <info> app: button pressed state: 1
    <info> app: button short released
    <info> app: button released state: 0
    <info> app: button short pressed
    <info> app: button pressed state: 1
    <info> app: button long pressed 
    <info> app: button short released
    <info> app: button released state: 0

    Did you do something else after connecting?

    Have you tried the code with the unmodified ble_app_blinky example?

    Best regards,
    Jørgen

  • bsp_btn_ble is using the same button ID that you use in your application (0). The button actions are reconfigured in connection_buttons_configure(), which is called on a CONNECTED event.

    You should not use the same button in your application and bsp_btn_ble at the same time, as this may break the flow in the library.

Reply Children
Related