Monitoring DBus-Signal ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Monitoring DBus-Signal ?

Hans Lehmann
Hello,

I want to see the signal 'VolumeChanged' sent by the application
'org.gtk.Private.MTPVolumeMonitor' with the interface
'org.gtk.Private.RemoteVolumeMonitor'. The dbus-monitor program shows:

signal sender=:1.10 -> dest=(null destination) serial=319
path=/org/gtk/Private/RemoteVolumeMonitor;
interface=org.gtk.Private.RemoteVolumeMonitor; member=VolumeChanged

I am not able to observe this DBus signal. The project is attached. The
project follows the documentation under the link:
http://gambaswiki.org/wiki/doc/dbus#t4 .

Sincerely,
Hans

Code:

' Gambas class file

Public hDBusObject As New DBusObject
Public hDBusSignal As DBusSignal

Public Sub Form_Open()

   FMain.Resizable = False
   DBus.Debug = True
   DBus.Unique = True
   DBus.Session.Register(hDBusObject, Application.Path) ' o.k.

   hDBusSignal = New DBusSignal(DBus.Session,
"org.gtk.Private.RemoteVolumeMonitor") As "MySignal"

End

Public Sub MySignal_Signal(Signal As String, Arguments As Variant[])

   Print Signal
   Print Arguments.Count

' If Signal = "VolumeChanged" Then Print ("USB-Stick or SD-Card
registered!")
' If Signal = "VolumeRemoved" Then Print ("USB-Stick or SD-Card
deregistered!")

End

------------------------------------------------------------------------------

_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user

SignalWatch-1.2.10.tar.gz (69K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Monitoring DBus-Signal ?

Fabien Bodard-4
gb.dbus: start watching connection
gb.dbus: add match:
type='signal',interface='org.gtk.Private.RemoteVolumeMonitor',destination=':1.232'
gb.dbus: warning: unhandled message: signal
sender=org.freedesktop.DBus -> dest=:1.232 serial=2
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
 member=NameAcquired
   string ":1.232"

i have this

2016-11-19 17:14 GMT+01:00 Hans Lehmann <[hidden email]>:

> Hello,
>
> I want to see the signal 'VolumeChanged' sent by the application
> 'org.gtk.Private.MTPVolumeMonitor' with the interface
> 'org.gtk.Private.RemoteVolumeMonitor'. The dbus-monitor program shows:
>
> signal sender=:1.10 -> dest=(null destination) serial=319
> path=/org/gtk/Private/RemoteVolumeMonitor;
> interface=org.gtk.Private.RemoteVolumeMonitor; member=VolumeChanged
>
> I am not able to observe this DBus signal. The project is attached. The
> project follows the documentation under the link:
> http://gambaswiki.org/wiki/doc/dbus#t4 .
>
> Sincerely,
> Hans
>
> Code:
>
> ' Gambas class file
>
> Public hDBusObject As New DBusObject
> Public hDBusSignal As DBusSignal
>
> Public Sub Form_Open()
>
>   FMain.Resizable = False
>   DBus.Debug = True
>   DBus.Unique = True
>   DBus.Session.Register(hDBusObject, Application.Path) ' o.k.
>
>   hDBusSignal = New DBusSignal(DBus.Session,
> "org.gtk.Private.RemoteVolumeMonitor") As "MySignal"
>
> End
>
> Public Sub MySignal_Signal(Signal As String, Arguments As Variant[])
>
>   Print Signal
>   Print Arguments.Count
>
> ' If Signal = "VolumeChanged" Then Print ("USB-Stick or SD-Card
> registered!")
> ' If Signal = "VolumeRemoved" Then Print ("USB-Stick or SD-Card
> deregistered!")
>
> End
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



--
Fabien Bodard

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Monitoring DBus-Signal ?

Hans Lehmann
In reply to this post by Hans Lehmann
Am 19.11.2016 um 17:14 schrieb Hans Lehmann:

> I want to see the signal 'VolumeChanged' sent by the application
> 'org.gtk.Private.MTPVolumeMonitor' with the interface
> 'org.gtk.Private.RemoteVolumeMonitor'. The dbus-monitor program shows:
>
> signal sender=:1.10 -> dest=(null destination) serial=319
> path=/org/gtk/Private/RemoteVolumeMonitor;
> interface=org.gtk.Private.RemoteVolumeMonitor; member=VolumeChanged
>
> I am not able to observe this DBus signal. The project is attached.
> The project follows the documentation under the link:
> http://gambaswiki.org/wiki/doc/dbus#t4 .
Hello,

this line in attached Project:

$hDBusSignal = New DBusSignal(DBus.Session,
"org.gtk.Private.RemoteVolumeMonitor", True) As "MySignal"

generated an error.

Example:

USB-Stick in:
Under Stack.Backstrace in line 19 (DBusSignal.DBusObserver_Message.19):
Error-Message: Typ mismatch: wanted String, got String[] instead

USB-Stick out:
Under Stack.Backstrace in line 19 (DBusSignal.DBusObserver_Message.19):
Error-Message: Typ mismatch: wanted String, got Collection instead

Regards,
Hans

------------------------------------------------------------------------------

_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user

SignalWatch-1.2.11.tar.gz (69K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Monitoring DBus-Signal ?

Zainudin A
I think this is a bug from DBusObserver class, (attach pic-1)

On 11/21/16, Hans Lehmann <[hidden email]> wrote:

> Am 19.11.2016 um 17:14 schrieb Hans Lehmann:
>> I want to see the signal 'VolumeChanged' sent by the application
>> 'org.gtk.Private.MTPVolumeMonitor' with the interface
>> 'org.gtk.Private.RemoteVolumeMonitor'. The dbus-monitor program shows:
>>
>> signal sender=:1.10 -> dest=(null destination) serial=319
>> path=/org/gtk/Private/RemoteVolumeMonitor;
>> interface=org.gtk.Private.RemoteVolumeMonitor; member=VolumeChanged
>>
>> I am not able to observe this DBus signal. The project is attached.
>> The project follows the documentation under the link:
>> http://gambaswiki.org/wiki/doc/dbus#t4 .
>
> Hello,
>
> this line in attached Project:
>
> $hDBusSignal = New DBusSignal(DBus.Session,
> "org.gtk.Private.RemoteVolumeMonitor", True) As "MySignal"
>
> generated an error.
>
> Example:
>
> USB-Stick in:
> Under Stack.Backstrace in line 19 (DBusSignal.DBusObserver_Message.19):
> Error-Message: Typ mismatch: wanted String, got String[] instead
>
> USB-Stick out:
> Under Stack.Backstrace in line 19 (DBusSignal.DBusObserver_Message.19):
> Error-Message: Typ mismatch: wanted String, got Collection instead
>
> Regards,
> Hans
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user

pic-1.png (245K) Download Attachment