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

The nrf51422 couldn't able to discover the service.

Hi,

I am using nrf51422  dk board using  sdk 12.3  and soft device  s130 in keil5 ide. In our project i am using nrf51422 board as central and other controller Bluetooth board (cc256 moda which is BLE  and classic Bluetooth) is used as peripheral. I am using the example program ble_app_uart (central )program for nrf 51 board by using the device name i am able to connect to the peripheral but is not discovering the service.I have changed the base uuid of the peripheral in the nrf51 central program. The base uuid of the peripheral is" 14839a42167340cf2339" .The problem here is we have 4 characteristics 

such as TX characteristic, TX credits characteristic, RX characteristic, RX credits characteristic which i have attached the uuid of these.Here the uuid of all the characteristic is different but here in the nordic uart program the uuid are same but only one 1 byte is changed and also there are 2 characteristic which are  tx and rx but here we have 4 with different uuid. Can you plz tell me how to use these 4 characteristic uuid and with different uuid .I am not getting how to discover the service. plz help me to resolve the issue

Parents Reply Children
  • I am using nrf51422 as central in our project.

    Plz help me

  • Hi,

    I have made changes in the program like this

    uint32_t ble_nus_c_init(ble_nus_c_t * p_ble_nus_c, ble_nus_c_init_t * p_ble_nus_c_init)
    {
        uint32_t      err_code;
        ble_uuid_t    uart_uuid;
        ble_uuid128_t nus_base_uuid = NUS_BASE_UUID;
    	  ble_uuid128_t nus_tx_char_uuid = NUS_TX_CHARACTERISTIC_UUID;
        ble_uuid128_t nus_rx_char_uuid = NUS_RX_CHARACTERISTIC_UUID;
    	ble_uuid128_t nus_tx1_char_uuid = NUS_TX1_CHARACTERISTIC_UUID;
      ble_uuid128_t nus_rx1_char_uuid = NUS_RX1_CHARACTERISTIC_UUID;
     
     
    	 
       // printf("INIT\r\n");
        
        VERIFY_PARAM_NOT_NULL(p_ble_nus_c);
        VERIFY_PARAM_NOT_NULL(p_ble_nus_c_init);
    
        err_code = sd_ble_uuid_vs_add(&nus_base_uuid, &p_ble_nus_c->uuid_type);
        VERIFY_SUCCESS(err_code);
    	printf("ddd===%d\r\n",err_code);
    	  printf("ble_uuid\r\n");
    	if(err_code==NRF_SUCCESS)
    	{
    		
        printf("sd_ble_uuid\r\n");
    	}
        uart_uuid.type = p_ble_nus_c->uuid_type;
        uart_uuid.uuid = BLE_UUID_NUS_SERVICE;
    	  err_code = sd_ble_uuid_vs_add(&nus_tx_char_uuid, &p_ble_nus_c->uuid_type);
        VERIFY_SUCCESS(err_code);
        uart_uuid.type = p_ble_nus_c->uuid_type;
        uart_uuid.uuid = BLE_UUID_NUS_TX_CHARACTERISTIC;
        err_code = sd_ble_uuid_vs_add(&nus_rx_char_uuid, &p_ble_nus_c->uuid_type);
        VERIFY_SUCCESS(err_code);
        uart_uuid.type = p_ble_nus_c->uuid_type;
        uart_uuid.uuid = BLE_UUID_NUS_RX_CHARACTERISTIC;
    err_code = sd_ble_uuid_vs_add(&nus_tx1_char_uuid, &p_ble_nus_c->uuid_type); VERIFY_SUCCESS(err_code); uart_uuid.type = p_ble_nus_c->uuid_type; uart_uuid.uuid = BLE_UUID_NUS_TX1_CHARACTERISTIC; err_code = sd_ble_uuid_vs_add(&nus_rx1_char_uuid, &p_ble_nus_c->uuid_type); VERIFY_SUCCESS(err_code); uart_uuid.type = p_ble_nus_c->uuid_type; uart_uuid.uuid = BLE_UUID_NUS_RX1_CHARACTERISTIC; // printf("%d\r\n",uart_uuid.uuid); // printf("%d\r\n",uart_uuid.type); p_ble_nus_c->conn_handle = BLE_CONN_HANDLE_INVALID; p_ble_nus_c->evt_handler = p_ble_nus_c_init->evt_handler; p_ble_nus_c->handles.nus_rx_handle = BLE_GATT_HANDLE_INVALID; p_ble_nus_c->handles.nus_tx_handle = BLE_GATT_HANDLE_INVALID; return ble_db_discovery_evt_re



    and i have made vs_uuid_count=5 not with this function  NRF_SDH_BLE_VS_UUID_COUNT as
    as this definition is not there in this sdk 12.3... still it is not connecting and
    it is not executing this function the errcode is not success for this function .
    can you help me

  • Kindly check the changes and replay..I am waiting for the replay

  • For each call to sd_ble_uuid_vs_add() it will return a unique uuid_type that you should re-use when calling sd_ble_gatts_service_add() later to get the wanted UUID for the service.

Related