mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-08 07:33:53 +01:00
hidpp10: allow the caller to set the open_lock timeout
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -1057,9 +1057,11 @@ hidpp10_read_memory(struct hidpp10_device *dev, uint8_t page, uint16_t offset,
|
||||
}
|
||||
|
||||
int
|
||||
hidpp10_open_lock(struct hidpp10_device *device)
|
||||
hidpp10_open_lock(struct hidpp10_device *device, uint8_t timeout)
|
||||
{
|
||||
union hidpp10_message open_lock = CMD_DEVICE_CONNECTION_DISCONNECTION(0x00, CONNECT_DEVICES_OPEN_LOCK, 0x08);
|
||||
union hidpp10_message open_lock = CMD_DEVICE_CONNECTION_DISCONNECTION(0x00,
|
||||
CONNECT_DEVICES_OPEN_LOCK,
|
||||
timeout);
|
||||
|
||||
return hidpp10_request_command(device, &open_lock);
|
||||
}
|
||||
|
||||
@@ -469,8 +469,14 @@ hidpp10_read_memory(struct hidpp10_device *dev,
|
||||
/* 0xB2: Device Connection and Disconnection (Pairing) */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Open the receiver's lock to allow new devices be paired with this
|
||||
* receiver. The timeout is in seconds, a value of 0 uses the device's
|
||||
* default value (30s).
|
||||
*/
|
||||
int
|
||||
hidpp10_open_lock(struct hidpp10_device *device);
|
||||
hidpp10_open_lock(struct hidpp10_device *device, uint8_t timeout);
|
||||
|
||||
int
|
||||
hidpp10_disconnect(struct hidpp10_device *device, int idx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user