-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cython implementation for manager (#14)
- Loading branch information
Showing
2 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import cython | ||
|
||
from .advertisement_tracker cimport AdvertisementTracker | ||
from .base_scanner cimport BaseHaScanner | ||
|
||
cdef object NO_RSSI_VALUE | ||
cdef object RSSI_SWITCH_THRESHOLD | ||
cdef object FILTER_UUIDS | ||
cdef object BluetoothServiceInfoBleak | ||
cdef object AdvertisementData | ||
cdef object BLEDevice | ||
cdef bint TYPE_CHECKING | ||
cdef set APPLE_START_BYTES_WANTED | ||
|
||
cdef unsigned int APPLE_MFR_ID | ||
|
||
@cython.locals(uuids=set) | ||
cdef _dispatch_bleak_callback( | ||
object callback, | ||
dict filters, | ||
object device, | ||
object advertisement_data | ||
) | ||
|
||
cdef class BluetoothManager: | ||
|
||
cdef public object _cancel_unavailable_tracking | ||
cdef public AdvertisementTracker _advertisement_tracker | ||
cdef public dict _fallback_intervals | ||
cdef public dict _intervals | ||
cdef public dict _unavailable_callbacks | ||
cdef public dict _connectable_unavailable_callbacks | ||
cdef public list _bleak_callbacks | ||
cdef public dict _all_history | ||
cdef public dict _connectable_history | ||
cdef public list _non_connectable_scanners | ||
cdef public list _connectable_scanners | ||
cdef public dict _adapters | ||
cdef public dict _sources | ||
cdef public object _bluetooth_adapters | ||
cdef public object slot_manager | ||
cdef public bint _debug | ||
cdef public bint shutdown | ||
cdef public object _loop | ||
|
||
cdef bint _prefer_previous_adv_from_different_source(self, object old, object new) | ||
|
||
@cython.locals(source=str, connectable=bint, scanner=BaseHaScanner, connectable_scanner=BaseHaScanner) | ||
cpdef void scanner_adv_received(self, object service_info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters