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

ble central and peripheral + hid ble problem

Hello Nordic Team,

Currently i'm trying to join my custom HID (a joystick) with the ble_app_hrs_rscs_relay example  (SDK 16) for a personal project which consist in: a nrf52832 working as slave and another working as “my custom relay”. In the slave device I’m using the ble_app_hrs example code without any modifications. While my second nrf52832 is in central role, the relay scan’s (filter by name and UUID are set) and can connect to slave device. Instead, in peripheral mode that device is working as HID Joystick and can connect to a PC and smartphones… but the data it’s not sent. In debug mode I can see the ble_hids_inp_rep_send return a failure message.  I think the problem is relate to enable notifications, but I’m not sure…  

This are the main changes in the ble_app_hrs_rscs_relay.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**@brief Function for initializing the advertising functionality.
*/
static void advertising_init(void)
{
ret_code_t err_code;
ble_advertising_init_t init;
memset(&init, 0, sizeof(init));
init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
init.advdata.include_appearance = true;
init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
init.advdata.uuids_complete.p_uuids = m_adv_uuids;
int8_t tx_power = -20;// Set Power Level
init.advdata.p_tx_power_level = &tx_power;
init.config.ble_adv_whitelist_enabled = true;
init.config.ble_adv_directed_high_duty_enabled = true;
init.config.ble_adv_directed_enabled = false;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

Your help will be greatly appreciable.

Thanks in advance for your support.

Regards,