Hi. i use SDK 9.0.0 and S130_1.0.0.
I want to recieve data from My peripheral S110..
First, I try to recieve data using example "ble_app_uart_c_S120-master".
I could recieve data from peripheral. peripheral's primary service is "NUS".
My peripheral have several primary service. like this.
So, I modify ble_uart_c_init().
uint32_t ble_uart_c_init(ble_uart_c_t * p_ble_uart_c, ble_uart_c_init_t * p_ble_uart_c_init)
{
// ble_uuid128_t nus_base_uuid = {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x01, 0x00, 0x40, 0x6E}}; //NUS
ble_uuid128_t nus_base_uuid = {{0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x01, 0x00, 0x22, 0x22}}; //My peripheral.
uint32_t err_code;
if ((p_ble_uart_c == NULL) || (p_ble_uart_c_init == NULL))
{
return NRF_ERROR_NULL;
}
err_code = sd_ble_uuid_vs_add(&nus_base_uuid, &uart_uuid.type);
printf("BLE_UUID_VS_ADD_ERR_CODE : %d\r\n", err_code);
//NOTE: after this, uart_uuid.type will hold the index of the NUS 128bit base UUID in the UUID database.
//Store and use this to distinguise between characteristics have different 128bit base UUIDs.
if (err_code != NRF_SUCCESS)
{
return err_code;
}
uart_uuid.uuid = BLE_UUID_NUS_SERVICE;
mp_ble_uart_c = p_ble_uart_c;
mp_ble_uart_c->evt_handler = p_ble_uart_c_init->evt_handler;
mp_ble_uart_c->conn_handle = BLE_CONN_HANDLE_INVALID;
mp_ble_uart_c->RX_cccd_handle = BLE_GATT_HANDLE_INVALID;
return ble_db_discovery_evt_register(&uart_uuid, db_discover_evt_handler);
}
but, Scanner repeat evt like this.
BLE_GAP_EVT_CONNECTED - BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP - BLE_GATTC_EVT_CHAR_DISC_RSP - BLE_GATTC_EVT_CHAR_DISC_RSP - BLE_GATTC_EVT_CHAR_DISC_RSP - BLE_GATTC_EVT_DESC_DISC_RSP BLE_GAP_EVT_DISCONNECTED
I check process When this scanner recieve data from NUS.
And i compare using NUS and My peripheral.
But I don't know what should i do.
Please help me. Thank you.