在arm做接收DTU参数的时候,始终无法获取到DTU映射文件(/dev/dtu)里面的数据(可能没找到方法
)

刚开始用os去打开
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
fd = os.open('/dev/dtu',os.O_RDWR)
ret = os.read(fd,10)
print ret
得到的始终为空,后来发现用C语言里面的函数可以得到数据,写了一个check.c文件:
#include <stdarg.h>
#include <termio.h>
#include <sys/timeb.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include <stdlib.h>
#define MCU_DIDO_IOC_MAGIC 'd'
#define IO_GPIO_SET_OUTPUT _IO(MCU_DIDO_IOC_MAGIC,0)
#define IO_GPIO_RESET_OUTPUT _IO(MCU_DIDO_IOC_MAGIC,1)
#define IO_GPIO_GET_INPUT _