ridiculous refactor to allow enums to be dbus strings for better TS generation

This commit is contained in:
Luke D. Jones
2023-06-27 21:16:13 +12:00
parent fca7d23a31
commit 7b17a13ce7
43 changed files with 1516 additions and 267 deletions

View File

@@ -0,0 +1,105 @@
method return time=1687857321.236676 sender=:1.373 -> destination=:1.434 serial=2259 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.asuslinux.Daemon">
<!--
Writes a data stream of length. Will force system thread to exit until
it is restarted
-->
<method name="Write">
<arg name="input" type="(ays)" direction="in"/>
</method>
<!--
Set the global AniMe brightness
-->
<method name="SetImageBrightness">
<arg name="bright" type="d" direction="in"/>
</method>
<!--
Set base brightness level
-->
<method name="SetBrightness">
<arg name="brightness" type="s" direction="in"/>
</method>
<!--
Enable the builtin animations or not
-->
<method name="SetBuiltinsEnabled">
<arg name="enabled" type="b" direction="in"/>
</method>
<!--
Set which builtin animation is used for each stage
-->
<method name="SetBuiltinAnimations">
<arg name="boot" type="s" direction="in"/>
<arg name="awake" type="s" direction="in"/>
<arg name="sleep" type="s" direction="in"/>
<arg name="shutdown" type="s" direction="in"/>
</method>
<!--
Set whether the AniMe is enabled at all
-->
<method name="SetEnableDisplay">
<arg name="enabled" type="b" direction="in"/>
</method>
<!--
The main loop is the base system set action if the user isn't running
the user daemon
-->
<method name="RunMainLoop">
<arg name="start" type="b" direction="in"/>
</method>
<!--
Get the device state as stored by asusd
-->
<method name="DeviceState">
<arg type="(bsb(ssss))" direction="out"/>
</method>
<!--
Notify listeners of the status of AniMe LED power and factory
system-status animations
-->
<signal name="NotifyDeviceState">
<arg name="data" type="(bsb(ssss))"/>
</signal>
</interface>
</node>
"

View File

@@ -0,0 +1,146 @@
method return time=1687857321.234264 sender=:1.373 -> destination=:1.433 serial=2258 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.asuslinux.Daemon">
<!--
Set the keyboard brightness level (0-3)
-->
<method name="SetBrightness">
<arg name="brightness" type="s" direction="in"/>
</method>
<!--
Set a variety of states, input is array of enum.
`enabled` sets if the sent array should be disabled or enabled
```text
pub struct AuraPowerDev {
tuf: Vec<AuraDevTuf>,
x1866: Vec<AuraDevRog1>,
x19b6: Vec<AuraDevRog2>,
}
pub enum AuraDevTuf {
Boot,
Awake,
Sleep,
Keyboard,
}
pub enum AuraDevRog1 {
Awake = 0x000002,
Keyboard = 0x080000,
Lightbar = 0x040500,
Boot = 0xc31209,
Sleep = 0x300804,
}
pub enum AuraDevRog2 {
BootLogo = 1,
BootKeyb = 1 << 1,
AwakeLogo = 1 << 2,
AwakeKeyb = 1 << 3,
SleepLogo = 1 << 4,
SleepKeyb = 1 << 5,
ShutdownLogo = 1 << 6,
ShutdownKeyb = 1 << 7,
BootBar = 1 << (7 + 2),
AwakeBar = 1 << (7 + 3),
SleepBar = 1 << (7 + 4),
ShutdownBar = 1 << (7 + 5),
BootLid = 1 << (15 + 1),
AwakeLid = 1 << (15 + 2),
SleepLid = 1 << (15 + 3),
ShutdownLid = 1 << (15 + 4),
BootRearGlow = 1 << (23 + 1),
AwakeRearGlow = 1 << (23 + 2),
SleepRearGlow = 1 << (23 + 3),
ShutdownRearGlow = 1 << (23 + 4),
}
```
-->
<method name="SetLedsPower">
<arg name="options" type="(asasas)" direction="in"/>
<arg name="enabled" type="b" direction="in"/>
</method>
<method name="SetLedMode">
<arg name="effect" type="(ss(yyy)(yyy)ss)" direction="in"/>
</method>
<method name="NextLedMode">
</method>
<method name="PrevLedMode">
</method>
<method name="NextLedBrightness">
</method>
<method name="PrevLedBrightness">
</method>
<method name="LedsEnabled">
<arg type="(asasas)" direction="out"/>
</method>
<!--
Return the current mode data
-->
<method name="LedMode">
<arg type="s" direction="out"/>
</method>
<!--
Return a list of available modes
-->
<method name="LedModes">
<arg type="a{s(ss(yyy)(yyy)ss)}" direction="out"/>
</method>
<!--
On machine that have some form of either per-key keyboard or per-zone
this can be used to write custom effects over dbus. The input is a
nested `Vec<Vec<8>>` where `Vec<u8>` is a raw USB packet
-->
<method name="DirectAddressingRaw">
<arg name="data" type="aay" direction="in"/>
</method>
<signal name="NotifyLed">
<arg name="data" type="(ss(yyy)(yyy)ss)"/>
</signal>
<signal name="NotifyPowerStates">
<arg name="data" type="(asasas)"/>
</signal>
<!--
Return the current LED brightness
-->
<property name="LedBrightness" type="n" access="read"/>
</interface>
</node>
"

