Problem with reading Properties #41

Closed
swistaczek opened this Issue Mar 30, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@swistaczek

Hello,
First of all I would like to say thanks you for great library :), I am trying to read properties for NetworkManager ( http://projects.gnome.org/NetworkManager/developers/mm-spec-04.html ) using following code:

    @bus        = DBus::SystemBus.instance
    @mm_service = @bus['org.freedesktop.ModemManager'
    @proxy = @mm_service.object('/org/freedesktop/ModemManager/Modems/0')
    @proxy.introspect
[85] pry(main)> @proxy['org.freedesktop.ModemManager.Modem']['Enabled']
NoMethodError: undefined method `Get' for #<DBus::ProxyObjectInterface:0x0000000304d190>
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p392/bundler/gems/ruby-dbus-f25a6953df05/lib/dbus/introspect.rb:333:in `[]'

Could you @mvidner please point me where I am making mistake? Thanks in advantage.

I would like to fix this odd method https://github.com/swistaczek/ruby-network-manager/blob/master/lib/network_manager/modem.rb#L27

@mvidner

This comment has been minimized.

Show comment
Hide comment
@mvidner

mvidner Apr 5, 2013

Owner

Thanks for the report. It turns out that ModemManager introspection output is a bit quirky, splitting the Properties interface into two elements (see below) and ruby-dbus only interprets one of them, missing the Properties.Get method.

$ dbus-send --system --print-reply --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager/Modems/0 org.freedesktop.DBus.Introspectable.Introspect | grep \<interface
  <interface name="org.freedesktop.DBus.Introspectable">
  <interface name="org.freedesktop.DBus.Properties">                              HERE
  <interface name="org.freedesktop.ModemManager.Modem.Simple">
  <interface name="org.freedesktop.ModemManager.Modem.Gsm.Ussd">
  <interface name="org.freedesktop.ModemManager.Modem.Location">
  <interface name="org.freedesktop.ModemManager.Modem.Gsm.SMS">
  <interface name="org.freedesktop.ModemManager.Modem.Gsm.Network">
  <interface name="org.freedesktop.ModemManager.Modem.Gsm.Card">
  <interface name="org.freedesktop.ModemManager.Modem.Time">
  <interface name="org.freedesktop.DBus.Properties">                             AND HERE
  <interface name="org.freedesktop.ModemManager.Modem">

I think I should make the introspection parser merge them, perhaps even with a set of fall back property introspection.

Owner

mvidner commented Apr 5, 2013

Thanks for the report. It turns out that ModemManager introspection output is a bit quirky, splitting the Properties interface into two elements (see below) and ruby-dbus only interprets one of them, missing the Properties.Get method.

$ dbus-send --system --print-reply --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager/Modems/0 org.freedesktop.DBus.Introspectable.Introspect | grep \<interface
  <interface name="org.freedesktop.DBus.Introspectable">
  <interface name="org.freedesktop.DBus.Properties">                              HERE
  <interface name="org.freedesktop.ModemManager.Modem.Simple">
  <interface name="org.freedesktop.ModemManager.Modem.Gsm.Ussd">
  <interface name="org.freedesktop.ModemManager.Modem.Location">
  <interface name="org.freedesktop.ModemManager.Modem.Gsm.SMS">
  <interface name="org.freedesktop.ModemManager.Modem.Gsm.Network">
  <interface name="org.freedesktop.ModemManager.Modem.Gsm.Card">
  <interface name="org.freedesktop.ModemManager.Modem.Time">
  <interface name="org.freedesktop.DBus.Properties">                             AND HERE
  <interface name="org.freedesktop.ModemManager.Modem">

I think I should make the introspection parser merge them, perhaps even with a set of fall back property introspection.

@swistaczek

This comment has been minimized.

Show comment
Hide comment
@swistaczek

swistaczek Apr 5, 2013

Hey,
Thanks for quick reply. I will try to dive into ruby-dbus code and fix
parser.
05-04-2013 17:15, "Martin Vidner" notifications@github.com napisa³(a):

Thanks for the report. It turns out that ModemManager introspection output
is a bit quirky, splitting the Properties interface into two elements (see
below) and ruby-dbus only interprets one of them, missing the
Properties.Get method.

$ dbus-send --system --print-reply --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager/Modems/0 org.freedesktop.DBus.Introspectable.Introspect | grep <interface

HERE







AND HERE

I think I should make the introspection parser merge them, perhaps even
with a set of fall back property introspection.

Reply to this email directly or view it on GitHubhttps://github.com/mvidner/ruby-dbus/issues/41#issuecomment-15961692
.

Hey,
Thanks for quick reply. I will try to dive into ruby-dbus code and fix
parser.
05-04-2013 17:15, "Martin Vidner" notifications@github.com napisa³(a):

Thanks for the report. It turns out that ModemManager introspection output
is a bit quirky, splitting the Properties interface into two elements (see
below) and ruby-dbus only interprets one of them, missing the
Properties.Get method.

$ dbus-send --system --print-reply --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager/Modems/0 org.freedesktop.DBus.Introspectable.Introspect | grep <interface

HERE







AND HERE

I think I should make the introspection parser merge them, perhaps even
with a set of fall back property introspection.

Reply to this email directly or view it on GitHubhttps://github.com/mvidner/ruby-dbus/issues/41#issuecomment-15961692
.

@swistaczek

This comment has been minimized.

Show comment
Hide comment
@swistaczek

swistaczek Apr 21, 2013

Hello @mvidner, I was unable to find section responsible for params merge. Could you help me with fixing this bug please?

Hello @mvidner, I was unable to find section responsible for params merge. Could you help me with fixing this bug please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment