35 lines
977 B
Cython
35 lines
977 B
Cython
from libc.stdint cimport uint8_t, uint32_t
|
|
|
|
cdef extern from "sys/select.h":
|
|
ctypedef struct fd_set:
|
|
pass
|
|
|
|
cdef extern from "linux/can.h":
|
|
cdef packed struct can_frame:
|
|
uint32_t can_id
|
|
uint8_t len
|
|
uint8_t __pad
|
|
uint8_t __res0
|
|
uint8_t __len8_dlc
|
|
uint8_t data[8]
|
|
|
|
cdef extern from "hexagram/can.h":
|
|
ctypedef struct hexagram_can_if:
|
|
pass
|
|
|
|
hexagram_can_if *hexagram_can_if_open(const char *name)
|
|
|
|
void hexagram_can_if_close(hexagram_can_if *can_if)
|
|
|
|
int hexagram_can_if_read(hexagram_can_if *can_if, can_frame *frame)
|
|
|
|
int hexagram_can_if_write(hexagram_can_if *can_if, can_frame *frame)
|
|
|
|
int hexagram_can_if_fd(hexagram_can_if *can_if);
|
|
|
|
void hexagram_can_if_fd_set(hexagram_can_if *can_if, fd_set *fds)
|
|
|
|
int hexagram_can_if_fd_isset(hexagram_can_if *can_if, fd_set *fds)
|
|
|
|
cdef extern from "hexagram/cluster.h":
|
|
int hexagram_cluster_filter_can_if(hexagram_can_if *can_if)
|