Documentation ¶
Index ¶
- Constants
- func LONG(x int) int
- func NBITS(x int) int
- func OFF(x int) int
- type AC
- type Battery
- type Config
- type DSPCMode
- type Daemon
- type InputEvent
- type Manager
- func (m *Manager) GetBatteries() (batteries []dbus.ObjectPath, busErr *dbus.Error)
- func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods
- func (*Manager) GetInterfaceName() string
- func (m *Manager) LockCpuFreq(governor string, lockTime int32) *dbus.Error
- func (m *Manager) Refresh() *dbus.Error
- func (m *Manager) RefreshBatteries() *dbus.Error
- func (m *Manager) RefreshMains() *dbus.Error
- func (m *Manager) SetCpuBoost(enabled bool) *dbus.Error
- func (m *Manager) SetCpuGovernor(governor string) *dbus.Error
- func (m *Manager) SetMode(mode string) *dbus.Error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Battery ¶
type Battery struct { PropsMu sync.RWMutex SysfsPath string IsPresent bool Manufacturer string ModelName string SerialNumber string Name string Technology string Energy float64 EnergyFull float64 EnergyFullDesign float64 EnergyRate float64 Voltage float64 Percentage float64 Capacity float64 Status battery.Status TimeToEmpty uint64 TimeToFull uint64 UpdateTime int64 // contains filtered or unexported fields }
func (*Battery) GetExportedMethods ¶
func (v *Battery) GetExportedMethods() dbusutil.ExportedMethods
func (*Battery) GetInterfaceName ¶
type Daemon ¶
type Daemon struct { *loader.ModuleBase // contains filtered or unexported fields }
func (*Daemon) GetDependencies ¶
type InputEvent ¶
type InputEvent struct { Time syscall.Timeval // time in seconds since epoch at which event occurred Type uint16 // event type - one of ecodes.EV_* Code uint16 // event code related to the event type Value int32 // event value related to the event type }
func (*InputEvent) String ¶
func (ev *InputEvent) String() string
Get a useful description for an input event. Example:
event at 1347905437.435795, code 01, type 02, val 02
type Manager ¶
type Manager struct { PropsMu sync.RWMutex OnBattery bool HasLidSwitch bool // battery display properties: HasBattery bool BatteryPercentage float64 BatteryStatus battery.Status BatteryTimeToEmpty uint64 BatteryTimeToFull uint64 // 电池容量 BatteryCapacity float64 // 开启和关闭节能模式 PowerSavingModeEnabled bool `prop:"access:rw"` // 自动切换节能模式,依据为是否插拔电源 PowerSavingModeAuto bool `prop:"access:rw"` // 低电量时自动开启 PowerSavingModeAutoWhenBatteryLow bool `prop:"access:rw"` // 开启节能模式时降低亮度的百分比值 PowerSavingModeBrightnessDropPercent uint32 `prop:"access:rw"` // 开启自动节能模式电量的百分比值 PowerSavingModeAutoBatteryPercent uint32 `prop:"access:rw"` // 开启节能模式时保存的数据 PowerSavingModeBrightnessData string `prop:"access:rw"` // CPU频率调节模式,支持powersave和performance CpuGovernor string // CPU频率增强是否开启 CpuBoost bool // 是否支持Boost IsHighPerformanceSupported bool // 是否支持平衡模式 IsBalanceSupported bool // 是否支持节能模式 IsPowerSaveSupported bool // 是否支持切换性能模式 SupportSwitchPowerMode bool `prop:"access:rw"` // 当前模式 Mode string // 是否在启动阶段,启动阶段不允许调节亮度; 若在启动阶段切换模式后(切节能模式降低亮度),可以调节亮度. IsInBootTime bool // contains filtered or unexported fields }
https://www.kernel.org/doc/Documentation/power/power_supply_class.txt
func (*Manager) GetBatteries ¶
func (m *Manager) GetBatteries() (batteries []dbus.ObjectPath, busErr *dbus.Error)
func (*Manager) GetExportedMethods ¶
func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods
func (*Manager) GetInterfaceName ¶
func (*Manager) LockCpuFreq ¶
func (*Manager) RefreshBatteries ¶
func (*Manager) RefreshMains ¶
Click to show internal directories.
Click to hide internal directories.