Package com.diozero.sbc
Class LocalSystemInfo
- java.lang.Object
-
- com.diozero.sbc.LocalSystemInfo
-
public class LocalSystemInfo extends Object
Utility class for accessing information about the local system. The majority of information is specific to the Linux operating system.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCpuModelName()
float
getCpuTemperature()
Utility method to get the CPU temperate of the attached boardString
getDefaultLibraryPath()
String
getHardware()
static Collection<Integer>
getI2CBusNumbers()
static LocalSystemInfo
getInstance()
String
getLibFileExtension()
Integer
getMemoryKb()
String
getModel()
String
getOperatingSystemId()
Get the local operating system id.String
getOperatingSystemVersion()
Get the local operating system version as defined by the VERSION property in/etc/os-release
String
getOsArch()
String
getOsName()
String
getRevision()
boolean
isArm()
boolean
isArm32()
boolean
isArm64()
boolean
isArmv6()
boolean
isArmv7()
boolean
isLinux()
boolean
isMacOS()
boolean
isWindows()
List<String>
loadLinuxBoardCompatibility()
static void
main(String[] args)
String
toString()
-
-
-
Method Detail
-
getInstance
public static LocalSystemInfo getInstance()
-
getOsName
public String getOsName()
-
isLinux
public boolean isLinux()
-
isMacOS
public boolean isMacOS()
-
isWindows
public boolean isWindows()
-
getOsArch
public String getOsArch()
-
isArm32
public boolean isArm32()
-
isArm64
public boolean isArm64()
-
isArmv6
public boolean isArmv6()
-
isArmv7
public boolean isArmv7()
-
isArm
public boolean isArm()
-
getLibFileExtension
public String getLibFileExtension()
-
getHardware
public String getHardware()
-
getRevision
public String getRevision()
-
getModel
public String getModel()
-
getCpuModelName
public String getCpuModelName()
-
getMemoryKb
public Integer getMemoryKb()
-
getDefaultLibraryPath
public String getDefaultLibraryPath()
-
getOperatingSystemId
public String getOperatingSystemId()
Get the local operating system id. For Linux this is as defined by the ID property in/etc/os-release
. For macOS it is the "ProductName" as returned by sw_vers.- Returns:
- value of the ID property
-
getOperatingSystemVersion
public String getOperatingSystemVersion()
Get the local operating system version as defined by the VERSION property in/etc/os-release
- Returns:
- value of the VERSION property
-
getI2CBusNumbers
public static Collection<Integer> getI2CBusNumbers()
-
getCpuTemperature
public float getCpuTemperature()
Utility method to get the CPU temperate of the attached board- Returns:
- the CPU temperature
-
main
public static void main(String[] args)
-
-