Class SmcUtilFFM
java.lang.Object
oshi.util.platform.mac.SmcUtilFFM
Provides access to SMC calls on macOS using FFM
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intsmcClose(int conn) Close connection to SMC.static doublesmcGetFirstFloat(int conn, String... keys) Get the first positive value from a list of SMC keys.static doublesmcGetFloat(int conn, String key) Get a value from SMC which is in a floating point datatype (SP78, FPE2, FLT)static longsmcGetLong(int conn, String key) Get a 64-bit integer value from SMCstatic intsmcOpen()Open a connection to SMC.
-
Field Details
-
SMC_KEY_FAN_NUM
- See Also:
-
SMC_KEY_FAN_SPEED
- See Also:
-
SMC_KEY_CPU_TEMP
- See Also:
-
SMC_KEY_CPU_VOLTAGE
- See Also:
-
SMC_KEYS_CPU_TEMP_AS
-
SMC_KEYS_GPU_TEMP_AS
-
SMC_KEY_CPU_VOLTAGE_AS
- See Also:
-
SMC_CMD_READ_BYTES
public static final byte SMC_CMD_READ_BYTES- See Also:
-
SMC_CMD_READ_KEYINFO
public static final byte SMC_CMD_READ_KEYINFO- See Also:
-
KERNEL_INDEX_SMC
public static final int KERNEL_INDEX_SMC- See Also:
-
-
Method Details
-
smcOpen
public static int smcOpen()Open a connection to SMC.- Returns:
- The io_connect_t port (nonzero) if successful, 0 if failure. Caller must close with
smcClose(int).
-
smcClose
public static int smcClose(int conn) Close connection to SMC.- Parameters:
conn- The io_connect_t port returned bysmcOpen()- Returns:
- 0 if successful, nonzero if failure
-
smcGetFloat
Get a value from SMC which is in a floating point datatype (SP78, FPE2, FLT)- Parameters:
conn- The connectionkey- The key to retrieve- Returns:
- Double representing the value
-
smcGetFirstFloat
Get the first positive value from a list of SMC keys.- Parameters:
conn- The connectionkeys- The keys to try in order- Returns:
- The first value greater than 0, or 0 if all keys fail
-
smcGetLong
Get a 64-bit integer value from SMC- Parameters:
conn- The connectionkey- The key to retrieve- Returns:
- Long representing the value
-