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

ble_app_uart can receive but cannot transmit after enabling pairing without bonding

I am using SDK_11 s130 on nRF51-dk. I ported the peer manager from ble_app_gls to ble_app_uart and enabled pairing without bonding.

Inside ble_nus.c, I modified rx_char_add() to use BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&cccd_md.write_perm); instead of BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.write_perm); to enable pairing.

The security parameters for pairing without bonding that I used is as below;

#define SECURITY_REQUEST_DELAY         	APP_TIMER_TICKS(400, APP_TIMER_PRESCALER)   /**< Delay after connection until Security Request is sent, if necessary (ticks). */
#define SEC_PARAM_BOND                   0  /**< No bonding. */
#define SEC_PARAM_MITM                   0  /**< Man In The Middle protection not required. */
#define SEC_PARAM_LESC                   0  /**< LE Secure Connections not enabled. */
#define SEC_PARAM_KEYPRESS               0  /**< Keypress notifications not enabled. */   
#define SEC_PARAM_IO_CAPABILITIES        BLE_GAP_IO_CAPS_DISPLAY_ONLY               /**< No I/O capabilities. */
#define SEC_PARAM_OOB                    0                                          /**< Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE           7                                          /**< Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE           16                                         /**< Maximum encryption key size. */

sec_param.kdist_own.enc     = 0;
sec_param.kdist_own.id      = 0;
sec_param.kdist_peer.enc    = 0;
sec_param.kdist_peer.id     = 0;

Using the above security parameters for pairing, ble_app_uart is able to receive characters wirelessly from Android app nRF-UART. However, ble_app_uart is not able to transmit characters wirelessly to Android app nRF-UART. The strange thing is that when both pairing and bonding are enabled, 2-way communication with nRF-UART can be done successfully.

What did I miss out? How to debug this problem?

Parents Reply Children
No Data
Related