mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-06-29 11:05:17 +02:00
39 lines
824 B
Cython
39 lines
824 B
Cython
import cython
|
|
|
|
from .base cimport APIFrameHelper
|
|
|
|
|
|
cdef bint TYPE_CHECKING
|
|
|
|
cdef class APINoiseFrameHelper(APIFrameHelper):
|
|
|
|
cdef object _noise_psk
|
|
cdef object _expected_name
|
|
cdef object _state
|
|
cdef object _dispatch
|
|
cdef object _server_name
|
|
cdef object _proto
|
|
cdef object _decrypt
|
|
cdef object _encrypt
|
|
cdef bint _is_ready
|
|
|
|
@cython.locals(
|
|
header=bytes,
|
|
preamble=cython.uint,
|
|
msg_size_high=cython.uint,
|
|
msg_size_low=cython.uint,
|
|
)
|
|
cpdef data_received(self, bytes data)
|
|
|
|
@cython.locals(
|
|
type_high=cython.uint,
|
|
type_low=cython.uint
|
|
)
|
|
cpdef _handle_frame(self, bytes data)
|
|
|
|
@cython.locals(
|
|
data_len=cython.uint,
|
|
frame_len=cython.uint
|
|
)
|
|
cpdef write_packet(self, cython.uint type_, bytes data)
|