Hi! I am trying to control volume up/down, and for the future possibly a few other functions within the ID 3 tag of the HID descriptor.
I am using the ble hids mouse example from SDK 13.0.0 for nRF52832, but I'm facing an error which makes me unable to compile the project. I'm using Eclipse 4.6.3.
I've taken the mouse_movement_send function as example, as well as an example written for nRF51, and written my own function to send volume control commands. The error says "variable 'err_code' set but not used", as depicted below. Probably the ble_hids_inp_rep_send function does not operate properly, I'm just not able to see what's wrong right now.
Hope anyone is able to give a guiding hint =)
Description Resource Path Location Type variable 'err_code' set but not used [-Werror=unused-but-set-variable] main.c /ph_ble_hids_mouse/Application line 1223 C/C++ Problem
/**@brief Function for sending volume control actions * * */
static void volume_control_send(int8_t vol_ch_up, int8_t vol_ch_down, int8_t vol_ch_pause) { ret_code_t err_code;
uint8_t buffer[INPUT_REP_MEDIA_PLAYER_LEN];
// uint8_t buffer;
APP_ERROR_CHECK_BOOL(INPUT_REP_MEDIA_PLAYER_LEN == 1);
if(vol_ch_up == 0xE9)
{
buffer[0] = 0xE9;
}
if(vol_ch_down == 0xEA)
{
buffer[0] = 0xEA;
}
if(vol_ch_pause == 0xCD)
{
buffer[0] = 0xCD;
}
err_code = ble_hids_inp_rep_send (&m_hids,
INPUT_REP_REF_MPLAYER_ID,
INPUT_REP_MEDIA_PLAYER_LEN,
(uint8_t*)buffer);
vol_ch_up=0, vol_ch_down=0, vol_ch_pause=0, buffer[0]=0;
}
case BSP_EVENT_KEY_0:
if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
{
//mouse_movement_send(-MOVEMENT_SPEED, 0);
volume_control_send(0xE9, 0, 0);
}
break;
case BSP_EVENT_KEY_1:
if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
{
//mouse_movement_send(0, -MOVEMENT_SPEED);
volume_control_send(0, 0, 0xCD);
}
break;
case BSP_EVENT_KEY_2:
if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
{
//mouse_movement_send(MOVEMENT_SPEED, 0);
volume_control_send(0, 0xEA, 0);
}
break;
case BSP_EVENT_KEY_3:
if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
{
mouse_movement_send(0, MOVEMENT_SPEED);
}
break;
default:
break;