aboutsummaryrefslogtreecommitdiff
path: root/sensei-raw-ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sensei-raw-ctl.c')
-rw-r--r--sensei-raw-ctl.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sensei-raw-ctl.c b/sensei-raw-ctl.c
index 3c2dbb6..47b0c4f 100644
--- a/sensei-raw-ctl.c
+++ b/sensei-raw-ctl.c
@@ -189,8 +189,12 @@ static int
sensei_set_intensity (libusb_device_handle *device,
enum sensei_intensity intensity)
{
- unsigned char cmd[32] = { 0x05, 0x01, intensity };
- return sensei_send_command (device, cmd, sizeof cmd);
+ unsigned char cmd_1[32] = { 0x05, 0x01, intensity };
+ unsigned char cmd_2[32] = { 0x05, 0x02, intensity };
+ unsigned result = sensei_send_command (device, cmd_1, sizeof cmd_1);
+ if (result < 0)
+ return result;
+ return sensei_send_command (device, cmd_2, sizeof cmd_2);
}
/** Set pulsation speed. */
@@ -198,8 +202,12 @@ static int
sensei_set_pulsation (libusb_device_handle *device,
enum sensei_pulsation pulsation)
{
- unsigned char cmd[32] = { 0x07, 0x01, pulsation };
- return sensei_send_command (device, cmd, sizeof cmd);
+ unsigned char cmd_1[32] = { 0x07, 0x01, pulsation };
+ unsigned char cmd_2[32] = { 0x07, 0x02, pulsation };
+ unsigned result = sensei_send_command (device, cmd_1, sizeof cmd_1);
+ if (result < 0)
+ return result;
+ return sensei_send_command (device, cmd_2, sizeof cmd_2);
}
/** Set sensitivity in CPI. */