View File

@@ -0,0 +1,107 @@
method return time=1687857321.238947 sender=:1.373 -> destination=:1.435 serial=2260 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.asuslinux.Daemon">
<method name="SetGpuMuxMode">
<arg name="mode" type="u" direction="in"/>
</method>
<method name="GpuMuxMode">
<arg type="u" direction="out"/>
</method>
<signal name="NotifyGpuMuxMode">
<arg name="mode" type="u"/>
</signal>
<method name="SetPostBootSound">
<arg name="on" type="b" direction="in"/>
</method>
<method name="PostBootSound">
<arg type="n" direction="out"/>
</method>
<signal name="NotifyPostBootSound">
<arg name="on" type="b"/>
</signal>
<method name="SetPanelOd">
<arg name="overdrive" type="b" direction="in"/>
</method>
<!--
Get the `panel_od` value from platform. Updates the stored value in
internal config also.
-->
<method name="PanelOd">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyPanelOd">
<arg name="overdrive" type="b"/>
</signal>
<method name="SetMiniLedMode">
<arg name="on" type="b" direction="in"/>
</method>
<!--
Get the `panel_od` value from platform. Updates the stored value in
internal config also.
-->
<method name="MiniLedMode">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyMiniLedMode">
<arg name="on" type="b"/>
</signal>
<method name="SetDgpuDisable">
<arg name="disable" type="b" direction="in"/>
</method>
<method name="DgpuDisable">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyDgpuDisable">
<arg name="disable" type="b"/>
</signal>
<method name="SetEgpuEnable">
<arg name="enable" type="b" direction="in"/>
</method>
<method name="EgpuEnable">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyEgpuEnable">
<arg name="enable" type="b"/>
</signal>
</interface>
</node>
"

View File

@@ -0,0 +1,60 @@
method return time=1687857321.240891 sender=:1.373 -> destination=:1.436 serial=2261 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.asuslinux.Daemon">
<method name="SetChargeControlEndThreshold">
<arg name="limit" type="y" direction="in"/>
</method>
<method name="ChargeControlEndThreshold">
<arg type="y" direction="out"/>
</method>
<method name="MainsOnline">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyChargeControlEndThreshold">
<arg name="limit" type="y"/>
</signal>
<signal name="NotifyMainsOnline">
<arg name="on" type="b"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
</node>
"

View File

