dumpregs.c
来自「在linux操作系统下CAN收发程序的示例源代码。」· C语言 代码 · 共 28 行
C
28 行
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "../can.h"
int main(void)
{
int fd;
if ((fd=open("/dev/can0",O_RDWR)) < 0 ) {
perror("open");
printf("Error opening /dev/can0\n");
exit(1);
}
// Dump register content of 82527
ioctl( fd, IOCTL_CAN_DUMP_REG );
// Close the port
close(fd);
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?