Dears
I double the ble_nus_init as below ,I can get 2 service bouth have 2 characteritic.
as below:
err_code = nrf_ble_qwr_init (&m_qwr, &qwr_init);
APP_ERROR_CHECK (err_code);
// Initialize NUS.
memset (&nus_init, 0, sizeof (nus_init));
nus_init.data_handler = nus_data_handler;
err_code = ble_nus_init (&m_nus, &nus_init);
APP_ERROR_CHECK (err_code);
////// double service
memset (&nus_init, 0, sizeof (nus_init));
nus_init.data_handler = nus_data_handler1;
err_code = ble_nus_init1 (&m_nus1, &nus_init);
APP_ERROR_CHECK (err_code);
///// third times copy service
// memset (&nus_init, 0, sizeof (nus_init));
// nus_init.data_handler = nus_data_handler2;
// err_code = ble_nus_init2 (&m_nus2, &nus_init);
// APP_ERROR_CHECK (err_code);
(1)But when I copy the ble_nus_init2 again for third time, the nrf_app_uart can't work, no advertising send out, Jlink RTT log as below:
<00> error> app: ERROR 4 [NRF_ERROR_NO_MEM] at ..\..\..\main.c:375 00> 00> PC at: 0x00020551 00> <00> error> app: End of error report
(2) though 2 service 4 characteristic is success ,but one of the 4 characteristics must be BLE_UUID_TYPE_BLE or BLE_UUID_TYPE_UNKNOWN,
if I set 4 characteristics all are BLE_UUID_TYPE_VENDOR_BEGIN, the nrf_app_uart will not work, Jlink RTT log as below:
<00> error> app: ERROR 4 [NRF_ERROR_NO_MEM] at ..\..\..\main.c:369 00> 00> PC at: 0x00020535 00> <00> error> app: End of error report 00>
How can I control this 4 characteristics UUID, if one of the 4 characteristics is BLE_UUID_TYPE_BLE or BLE_UUID_TYPE_UNKNOWN, the UUID will be end with 0xFB,
as my last quest, which not be control by me.
How Can I build 3 services base on nrf_app_uart example.
Roger Hunag
Thuangks for support!