@@ -0,0 +1,120 @@
method return time=1687857321.242598 sender=:1.373 -> destination=:1.437 serial=2262 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.asuslinux.Daemon">
<!--
Fetch profile names
-->
<method name="Profiles">
<arg type="as" direction="out"/>
</method>
<!--
Toggle to next platform_profile. Names provided by `Profiles`.
If fan-curves are supported will also activate a fan curve for profile.
-->
<method name="NextProfile">
</method>
<!--
Fetch the active profile name
-->
<method name="ActiveProfile">
<arg type="s" direction="out"/>
</method>
<!--
Set this platform_profile name as active
-->
<method name="SetActiveProfile">
<arg name="profile" type="s" direction="in"/>
</method>
<!--
Get a list of profiles that have fan-curves enabled.
-->
<method name="EnabledFanProfiles">
<arg type="as" direction="out"/>
</method>
<!--
Set a profile fan curve enabled status. Will also activate a fan curve
if in the same profile mode
-->
<method name="SetFanCurveEnabled">
<arg name="profile" type="s" direction="in"/>
<arg name="enabled" type="b" direction="in"/>
</method>
<!--
Get the fan-curve data for the currently active Profile
-->
<method name="FanCurveData">
<arg name="profile" type="s" direction="in"/>
<arg type="(b(s(yyyyyyyy)(yyyyyyyy))(s(yyyyyyyy)(yyyyyyyy)))" direction="out"/>
</method>
<!--
Set the fan curve for the specified profile.
Will also activate the fan curve if the user is in the same mode.
-->
<method name="SetFanCurve">
<arg name="profile" type="s" direction="in"/>
<arg name="curve" type="(s(yyyyyyyy)(yyyyyyyy))" direction="in"/>
</method>
<!--
Reset the stored (self) and device curve to the defaults of the
platform.
Each platform_profile has a different default and the defualt can be
read only for the currently active profile.
-->
<method name="SetActiveCurveToDefaults">
</method>
<!--
Reset the stored (self) and device curve to the defaults of the
platform.
Each platform_profile has a different default and the defualt can be
read only for the currently active profile.
-->
<method name="ResetProfileCurves">
<arg name="profile" type="s" direction="in"/>
</method>
<signal name="NotifyProfile">
<arg name="profile" type="s"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
</node>
"

View File

@@ -0,0 +1,48 @@
method return time=1687857321.244505 sender=:1.373 -> destination=:1.438 serial=2263 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.asuslinux.Daemon">
<method name="SupportedFunctions">
<arg type="(b(b)(bb)(sbasasu)(bbbbbb))" direction="out"/>
</method>
</interface>
</node>
"

53
bindings/ts/anime.ts Normal file
View File

@@ -0,0 +1,53 @@
/*
Generated by typeshare 1.6.0
*/
export enum AnimBooting {
GlitchConstruction = "GlitchConstruction",
StaticEmergence = "StaticEmergence",
}
export enum AnimAwake {
BinaryBannerScroll = "BinaryBannerScroll",
RogLogoGlitch = "RogLogoGlitch",
}
export enum AnimSleeping {
BannerSwipe = "BannerSwipe",
Starfield = "Starfield",
}
export enum AnimShutdown {
GlitchOut = "GlitchOut",
SeeYa = "SeeYa",
}
export interface Animations {
boot: AnimBooting;
awake: AnimAwake;
sleep: AnimSleeping;
shutdown: AnimShutdown;
}
/** Base LED brightness of the display */
export enum Brightness {
Off = "Off",
Low = "Low",
Med = "Med",
High = "High",
}
export interface DeviceState {
display_enabled: boolean;
display_brightness: Brightness;
builtin_anims_enabled: boolean;
builtin_anims: Animations;
}
export enum AnimeType {
GA401 = "GA401",
GA402 = "GA402",
GU604 = "GU604",
Unknown = "Unknown",
}

219
bindings/ts/aura.ts Normal file
View File

@@ -0,0 +1,219 @@
/*
Generated by typeshare 1.6.0
*/
/** Represents the per-key raw USB packets */
export type UsbPackets = number[][];
/**
* A `UsbPackets` contains all data to change the full set of keyboard
* key colours individually.
*
* Each row of the internal array is a full HID packet that can be sent
* to the keyboard EC. One row controls one group of keys, these keys are not
* necessarily all on the same row of the keyboard, with some splitting between
* two rows.
*/
export interface LedUsbPackets {
/** The packet data used to send data to the USB keyboard */
usb_packets: UsbPackets;
/**
* Wether or not this packet collection is zoned. The determines which
* starting bytes are used and what the indexing is for lightbar RGB
* colours
*/
zoned: boolean;
}
export interface Colour {
r: number;
g: number;
b: number;
}
/** Enum of modes that convert to the actual number required by a USB HID packet */
export enum AuraModeNum {
Static = "Static",
Breathe = "Breathe",
Strobe = "Strobe",
Rainbow = "Rainbow",
Star = "Star",
Rain = "Rain",
Highlight = "Highlight",
Laser = "Laser",
Ripple = "Ripple",
Pulse = "Pulse",
Comet = "Comet",
Flash = "Flash",
}
/** Base effects have no zoning, while multizone is 1-4 */
export enum AuraZone {
/** Used if keyboard has no zones, or if setting all */
None = "None",
/** Leftmost zone */
Key1 = "Key1",
/** Zone after leftmost */
Key2 = "Key2",
/** Zone second from right */
Key3 = "Key3",
/** Rightmost zone */
Key4 = "Key4",
/** Logo on the lid (or elsewhere?) */
Logo = "Logo",
/** The left part of a lightbar (typically on the front of laptop) */
BarLeft = "BarLeft",
/** The right part of a lightbar */
BarRight = "BarRight",
}
export enum Speed {
Low = "Low",
Med = "Med",
High = "High",
}
/**
* Used for Rainbow mode.
*
* Enum corresponds to the required integer value
*/
export enum Direction {
Right = "Right",
Left = "Left",
Up = "Up",
Down = "Down",
}
/**
* Default factory modes structure. This easily converts to an USB HID packet
* with:
* ```rust
* // let bytes: [u8; LED_MSG_LEN] = mode.into();
* ```
*/
export interface AuraEffect {
/** The effect type */
mode: AuraModeNum;
/** `AuraZone::None` for no zone or zoneless keyboards */
zone: AuraZone;
/** Primary colour for all modes */
colour1: Colour;
/** Secondary colour in some modes like Breathing or Stars */
colour2: Colour;
/** One of three speeds for modes that support speed (most that animate) */
speed: Speed;
/** Up, down, left, right. Only Rainbow mode seems to use this */
direction: Direction;
}
export enum AuraDevTuf {
Boot = "Boot",
Awake = "Awake",
Sleep = "Sleep",
Keyboard = "Keyboard",
}
/**
* # Bits for older 0x1866, 0x1869, 0x1854 keyboard models
*
* Keybord and Lightbar require Awake, Boot and Sleep apply to both
* Keybord and Lightbar regardless of if either are enabled (or Awake is
* enabled)
*
* | Byte 1 | Byte 2 | Byte 3 | Byte 4 | function | hex
* |
* |------------|------------|------------|------------|-----------|-------------|
* | 0000, 0000 | 0000, 0000 | 0000, 0010 | 0000, 0000 | Awake |
* 00,00,02,00 | | 0000, 1000 | 0000, 0000 | 0000, 0000 | 0000, 0000 | Keyboard
* | 08,00,00,00 | | 0000, 0100 | 0000, 0101 | 0000, 0000 | 0000, 0000 |
* Lightbar | 04,05,00,00 | | 1100, 0011 | 0001, 0010 | 0000, 1001 | 0000,
* 0000 | Boot/Sht | c3,12,09,00 | | 0011, 0000 | 0000, 1000 | 0000, 0100 |
* 0000, 0000 | Sleep | 30,08,04,00 | | 1111, 1111 | 0001, 1111 | 0000,
* 1111 | 0000, 0000 | all on | | | 0000, 0000 | 0000, 0000 |
* 0000, 0000 | 0000, 0010 | Rear Glow | 00,00,00,02 |
*/
export enum AuraDevRog1 {
Awake = "Awake",
Keyboard = "Keyboard",
Lightbar = "Lightbar",
Boot = "Boot",
Sleep = "Sleep",
}
/**
* # Bits for newer 0x18c6, 0x19B6, 0x1a30, keyboard models
*
* byte 4 in the USB packet is for keyboard + logo power states
* default is on, `ff`
* Keyboard and logo use the full range of bits (almost)
*
* | n1 | n2 | hex | action | bit |
* |------|------|-----|-----------------------|-------|
* | 0000 | 0000 | 00 | all off | |
* | 0000 | 0001 | 01 | logo boot | bit 1 |
* | 0000 | 0010 | 02 | keyboard boot | bit 2 |
* | 0000 | 0100 | 04 | logo awake | bit 3 |
* | 0000 | 1000 | 08 | keyboard awake | bit 4 |
* | 0001 | 0000 | 10 | logo sleep off | bit 5 |
* | 0010 | 0000 | 20 | keyboard sleep | bit 6 |
* | 0100 | 0000 | 40 | logo shutdown off | bit 7 |
* | 1000 | 0000 | 80 | keyboard shutdown off | bit 8 |
*
* byte 5 = lightbar
*
* | 1 | 2 | hex | action | bit |
* |------|------|-----|----------------------|-------|
* | 0000 | 0010 | 02 | lightbar off boot | bit 2 |
* | 0000 | 0100 | 04 | lightbar on | bit 3 |
* | 0000 | 1000 | 08 | lightbar off sleep | bit 4 |
* | 0001 | 0000 | 10 | lightbar shtdn off | bit 5 |
*/
export enum AuraDevRog2 {
BootLogo = "BootLogo",
BootKeyb = "BootKeyb",
AwakeLogo = "AwakeLogo",
AwakeKeyb = "AwakeKeyb",
SleepLogo = "SleepLogo",
SleepKeyb = "SleepKeyb",
ShutdownLogo = "ShutdownLogo",
ShutdownKeyb = "ShutdownKeyb",
BootBar = "BootBar",
AwakeBar = "AwakeBar",
SleepBar = "SleepBar",
ShutdownBar = "ShutdownBar",
BootLid = "BootLid",
AwakeLid = "AwakeLid",
SleepLid = "SleepLid",
ShutdownLid = "ShutdownLid",
BootRearGlow = "BootRearGlow",
AwakeRearGlow = "AwakeRearGlow",
SleepRearGlow = "SleepRearGlow",
ShutdownRearGlow = "ShutdownRearGlow",
}
/** This struct is intended as a helper to pass args to generic dbus interface */
export interface AuraPowerDev {
tuf: AuraDevTuf[];
x1866: AuraDevRog1[];
x19b6: AuraDevRog2[];
}
export enum LedBrightness {
Off = "Off",
Low = "Low",
Med = "Med",
High = "High",
}
export enum AuraDevice {
Tuf = "Tuf",
X1854 = "X1854",
X1869 = "X1869",
X1866 = "X1866",
X18c6 = "X18c6",
X19b6 = "X19b6",
X1a30 = "X1a30",
Unknown = "Unknown",
}

