Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup HID module #336

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions bumble/hid.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
from __future__ import annotations
from dataclasses import dataclass
import logging
import asyncio
import enum

from pyee import EventEmitter
from typing import Optional, Tuple, Callable, Dict, Union, TYPE_CHECKING
from typing import Optional, TYPE_CHECKING

from . import core, l2cap # type: ignore
from .colors import color # type: ignore
from .core import BT_BR_EDR_TRANSPORT, InvalidStateError, ProtocolError # type: ignore
from bumble import l2cap
from bumble.colors import color
from bumble.core import InvalidStateError, ProtocolError

if TYPE_CHECKING:
from bumble.device import Device, Connection
Expand Down Expand Up @@ -302,10 +301,12 @@ def set_protocol(self, protocol_mode: int):
self.send_pdu_on_ctrl(hid_message)

def send_pdu_on_ctrl(self, msg: bytes) -> None:
self.l2cap_ctrl_channel.send_pdu(msg) # type: ignore
assert self.l2cap_ctrl_channel
self.l2cap_ctrl_channel.send_pdu(msg)

def send_pdu_on_intr(self, msg: bytes) -> None:
self.l2cap_intr_channel.send_pdu(msg) # type: ignore
assert self.l2cap_intr_channel
self.l2cap_intr_channel.send_pdu(msg)

def send_data(self, data):
msg = SendData(data)
Expand Down