The value of 'buttons' can be 0(BUTTON_NONE) and combined each other.
Change-Id: Ia9ccecb83a9b375c62fd8daa9047fef3c6d1aeda
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
BT_CHECK_INPUT_PARAMETER(remote_address);
BT_CHECK_INPUT_PARAMETER(mouse_data);
- if (mouse_data->buttons != BT_HID_MOUSE_BUTTON_LEFT ||
- mouse_data->buttons != BT_HID_MOUSE_BUTTON_RIGHT ||
- mouse_data->buttons != BT_HID_MOUSE_BUTTON_MIDDLE) {
+ if ((mouse_data->buttons < BT_HID_MOUSE_BUTTON_NONE) ||
+ (mouse_data->buttons > (BT_HID_MOUSE_BUTTON_LEFT |
+ BT_HID_MOUSE_BUTTON_RIGHT | BT_HID_MOUSE_BUTTON_MIDDLE))) {
return BT_ERROR_INVALID_PARAMETER;
}