本文共 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/