2024-11-06 17:26:24 +08:00
|
|
|
#include"drv_do.h"
|
2024-11-04 16:59:51 +08:00
|
|
|
|
2024-11-06 17:26:24 +08:00
|
|
|
void drv_do_write(char *dev, char *value)
|
2024-11-04 16:59:51 +08:00
|
|
|
{
|
2024-11-06 17:26:24 +08:00
|
|
|
int devFd = open(dev, O_RDWR);
|
|
|
|
if(devFd == -1) {
|
|
|
|
printf("open device failed[%s]\n", dev);
|
2024-11-05 17:17:30 +08:00
|
|
|
}
|
2024-11-06 17:26:24 +08:00
|
|
|
else {
|
|
|
|
write(devFd, value, sizeof(value));
|
2024-11-05 17:17:30 +08:00
|
|
|
}
|
2024-11-06 17:26:24 +08:00
|
|
|
close(devFd);
|
2024-11-04 16:59:51 +08:00
|
|
|
}
|