|
|
@ -18,8 +18,29 @@ int can_set_baudrate(struct canbus *can, unsigned int baudrate); |
|
|
|
* return > 0 on success. |
|
|
|
*/ |
|
|
|
int can_send_data(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len); |
|
|
|
|
|
|
|
int can_send_remote(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len); |
|
|
|
|
|
|
|
static inline int can_send_std_data(struct canbus *can, unsigned int id, const void *data, unsigned char len) |
|
|
|
{ |
|
|
|
return can_send_data(can, 0, id, data, len); |
|
|
|
} |
|
|
|
|
|
|
|
static inline int can_send_std_remote(struct canbus *can, unsigned int id, const void *data, unsigned char len) |
|
|
|
{ |
|
|
|
return can_send_remote(can, 0, id, data, len); |
|
|
|
} |
|
|
|
|
|
|
|
static inline int can_send_extend_data(struct canbus *can, unsigned int id, const void *data, unsigned char len) |
|
|
|
{ |
|
|
|
return can_send_data(can, 1, id, data, len); |
|
|
|
} |
|
|
|
|
|
|
|
static inline int can_send_extend_remote(struct canbus *can, unsigned int id, const void *data, unsigned char len) |
|
|
|
{ |
|
|
|
return can_send_remote(can, 1, id, data, len); |
|
|
|
} |
|
|
|
|
|
|
|
/*
|
|
|
|
* set receive rx handler |
|
|
|
* |
|
|
@ -35,7 +56,7 @@ struct canrx_msg { |
|
|
|
const void *data; |
|
|
|
}; |
|
|
|
|
|
|
|
void can_attach_rx(struct canbus *can, void *user, void (*rx)(struct canbus *can, void *user, struct canrx_msg *msg)); |
|
|
|
void can_set_rx_callback(struct canbus *can, void *user, void (*rx)(struct canbus *can, void *user, struct canrx_msg *msg)); |
|
|
|
|
|
|
|
void can_close(struct canbus *can); |
|
|
|
|
|
|
|