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:
Peter Hutterer
2015-10-19 09:55:21 +10:00
parent 983c830ff3
commit 65db99334b
2 changed files with 11 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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);