base: Add find_paired_node functions
Avoid the need for hidapi imports and add them to the base API module.
This commit is contained in:
parent
a7ad625023
commit
90c41dbe32
|
@ -14,8 +14,7 @@
|
|||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
# Base low-level functions used by the API proper.
|
||||
# Unlikely to be used directly unless you're expanding the API.
|
||||
"""Base low-level functions as API for upper layers."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
@ -449,6 +448,19 @@ def _get_next_sw_id() -> int:
|
|||
return _get_next_sw_id.software_id
|
||||
|
||||
|
||||
def find_paired_node(receiver_path: str, index: int, timeout: int):
|
||||
"""Find the node of a device paired with a receiver."""
|
||||
return hidapi.find_paired_node(receiver_path, index, timeout)
|
||||
|
||||
|
||||
def find_paired_node_wpid(receiver_path: str, index: int):
|
||||
"""Find the node of a device paired with a receiver.
|
||||
|
||||
Get wpid from udev.
|
||||
"""
|
||||
return hidapi.find_paired_node_wpid(receiver_path, index)
|
||||
|
||||
|
||||
# a very few requests (e.g., host switching) do not expect a reply, but use no_reply=True with extreme caution
|
||||
def request(
|
||||
handle,
|
||||
|
|
Loading…
Reference in New Issue