All of lore.kernel.org
 help / color / mirror / Atom feed
* Is there any tool to query dbus interface property?
@ 2017-12-25  5:31 Yong Li
  2018-01-03 13:37 ` Andrew Geissler
  0 siblings, 1 reply; 4+ messages in thread
From: Yong Li @ 2017-12-25  5:31 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

Hi All, 

 

I would like to query a dbus property and make different actions based on
the property. 

Just like the pgood_wait.c in skeleton, but it only supports the pgood
property. Is there any a common tool can support query/wait different dbus
interface/objects?

 

If not, I would like to create one based on the pgood_wait.c

 

Thanks,

Yong

 


[-- Attachment #2: Type: text/html, Size: 2417 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there any tool to query dbus interface property?
  2017-12-25  5:31 Is there any tool to query dbus interface property? Yong Li
@ 2018-01-03 13:37 ` Andrew Geissler
  2018-01-03 13:42   ` Yong Li
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Geissler @ 2018-01-03 13:37 UTC (permalink / raw)
  To: Yong Li; +Cc: OpenBMC Maillist

On Sun, Dec 24, 2017 at 11:31 PM, Yong Li <yong.b.li@linux.intel.com> wrote:
> Hi All,
>
>
>
> I would like to query a dbus property and make different actions based on
> the property.

Just querying a property can be done via the busctl tool: busctl
get-property xyz.openbmc_project.State.BMC
/xyz/openbmc_project/state/bmc0 xyz.openbmc_project.State.BMC
CurrentBMCState

> Just like the pgood_wait.c in skeleton, but it only supports the pgood
> property. Is there any a common tool can support query/wait different dbus
> interface/objects?

Waiting on a dbus service can be done via the mapper tool: mapper wait
/xyz/openbmc_project/state/bmc0

And this can also all be done in the application code itself using
sdbusplus interfaces to mapper and the objects you're interested in.

>
>
> If not, I would like to create one based on the pgood_wait.c
>
>
>
> Thanks,
>
> Yong
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Is there any tool to query dbus interface property?
  2018-01-03 13:37 ` Andrew Geissler
@ 2018-01-03 13:42   ` Yong Li
  2018-01-04  3:32     ` Andrew Geissler
  0 siblings, 1 reply; 4+ messages in thread
From: Yong Li @ 2018-01-03 13:42 UTC (permalink / raw)
  To: 'Andrew Geissler'; +Cc: 'OpenBMC Maillist'

Thanks for your information.

What I want is to wait for a property to be an expected value. 
For example, wait for pgood to be 1, to make sure the power is on.

Let me check on the mapper wait command......

Thanks,
Yong

-----Original Message-----
From: Andrew Geissler [mailto:geissonator@gmail.com] 
Sent: Wednesday, January 3, 2018 9:37 PM
To: Yong Li <yong.b.li@linux.intel.com>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: Is there any tool to query dbus interface property?

On Sun, Dec 24, 2017 at 11:31 PM, Yong Li <yong.b.li@linux.intel.com> wrote:
> Hi All,
>
>
>
> I would like to query a dbus property and make different actions based 
> on the property.

Just querying a property can be done via the busctl tool: busctl get-property xyz.openbmc_project.State.BMC
/xyz/openbmc_project/state/bmc0 xyz.openbmc_project.State.BMC CurrentBMCState

> Just like the pgood_wait.c in skeleton, but it only supports the pgood 
> property. Is there any a common tool can support query/wait different 
> dbus interface/objects?

Waiting on a dbus service can be done via the mapper tool: mapper wait
/xyz/openbmc_project/state/bmc0

And this can also all be done in the application code itself using sdbusplus interfaces to mapper and the objects you're interested in.

>
>
> If not, I would like to create one based on the pgood_wait.c
>
>
>
> Thanks,
>
> Yong
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there any tool to query dbus interface property?
  2018-01-03 13:42   ` Yong Li
@ 2018-01-04  3:32     ` Andrew Geissler
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Geissler @ 2018-01-04  3:32 UTC (permalink / raw)
  To: Yong Li; +Cc: OpenBMC Maillist

On Wed, Jan 3, 2018 at 7:42 AM, Yong Li <yong.b.li@linux.intel.com> wrote:
> Thanks for your information.
>
> What I want is to wait for a property to be an expected value.
> For example, wait for pgood to be 1, to make sure the power is on.
>
> Let me check on the mapper wait command......

May want to take a look at
https://github.com/openbmc/witherspoon-pfault-analysis/blob/master/power-sequencer/pgood_monitor.cpp#L112

That sets up a dbus watch on the pgood property changing and calls a
callback function when it happens.  Sounds more like what you want.

>
> Thanks,
> Yong
>
> -----Original Message-----
> From: Andrew Geissler [mailto:geissonator@gmail.com]
> Sent: Wednesday, January 3, 2018 9:37 PM
> To: Yong Li <yong.b.li@linux.intel.com>
> Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>
> Subject: Re: Is there any tool to query dbus interface property?
>
> On Sun, Dec 24, 2017 at 11:31 PM, Yong Li <yong.b.li@linux.intel.com> wrote:
>> Hi All,
>>
>>
>>
>> I would like to query a dbus property and make different actions based
>> on the property.
>
> Just querying a property can be done via the busctl tool: busctl get-property xyz.openbmc_project.State.BMC
> /xyz/openbmc_project/state/bmc0 xyz.openbmc_project.State.BMC CurrentBMCState
>
>> Just like the pgood_wait.c in skeleton, but it only supports the pgood
>> property. Is there any a common tool can support query/wait different
>> dbus interface/objects?
>
> Waiting on a dbus service can be done via the mapper tool: mapper wait
> /xyz/openbmc_project/state/bmc0
>
> And this can also all be done in the application code itself using sdbusplus interfaces to mapper and the objects you're interested in.
>
>>
>>
>> If not, I would like to create one based on the pgood_wait.c
>>
>>
>>
>> Thanks,
>>
>> Yong
>>
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-04  3:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-25  5:31 Is there any tool to query dbus interface property? Yong Li
2018-01-03 13:37 ` Andrew Geissler
2018-01-03 13:42   ` Yong Li
2018-01-04  3:32     ` Andrew Geissler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.