iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: "clement.legoffic@kelio.com" <clement.legoffic@kelio.com>,
	"iwd@lists.linux.dev" <iwd@lists.linux.dev>
Subject: Re: Object path last number
Date: Tue, 9 May 2023 06:57:41 -0700	[thread overview]
Message-ID: <119648c7-318b-6ff3-1f04-02d6525c7059@gmail.com> (raw)
In-Reply-To: <e1a347d59c344b928c1e9150048f9d87@kelio.com>

Hi Clement,

On 5/9/23 6:15 AM, clement.legoffic@kelio.com wrote:
> Hi,
> 
> I am trying to interface a dynamic dbus client to the IWD dbus interface for simple commands such as GetOrderedNetworks() or Scan().
> The thing is that the object path of those methods starts with "/net/connman/iwd/" followed by the phy (I only have one interface so I guess it will be 0) and then a number.
> As I want to be dynamic I try to restart iwd to try to observe a specific pattern in the last number of this object path. I have observe that this number is incremented by one at each restart of the iwd service.
> But I saw this number jumping  (by 5 sometimes).
> 
> So I was wondering If I want to call the Scan method, how can I get the correct number for the object path dynamically ?

The last number is actually the interface index, but the path itself 
isn't something you need to worry about deriving yourself. Instead you 
can use the org.freedesktop.DBus.ObjectManager interface and 
GetManagedObjects() method. This returns all the object paths and 
interfaces for IWD.

If your working with Python you can check out IWD's test framework as a 
guide:

https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/autotests/util/iwd.py#n1143

Thanks,
James

> 
> Thanks
> 
> Clément
> 
> 
> Ce message et toutes les pieces jointes (ci-apres le "message") sont etablis a l'intention exclusive de ses destinataires.
> Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur par e-mail.
> Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. Les communications sur Internet n'etant pas securisees, l'expediteur informe qu'il ne peut accepter aucune responsabilite quant au contenu de ce message.
> This mail message and attachments (the "message") are solely intended for the addresses. It is confidential in nature.
> If you receive this message in error, please delete it and immediately notify the sender by e-mail.
> Any use other than its intended purpose, dissemination or disclosure, either whole or partial, is prohibited except if formal approval is granted. As communication on the Internet is not secure, the sender does not accept responsibility for the content of this message.
> 

  reply	other threads:[~2023-05-09 13:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 13:15 Object path last number clement.legoffic
2023-05-09 13:57 ` James Prestwood [this message]
2023-05-09 14:16   ` clement.legoffic
2023-05-09 14:25     ` James Prestwood
2023-05-09 14:40       ` clement.legoffic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=119648c7-318b-6ff3-1f04-02d6525c7059@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=clement.legoffic@kelio.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).