2024-11-04 16:59:51 +08:00
|
|
|
#include "drv_di.h"
|
2024-11-12 08:21:37 +08:00
|
|
|
|
|
|
|
void drv_di_read(char *dev, char *value)
|
|
|
|
{
|
|
|
|
int devFd = open(dev, O_RDONLY);
|
|
|
|
if(devFd == -1) {
|
|
|
|
printf("open device failed[%s]\n", dev);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
read(devFd, value, sizeof(value));
|
|
|
|
}
|
|
|
|
close(devFd);
|
|
|
|
}
|