This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Issue for combining NUS central & peripheral

Hi

I am coding a s130 NUS example.

  1. The base example is sdk8.1.0 ble_app_uart peripheral example.

  2. I added central part from Github sdk8.0.0 ble_app_uart_c example .

After I combinedd these two, I tried two PCA10028 with Andorid apps "nRF UART2.0".

These two PCA10028 has same fimrware.

  1. Connect one PCA10028 (Sample A) by Android apps.

  2. Sample A will then connect to another PCA10028 (Sample B). Sample A is central rol fro sample B.

  3. Sample A finished discovering and writing notification enable sample B.

  4. Then, Sample B sent a notification packet to sample A. Sample A did received this packet.

  5. If sample A tried to deliver this notification packet to Android, it failed at

    error"BLE_ERROR_GATTS_SYS_ATTR_MISSING".

err_code = ble_nus_string_send(&m_nus, &u_pkt_buffer[OFFSET],u_pkt_len[u_pop_pkt_cnt]);

if (err_code != NRF_SUCCESS)

{

 if (err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING){     

     err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);      

 }    

 APP_ERROR_CHECK(err_code);    return;   }  

}

I found it seems attribute handle conflicted.

For sample A as a peripheral role, when Android discovered it, it responsed handle number 11 and 14 for NUS RX and TX characteristics.

For sample A as a central role to sample B, since sample B has same firmware as sample A, when sample A discovered sample B, sample B also responded handle number 11 and 14 for NUS RX and TX characteristis.

Any way to solve this problem. Thanks.

Related