mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-12 07:23:45 +08:00
22a8575199
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
69 lines
1.5 KiB
Cython
69 lines
1.5 KiB
Cython
# distutils: language = c++
|
|
#cython: language_level=3
|
|
|
|
from libcpp.string cimport string
|
|
from libcpp.vector cimport vector
|
|
from libcpp cimport bool
|
|
|
|
|
|
cdef extern from "msgq/impl_fake.h":
|
|
cdef cppclass Event:
|
|
@staticmethod
|
|
int wait_for_one(vector[Event], int) except +
|
|
|
|
Event()
|
|
Event(int)
|
|
void set()
|
|
int clear()
|
|
void wait(int) except +
|
|
bool peek()
|
|
int fd()
|
|
|
|
cdef cppclass SocketEventHandle:
|
|
@staticmethod
|
|
void toggle_fake_events(bool)
|
|
@staticmethod
|
|
void set_fake_prefix(string)
|
|
@staticmethod
|
|
string fake_prefix()
|
|
|
|
SocketEventHandle(string, string, bool)
|
|
bool is_enabled()
|
|
void set_enabled(bool)
|
|
Event recv_called()
|
|
Event recv_ready()
|
|
|
|
|
|
cdef extern from "msgq/ipc.h":
|
|
cdef cppclass Context:
|
|
@staticmethod
|
|
Context * create()
|
|
|
|
cdef cppclass Message:
|
|
void init(size_t)
|
|
void init(char *, size_t)
|
|
void close()
|
|
size_t getSize()
|
|
char *getData()
|
|
|
|
cdef cppclass SubSocket:
|
|
@staticmethod
|
|
SubSocket * create() nogil
|
|
int connect(Context *, string, string, bool, bool, size_t) nogil
|
|
Message * receive(bool) nogil
|
|
void setTimeout(int) nogil
|
|
|
|
cdef cppclass PubSocket:
|
|
@staticmethod
|
|
PubSocket * create()
|
|
int connect(Context *, string, bool, size_t)
|
|
int sendMessage(Message *)
|
|
int send(char *, size_t)
|
|
bool all_readers_updated()
|
|
|
|
cdef cppclass Poller:
|
|
@staticmethod
|
|
Poller * create()
|
|
void registerSocket(SubSocket *)
|
|
vector[SubSocket*] poll(int) nogil
|