diff --git a/src/hidpp10.c b/src/hidpp10.c index 0c94dfed..0dbad2b9 100644 --- a/src/hidpp10.c +++ b/src/hidpp10.c @@ -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); } diff --git a/src/hidpp10.h b/src/hidpp10.h index 43f04eb2..ec27724c 100644 --- a/src/hidpp10.h +++ b/src/hidpp10.h @@ -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);