/*
 * Created by hongbo.he@lnxall.com
 *
 * can device open, close, send, recv functions
 *	with non-block mode
 *
 * 2025/09/19
 */
#ifndef LNXUTIL_CAN_H
#define LNXUTIL_CAN_H

#include <linux/can.h>

/*
 * can device open
 *
 * RETURN VALUE
 *	if success, return 0
 *	when error occurrd, return -1 and set the errno
 *
 */
int lnxcan_open(const char *dev);

void lnxcan_close(int fd);

/*
 * can send with failure retransmission
 *
 * RETURN VALUE
 *	if success, return 0
 *	when error occurrd, return -1 and set the errno
 *
 */
int lnxcan_send(int fd, const struct can_frame *frame);

int lnxcan_recv(int fd, struct can_frame *frame);

#endif
