171 lines
5.3 KiB
HTML
171 lines
5.3 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Net::DBus::RemoteObject</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Net::DBus::RemoteObject</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-12-26<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Net::DBus::RemoteObject - Access objects provided on the bus
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
my $service = $bus->get_service("org.freedesktop.DBus");
|
|
my $object = $service->get_object("/org/freedesktop/DBus");
|
|
|
|
print "Names on the bus {\n";
|
|
foreach my $name (sort @{$object->ListNames}) {
|
|
print " ", $name, "\n";
|
|
}
|
|
print "}\n";
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
This module provides the <FONT SIZE="-1">API</FONT> for accessing remote objects available
|
|
on the bus. It uses the autoloader to fake the presence of methods
|
|
based on the <FONT SIZE="-1">API</FONT> of the remote object. There is also support for
|
|
setting callbacks against signals, and accessing properties of the
|
|
object.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>METHODS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">my $object = Net::DBus::RemoteObject->new($service, $object_path[, $interface], \%params);<DD>
|
|
|
|
|
|
|
|
|
|
Creates a new handle to a remote object. The <TT>$service</TT> parameter is an instance
|
|
of the Net::DBus::RemoteService method, and <TT>$object_path</TT> is the identifier of
|
|
an object exported by this service, for example <TT>"/org/freedesktop/DBus"</TT>. For remote
|
|
objects which implement more than one interface it is possible to specify an optional
|
|
name of an interface as the third parameter. This is only really required, however, if
|
|
two interfaces in the object provide methods with the same name, since introspection
|
|
data can be used to automatically resolve the correct interface to call cases where
|
|
method names are unique. Rather than using this constructor directly, it is preferable
|
|
to use the <TT>"get_object"</TT> method on Net::DBus::RemoteService, since this caches handles
|
|
to remote objects, eliminating unnecessary introspection data lookups.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <TT>%params</TT> parameter contains extra configuration parameters for the object. Currently
|
|
a single parameter is supported, <TT>"timeout"</TT> which takes a value in milliseconds to use as
|
|
the timeout for method calls on the object.
|
|
<DT id="2">my $object = $object->as_interface($interface);<DD>
|
|
|
|
|
|
|
|
|
|
Casts the object to a specific interface, returning a new instance of the
|
|
Net::DBus::RemoteObject specialized to the desired interface. It is only
|
|
necessary to cast objects to a specific interface, if two interfaces
|
|
export methods or signals with the same name, or the remote object does not
|
|
support introspection.
|
|
<DT id="3">my $service = $object->get_service<DD>
|
|
|
|
|
|
|
|
|
|
Retrieves a handle for the remote service on which this object is
|
|
attached. The returned object is an instance of Net::DBus::RemoteService
|
|
<DT id="4">my $path = $object->get_object_path<DD>
|
|
|
|
|
|
|
|
|
|
Retrieves the unique path identifier for this object within the
|
|
service.
|
|
<DT id="5">my $object = $object->get_child_object($subpath, [$interface])<DD>
|
|
|
|
|
|
|
|
|
|
Retrieves a handle to a child of this object, identified
|
|
by the relative path <TT>$subpath</TT>. The returned object
|
|
is an instance of <TT>"Net::DBus::RemoteObject"</TT>. The optional
|
|
<TT>$interface</TT> parameter can be used to immediately cast
|
|
the object to a specific type.
|
|
<DT id="6">my $sigid = $object->connect_to_signal($name, $coderef);<DD>
|
|
|
|
|
|
|
|
|
|
Connects a callback to a signal emitted by the object. The <TT>$name</TT>
|
|
parameter is the name of the signal within the object, and <TT>$coderef</TT>
|
|
is a reference to an anonymous subroutine. When the signal <TT>$name</TT>
|
|
is emitted by the remote object, the subroutine <TT>$coderef</TT> will be
|
|
invoked, and passed the parameters from the signal. A unique <TT>$sigid</TT>
|
|
will be returned, which can be later passed to <TT>"disconnect_from_signal"</TT>
|
|
to remove the handler
|
|
<DT id="7">$object->disconnect_from_signal($name, $sigid);<DD>
|
|
|
|
|
|
|
|
|
|
Disconnects from a signal emitted by the object. The <TT>$name</TT>
|
|
parameter is the name of the signal within the object. The
|
|
<TT>$sigid</TT> must be the unique signal handler <FONT SIZE="-1">ID</FONT> returned by
|
|
a previous <TT>"connect_to_signal"</TT> method call.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
|
|
|
|
Daniel Berrange <<A HREF="mailto:dan@berrange.com">dan@berrange.com</A>>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copright (C) 2004-2011, Daniel Berrange.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
Net::DBus::RemoteService, Net::DBus::Object, Net::DBus::Annotation
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="8"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="9"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="10"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="11"><A HREF="#lbAE">METHODS</A><DD>
|
|
<DT id="12"><A HREF="#lbAF">AUTHOR</A><DD>
|
|
<DT id="13"><A HREF="#lbAG">COPYRIGHT</A><DD>
|
|
<DT id="14"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:49 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|