Skip to content

Commit

Permalink
Add dbus interface to method call
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthb committed Apr 27, 2024
1 parent ba51c6e commit 53b0dc2
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions hostname1/dbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,213 +88,213 @@ func (c *Conn) initConnection() error {
}

func (c *Conn) SetHostname(hostname string, interactive bool) error {
return c.object.Call(".SetHostname", 0, hostname, interactive).Err
return c.object.Call(dbusDest+".SetHostname", 0, hostname, interactive).Err
}

func (c *Conn) SetStaticHostname(hostname string, interactive bool) error {
return c.object.Call(".SetStaticHostname", 0, hostname, interactive).Err
return c.object.Call(dbusDest+".SetStaticHostname", 0, hostname, interactive).Err
}

func (c *Conn) SetPrettyHostname(hostname string, interactive bool) error {
return c.object.Call(".SetPrettyHostname", 0, hostname, interactive).Err
return c.object.Call(dbusDest+".SetPrettyHostname", 0, hostname, interactive).Err
}

func (c *Conn) SetIconName(iconName string, interactive bool) error {
return c.object.Call(".SetIconName", 0, iconName, interactive).Err
return c.object.Call(dbusDest+".SetIconName", 0, iconName, interactive).Err
}

func (c *Conn) SetChassis(chassis string, interactive bool) error {
return c.object.Call(".SetChassis", 0, chassis, interactive).Err
return c.object.Call(dbusDest+".SetChassis", 0, chassis, interactive).Err
}

func (c *Conn) SetDeployment(deployment string, interactive bool) error {
return c.object.Call(".SetDeployment", 0, deployment, interactive).Err
return c.object.Call(dbusDest+".SetDeployment", 0, deployment, interactive).Err
}

func (c *Conn) SetLocation(location string, interactive bool) error {
return c.object.Call(".SetLocation", 0, location, interactive).Err
return c.object.Call(dbusDest+".SetLocation", 0, location, interactive).Err
}

func (c *Conn) GetProductUUID(interactive bool) ([]byte, error) {
var uuid []byte
err := c.object.Call(".GetProductUUID", 0, interactive).Store(&uuid)
err := c.object.Call(dbusDest+".GetProductUUID", 0, interactive).Store(&uuid)
return uuid, err
}

func (c *Conn) GetHardwareSerial() (string, error) {
var serial string
err := c.object.Call(".GetHardwareSerial", 0).Store(&serial)
err := c.object.Call(dbusDest+".GetHardwareSerial", 0).Store(&serial)
return serial, err
}

func (c *Conn) Describe() (string, error) {
var description string
err := c.object.Call(".Describe", 0).Store(&description)
err := c.object.Call(dbusDest+".Describe", 0).Store(&description)
return description, err
}

func (c *Conn) Hostname() (string, error) {
out, err := c.object.GetProperty(".Hostname")
out, err := c.object.GetProperty(dbusDest + ".Hostname")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) StaticHostname() (string, error) {
out, err := c.object.GetProperty(".StaticHostname")
out, err := c.object.GetProperty(dbusDest + ".StaticHostname")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) PrettyHostname() (string, error) {
out, err := c.object.GetProperty(".PrettyHostname")
out, err := c.object.GetProperty(dbusDest + ".PrettyHostname")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) DefaultHostname() (string, error) {
out, err := c.object.GetProperty(".DefaultHostname")
out, err := c.object.GetProperty(dbusDest + ".DefaultHostname")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) HostnameSource() (string, error) {
out, err := c.object.GetProperty(".HostnameSource")
out, err := c.object.GetProperty(dbusDest + ".HostnameSource")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) IconName() (string, error) {
out, err := c.object.GetProperty(".IconName")
out, err := c.object.GetProperty(dbusDest + ".IconName")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) Chassis() (string, error) {
out, err := c.object.GetProperty(".Chassis")
out, err := c.object.GetProperty(dbusDest + ".Chassis")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) Deployment() (string, error) {
out, err := c.object.GetProperty(".Deployment")
out, err := c.object.GetProperty(dbusDest + ".Deployment")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) Location() (string, error) {
out, err := c.object.GetProperty(".Location")
out, err := c.object.GetProperty(dbusDest + ".Location")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) KernelName() (string, error) {
out, err := c.object.GetProperty(".KernelName")
out, err := c.object.GetProperty(dbusDest + ".KernelName")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) KernelRelease() (string, error) {
out, err := c.object.GetProperty(".KernelRelease")
out, err := c.object.GetProperty(dbusDest + ".KernelRelease")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) KernelVersion() (string, error) {
out, err := c.object.GetProperty(".KernelVersion")
out, err := c.object.GetProperty(dbusDest + ".KernelVersion")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) OperatingSystemPrettyName() (string, error) {
out, err := c.object.GetProperty(".OperatingSystemPrettyName")
out, err := c.object.GetProperty(dbusDest + ".OperatingSystemPrettyName")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) OperatingSystemCPEName() (string, error) {
out, err := c.object.GetProperty(".OperatingSystemCPEName")
out, err := c.object.GetProperty(dbusDest + ".OperatingSystemCPEName")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) OperatingSystemSupportEnd() (uint64, error) {
out, err := c.object.GetProperty(".OperatingSystemSupportEnd")
out, err := c.object.GetProperty(dbusDest + ".OperatingSystemSupportEnd")
if err != nil {
return 0, err
}
return out.Value().(uint64), nil
}

func (c *Conn) HomeURL() (string, error) {
out, err := c.object.GetProperty(".HomeURL")
out, err := c.object.GetProperty(dbusDest + ".HomeURL")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) HardwareVendor() (string, error) {
out, err := c.object.GetProperty(".HardwareVendor")
out, err := c.object.GetProperty(dbusDest + ".HardwareVendor")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) HardwareModel() (string, error) {
out, err := c.object.GetProperty(".HardwareModel")
out, err := c.object.GetProperty(dbusDest + ".HardwareModel")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) FirmwareVersion() (string, error) {
out, err := c.object.GetProperty(".FirmwareVersion")
out, err := c.object.GetProperty(dbusDest + ".FirmwareVersion")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) FirmwareVendor() (string, error) {
out, err := c.object.GetProperty(".FirmwareVendor")
out, err := c.object.GetProperty(dbusDest + ".FirmwareVendor")
if err != nil {
return "", err
}
return out.Value().(string), nil
}

func (c *Conn) FirmwareDate() (uint64, error) {
out, err := c.object.GetProperty(".FirmwareDate")
out, err := c.object.GetProperty(dbusDest + ".FirmwareDate")
if err != nil {
return 0, err
}
Expand Down

0 comments on commit 53b0dc2

Please sign in to comment.