2024-11-20 16:11:23 +08:00
|
|
|
#ifndef __DEV_CAN_H_
|
|
|
|
#define __DEV_CAN_H_
|
2024-11-13 15:16:23 +08:00
|
|
|
|
2024-11-13 15:23:09 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/socket.h>
|
2024-11-20 16:11:23 +08:00
|
|
|
#include <sys/ioctl.h>
|
2024-11-13 15:23:09 +08:00
|
|
|
#include <linux/can.h>
|
|
|
|
#include <linux/can/raw.h>
|
2024-11-20 16:11:23 +08:00
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <net/if.h>
|
2024-11-13 15:16:23 +08:00
|
|
|
|
2024-11-21 09:11:11 +08:00
|
|
|
#define CANNUM_RECV "can0"
|
|
|
|
#define CANNUM_SEND "can1"
|
|
|
|
#define CANIDNUM 3
|
|
|
|
#define CANDLC_RECV 8
|
|
|
|
#define CANDLC_SEND 8
|
|
|
|
|
2024-11-20 16:11:23 +08:00
|
|
|
void can_recv(char cannum[], unsigned int canID[], int canIDnum, int dataLength);
|
2024-11-13 15:16:23 +08:00
|
|
|
|
2024-11-20 16:11:23 +08:00
|
|
|
void can_send(char cannum[], unsigned int canID, char* dataToSend, int dataLength);
|
2024-11-13 15:16:23 +08:00
|
|
|
|
|
|
|
#endif
|