博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android APP 直接操作内核sysfs
阅读量:4074 次
发布时间:2019-05-25

本文共 675 字,大约阅读时间需要 2 分钟。

eth_enable 是sysfs导出的一个符号,控制以太网的电源开关

APP端操作节点try{    FileOutputStream fops = new FileOutputStream("/sys/devices/platform/syspower.0/eth_enable");    fops.write("1".getBytes());    fops.flush();    fops.close();    }catch(FileNotFoundException e){        Log.i("bshui", "filenotfound");    }catch(IOException e){    }内核导出符号+static ssize_t eth_enable_store(struct device *dev,+                       struct device_attribute *attr,+                       const char *buf, size_t count){+       int enable;+       enable = simple_strtoul(buf, NULL,10);+       if(enable==0 || enable==1){+               gpio_en(ETH_PWREN, "eth3v3_pwren", enable);+       }+++       return count;+}

转载地址:http://vakni.baihongyu.com/

你可能感兴趣的文章
在公司内网上创建自己的 OSM.Planet 街道级别地图服务器及其客户端程序
查看>>
微软云Azure Website 远程调试
查看>>
经典DOS游戏皇帝攻略(曾经的回忆)
查看>>
风后握奇经
查看>>
compass电子罗盘
查看>>
swfdump——从内存中提取swf的工具
查看>>
VS 的编译选项 build下的 platform target -- Any CPU和x86有什么影响?
查看>>
Windows 运行时组件
查看>>
MIT License
查看>>
UWP蓝牙的例子
查看>>
Java的注解机制——Spring自动装配的实现原理
查看>>
JAVA代码中加了Try...Catch的执行顺序
查看>>
银狐云服务架构V0.1
查看>>
开启云时代,银狐H5游戏云通迅框架解决方案出炉!
查看>>
netty5和4.x,3.x的一些区别
查看>>
JAVA中遇到 UTF-八 序列的字节 1 无效
查看>>
Unity3D中Update()与FixedUpdate()的区别
查看>>
java中“@Deprecated”的意思
查看>>
奇葩啊,HOLOLENS里模拟器截不了图,后台DEVIE PORTAL可以截
查看>>
IIS7.5中神秘的ApplicationPoolIdentity
查看>>