57
bindings/ts/platform.ts Normal file
View File

@@ -0,0 +1,57 @@
/*
Generated by typeshare 1.6.0
*/
export type AnimeSupportedFunctions = boolean;
export interface ChargeSupportedFunctions {
charge_level_set: boolean;
}
export interface PlatformProfileFunctions {
platform_profile: boolean;
fan_curves: boolean;
}
export enum AdvancedAura {
None = "None",
Zoned = "Zoned",
PerKey = "PerKey",
}
export interface LedSupportedFunctions {
dev_id: AuraDevice;
brightness: boolean;
basic_modes: AuraModeNum[];
basic_zones: AuraZone[];
advanced_type: AdvancedAura;
}
export interface RogBiosSupportedFunctions {
post_sound: boolean;
gpu_mux: boolean;
panel_overdrive: boolean;
dgpu_disable: boolean;
egpu_enable: boolean;
mini_led_mode: boolean;
}
export interface SupportedFunctions {
anime_ctrl: AnimeSupportedFunctions;
charge_ctrl: ChargeSupportedFunctions;
platform_profile: PlatformProfileFunctions;
keyboard_led: LedSupportedFunctions;
rog_bios_ctrl: RogBiosSupportedFunctions;
}
export enum GpuMode {
Discrete = "Discrete",
Optimus = "Optimus",
Integrated = "Integrated",
Egpu = "Egpu",
Vfio = "Vfio",
Ultimate = "Ultimate",
Error = "Error",
NotSupported = "NotSupported",
}

35
bindings/ts/profiles.ts Normal file
View File

@@ -0,0 +1,35 @@
/*
Generated by typeshare 1.6.0
*/
export enum FanCurvePU {
CPU = "CPU",
GPU = "GPU",
}
export interface CurveData {
fan: FanCurvePU;
pwm: [number, number, number, number, number, number, number, number];
temp: [number, number, number, number, number, number, number, number];
}
/** A `FanCurveSet` contains both CPU and GPU fan curve data */
export interface FanCurveSet {
enabled: boolean;
cpu: CurveData;
gpu: CurveData;
}
/** Main purpose of `FanCurves` is to enable restoring state on system boot */
export interface FanCurveProfiles {
balanced: FanCurveSet;
performance: FanCurveSet;
quiet: FanCurveSet;
}
export enum Profile {
Balanced = "Balanced",
Performance = "Performance",
Quiet = "Quiet",
}