Hi,
I tried to combine BLE HRS & UART together on nrf51822. The service initialization code is
void advertising_init(void)
{
uint32_t err_code;
ble_advdata_t advdata;
uint8_t flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
ble_uuid_t adv_uuids[] =
{
{BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
{BLE_UUID_HEART_RATE_SERVICE, BLE_UUID_TYPE_BLE},
{BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
{BLE_UUID_NUS_SERVICE, m_nus.uuid_type}
};
// Build and set advertising data
memset(&advdata, 0, sizeof(advdata));
advdata.name_type = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance = true;
advdata.flags.size = sizeof(flags);
advdata.flags.p_data = &flags;
advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
advdata.uuids_complete.p_uuids = adv_uuids;
err_code = ble_advdata_set(&advdata, &scanrsp);
APP_ERROR_CHECK(err_code);
}
However, it failed and threw an error of NRF_ERROR_DATA_SIZE. What's wrong?