Is there any tool to query dbus interface property?

Andrew Geissler geissonator at gmail.com
Thu Jan 4 14:32:26 AEDT 2018


On Wed, Jan 3, 2018 at 7:42 AM, Yong Li <yong.b.li at 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 at gmail.com]
> Sent: Wednesday, January 3, 2018 9:37 PM
> To: Yong Li <yong.b.li at linux.intel.com>
> Cc: OpenBMC Maillist <openbmc at 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 at 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
>>
>>
>


More information about the openbmc mailing list