Hi guys
I want connect nrf51822 (Raytac MDBT40) by my phone(HTC battery one android 4.4.2).
I use softdevice 130(ver.2.0.0) and SDK 11 demo code under KEIL ARM 5. (Nordic Semiconductor\nRF5_SDK_11.0.0_89a8197\examples\ble_peripheral\ble_app_uart\pca10028\s130\arm5_no_packs)
I don't need to use UART now, so I comment out uart_init(); and buttons_leds_init(&erase_bonds); in main function.
When process starting running, I can find bluetooth device on my phone.
But I can't connect it.(I have try setting->bluetooth and nRF UART.)
I check static void on_ble_evt(ble_evt_t * p_ble_evt).
It try to connect but disconnect immediately.
static void on_ble_evt(ble_evt_t * p_ble_evt)
{
uint32_t err_code;
switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_CONNECTED:
err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
APP_ERROR_CHECK(err_code);
m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
SEGGER_RTT_WriteString(0, "CONNECTED \n");
break;
case BLE_GAP_EVT_DISCONNECTED:
err_code = bsp_indication_set(BSP_INDICATE_IDLE);
APP_ERROR_CHECK(err_code);
m_conn_handle = BLE_CONN_HANDLE_INVALID;
SEGGER_RTT_WriteString(0, "uccu \n");
break;
case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
// Pairing not supported
err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
APP_ERROR_CHECK(err_code);
SEGGER_RTT_WriteString(0, "PARAMS_REQUEST \n");
break;
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
// No system attributes have been stored.
err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
APP_ERROR_CHECK(err_code);
SEGGER_RTT_WriteString(0, "ATTR_MISSING \n");
break;
default:
// No implementation needed.
break;
}
}
The result as following.
0> sd_ble_enable: RAM START at 0x20001FE8
0> Loop Start!
0> CONNECTED
0> PARAMS_REQUEST
0> uccu
If need more information.
Please tell me, thanks.