|
|
@ -134,26 +134,6 @@ std::string GpioControl::getString(int cmd)
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef USING_N938
|
|
|
|
#ifdef USING_N938
|
|
|
|
|
|
|
|
|
|
|
|
bool GpioControl::SetN938Cmd(int cmd, int val)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
char buf[32] = { 0 };
|
|
|
|
|
|
|
|
snprintf(buf, "out %d %d", cmd, val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IOT_PARAM param;
|
|
|
|
|
|
|
|
int len = MAX_STRING_LEN < strlen(buf) ? MAX_STRING_LEN : strlen(buf);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param.cmd = cmd;
|
|
|
|
|
|
|
|
memset(param.str, 0, MAX_STRING_LEN);
|
|
|
|
|
|
|
|
memcpy(param.str, value.c_str(), len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int fd = open(GPIO_NODE_MP, O_RDONLY);
|
|
|
|
|
|
|
|
if( fd > 0 )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ioctl(fd, IOT_PARAM_WRITE, ¶m);
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool GpioControl::OpenSensors()
|
|
|
|
bool GpioControl::OpenSensors()
|
|
|
|
{
|
|
|
|
{
|
|
|
|