⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smbuscommand.java

📁 纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统
💻 JAVA
字号:
package org.jnode.driver.smbus.command;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Licence: GNU LGPL</p>
 * <p> </p>
 * @author Francois-Frederic Ozog
 * @version 1.0
 */


import java.io.IOException;

import javax.naming.NameNotFoundException;

import org.jnode.driver.smbus.SMBusControler;
import org.jnode.naming.InitialNaming;
import org.jnode.shell.help.Help;

public class SMBusCommand {


  public static Help.Info HELP_INFO =
          new Help.Info(
                  "smbus",
                  "test smbus"
          );

  public static void main(String[] args) throws Exception {
          //ParsedArguments cmdLine = HELP_INFO.parse(args);
          SMBusControler smbusctrl=null;

          try {
            smbusctrl = (SMBusControler) InitialNaming.lookup(SMBusControler.NAME);
          }
          catch (NameNotFoundException ex2) {
            System.out.println("Could not connect to SMBusControler:" + ex2.getMessage());
            return;
          }

          byte res=0;
          for (byte i=0;i<8; i++) {

              try {
                res = smbusctrl.readByte( (byte) (0xa0 |( i<<1)), (byte) 2);
                System.out.println("DIMM " + i + " type :" + Integer.toHexString(res));
              }
              catch (IOException ex) {
                System.out.println("DIMM " + i + " not present");
              }


          }
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -