|
|
|
@ -43,7 +43,7 @@ typedef struct{
|
|
|
|
|
|
|
|
|
|
void GpioControl::setInt(int cmd, int value)
|
|
|
|
|
{
|
|
|
|
|
int fd = open("/dev/mtkgpioctrl", O_RDONLY);
|
|
|
|
|
int fd = open(GPIO_NODE_MP, O_RDONLY);
|
|
|
|
|
IOT_PARAM param;
|
|
|
|
|
param.cmd = cmd;
|
|
|
|
|
param.value = value;
|
|
|
|
@ -59,7 +59,7 @@ void GpioControl::setInt(int cmd, int value)
|
|
|
|
|
|
|
|
|
|
int GpioControl::getInt(int cmd)
|
|
|
|
|
{
|
|
|
|
|
int fd = open("/dev/mtkgpioctrl", O_RDONLY);
|
|
|
|
|
int fd = open(GPIO_NODE_MP, O_RDONLY);
|
|
|
|
|
// LOGE("get_int fd=%d,cmd=%d\r\n",fd, cmd);
|
|
|
|
|
if( fd > 0 )
|
|
|
|
|
{
|
|
|
|
@ -77,7 +77,7 @@ int GpioControl::getInt(int cmd)
|
|
|
|
|
|
|
|
|
|
void GpioControl::setLong(int cmd, long value)
|
|
|
|
|
{
|
|
|
|
|
int fd = open("/dev/mtkgpioctrl", O_RDONLY);
|
|
|
|
|
int fd = open(GPIO_NODE_MP, O_RDONLY);
|
|
|
|
|
IOT_PARAM param;
|
|
|
|
|
param.cmd = cmd;
|
|
|
|
|
param.value2 = value;
|
|
|
|
@ -93,7 +93,7 @@ void GpioControl::setLong(int cmd, long value)
|
|
|
|
|
|
|
|
|
|
long GpioControl::getLong(int cmd)
|
|
|
|
|
{
|
|
|
|
|
int fd = open("/dev/mtkgpioctrl", O_RDONLY);
|
|
|
|
|
int fd = open(GPIO_NODE_MP, O_RDONLY);
|
|
|
|
|
// LOGE("get_long fd=%d,cmd=%d\r\n",fd, cmd);
|
|
|
|
|
if( fd > 0 )
|
|
|
|
|
{
|
|
|
|
@ -110,8 +110,7 @@ long GpioControl::getLong(int cmd)
|
|
|
|
|
void GpioControl::setString(int cmd, const std::string& value)
|
|
|
|
|
{
|
|
|
|
|
IOT_PARAM param;
|
|
|
|
|
// char *pval = jstringToChars(env, value);
|
|
|
|
|
int fd = open("/dev/mtkgpioctrl", O_RDONLY);
|
|
|
|
|
int fd = open(GPIO_NODE_MP, O_RDONLY);
|
|
|
|
|
int len = MAX_STRING_LEN < value.size() ? MAX_STRING_LEN : value.size();
|
|
|
|
|
|
|
|
|
|
param.cmd = cmd;
|
|
|
|
@ -129,7 +128,7 @@ void GpioControl::setString(int cmd, const std::string& value)
|
|
|
|
|
|
|
|
|
|
std::string GpioControl::getString(int cmd)
|
|
|
|
|
{
|
|
|
|
|
int fd = open("/dev/mtkgpioctrl", O_RDONLY);
|
|
|
|
|
int fd = open(GPIO_NODE_MP, O_RDONLY);
|
|
|
|
|
// LOGE("get_string fd=%d,cmd=%d\r\n",fd, cmd);
|
|
|
|
|
if( fd > 0 )
|
|
|
|
|
{
|
|
|
|
|