Difference between revisions of "Dbus"

From Navit's Wiki
Jump to: navigation, search
m (Typo)
 
(13 intermediate revisions by 6 users not shown)
Line 2: Line 2:
 
=Enabling=
 
=Enabling=
 
To be able to send and receive signals from Navit, you must enable it in navit.xml. Change line 13 to the following:
 
To be able to send and receive signals from Navit, you must enable it in navit.xml. Change line 13 to the following:
 +
<source lang="xml">
 
  <plugin path="$NAVIT_LIBDIR/*/${NAVIT_LIBPREFIX}libbinding_dbus.so" active="yes"/>
 
  <plugin path="$NAVIT_LIBDIR/*/${NAVIT_LIBPREFIX}libbinding_dbus.so" active="yes"/>
 +
</source>
  
 
=Common actions=
 
=Common actions=
 
==Zoom in/out==
 
==Zoom in/out==
 
Zoom to level 500:
 
Zoom to level 500:
<pre style="white-space:pre-wrap;">
+
<source lang="bash">
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_attr string:"zoom" variant:int32:500
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_attr string:"zoom" variant:int32:500
</pre>
+
</source>
 
Zoom in by factor of 2:
 
Zoom in by factor of 2:
<pre style="white-space:pre-wrap;">
+
<source lang="bash">
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.zoom int32:2
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.zoom int32:2
</pre>
+
</source>
 
Zoom out by factor of 2:
 
Zoom out by factor of 2:
<pre style="white-space:pre-wrap;">
+
<source lang="bash">
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.zoom int32:-2
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.zoom int32:-2
</pre>
+
</source>
  
 
==Set Position/Destination ==
 
==Set Position/Destination ==
 
Set position to longitude 24.0, latitude 65.0:
 
Set position to longitude 24.0, latitude 65.0:
<pre style="white-space:pre-wrap;">
+
<source lang="bash">
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_position string:"geo: 24.0 65.0"
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_position string:"geo: 24.0 65.0"
</pre>
+
</source>
 
Set destination to longitude 24.0, latitude 65.0:
 
Set destination to longitude 24.0, latitude 65.0:
<pre style="white-space:pre-wrap;">
+
<source lang="bash">
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.destination string:"geo: 24.0 65.0"
+
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_destination string:"geo: 24.0 65.0" string:"comment"
</pre>
+
</source>
  
 
==Set map-view centre==
 
==Set map-view centre==
 
Centre the map to longitude 24.0, latitude 65.0:
 
Centre the map to longitude 24.0, latitude 65.0:
<pre style="white-space:pre-wrap;">
+
<source lang="bash">
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_center_by_string string:"geo: 24.0 65.0"
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_center_by_string string:"geo: 24.0 65.0"
</pre>
+
</source>
  
 
==Change map layout==
 
==Change map layout==
 
Change layout to "Car-dark":
 
Change layout to "Car-dark":
<pre style="white-space:pre-wrap;">
+
<source lang="bash">
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_layout string:"Car-dark"
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_layout string:"Car-dark"
</pre>
+
</source>
  
 
==Change vehicle profile==
 
==Change vehicle profile==
 
Change profile to "bike":
 
Change profile to "bike":
<pre style="white-space:pre-wrap;">
+
<source lang="bash">
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicle org.navit_project.navit.vehicle.set_attr string:"profilename" variant:string:"bike"
 
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicle org.navit_project.navit.vehicle.set_attr string:"profilename" variant:string:"bike"
</pre>
+
</source>
  
=Navit DBus details:=
+
=Navit DBus details=
 
DBUS Service: "org.navit_project.navit" <br>
 
DBUS Service: "org.navit_project.navit" <br>
 
DBUS Bus: Session bus
 
DBUS Bus: Session bus
  
=org.navit_project.navit.navit:=
+
=org.navit_project.navit.navit=
 
DBUS Object Path: /org/navit_project/navit/navit/[]
 
DBUS Object Path: /org/navit_project/navit/navit/[]
  
Line 71: Line 73:
 
   navit=bus.get_object('org.navit_project.navit', path[1])
 
   navit=bus.get_object('org.navit_project.navit', path[1])
  
6) destroy the iter :
+
6) destroy the iter :
 
   iface.attr_iter_destroy(iter)
 
   iface.attr_iter_destroy(iter)
  
 
The following methods have to be applied on the navit object.
 
The following methods have to be applied on the navit object.
==Methods:==
+
==Methods==
 
Examples are shown for each command, and when using on the command line must be prefixed by:
 
Examples are shown for each command, and when using on the command line must be prefixed by:
 
  dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit
 
  dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit
Line 105: Line 107:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.draw</pre>
+
|<source lang="bash">org.navit_project.navit.navit.draw</source>
 
|-
 
|-
 
|}
 
|}
Line 126: Line 128:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.add_message string:"My Message"</pre>
+
|<source lang="bash">org.navit_project.navit.navit.add_message string:"My Message"</source>
 
|-
 
|-
 
|}
 
|}
Line 147: Line 149:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.set_center_by_string string:"geo: 24.0 65.0"</pre>
+
|<source lang="bash">org.navit_project.navit.navit.set_center_by_string string:"geo: 24.0 65.0"</source>
 
|-
 
|-
 
|}
 
|}
Line 169: Line 171:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.set_center int32:1 string:"geo: 24.0 65.0"</pre>
+
|<source lang="bash">org.navit_project.navit.navit.set_center int32:1 string:"geo: 24.0 65.0"</source>
  <pre>org.navit_project.navit.navit.set_center int32:1 int32:0x138a4a int32:0x5d773f</pre>
+
  <source lang="bash">org.navit_project.navit.navit.set_center int32:1 int32:0x138a4a int32:0x5d773f</source>
 
|-
 
|-
 
|}
 
|}
Line 191: Line 193:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.set_center_screen int32:200 int32:400</pre>
+
|<source lang="bash">org.navit_project.navit.navit.set_center_screen int32:200 int32:400</source>
 
|-
 
|-
 
|}
 
|}
Line 212: Line 214:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.set_layout string:"car-dark"</pre>
+
|<source lang="bash">org.navit_project.navit.navit.set_layout string:"car-dark"</source>
 
|-
 
|-
 
|}
 
|}
Line 233: Line 235:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.zoom int32:2 </pre>
+
|<source lang="bash">org.navit_project.navit.navit.zoom int32:2 </source>
<pre>org.navit_project.navit.navit.zoom int32:6 int32:200 int32:400</pre>
+
<source lang="bash">org.navit_project.navit.navit.zoom int32:6 int32:200 int32:400</source>
 
|-
 
|-
 
|}
 
|}
Line 254: Line 256:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.block int32:1</pre>
+
|<source lang="bash">org.navit_project.navit.navit.block int32:1</source>
 
|-
 
|-
 
|}
 
|}
Line 276: Line 278:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.set_position string:"geo: 24.0 65.0"</pre>
+
|<source lang="bash">org.navit_project.navit.navit.set_position string:"geo: 24.0 65.0"</source>
<pre>org.navit_project.navit.navit.set_position int32:1 string:"geo: 24.0 65.0"</pre>
+
<source lang="bash">org.navit_project.navit.navit.set_position int32:1 string:"geo: 24.0 65.0"</source>
<pre>org.navit_project.navit.navit.set_position int32:1 int32:0x138a4a int32:0x5d773f</pre>
+
<source lang="bash">org.navit_project.navit.navit.set_position int32:1 int32:0x138a4a int32:0x5d773f</source>
 
|-
 
|-
 
|}
 
|}
Line 299: Line 301:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.set_destination string:"geo: 24.0 65.0"</pre>
+
|<source lang="bash">org.navit_project.navit.navit.set_destination string:"geo: 24.0 65.0"</source>
<pre>org.navit_project.navit.navit.set_destination int32:1 string:"geo: 24.0 65.0"</pre>
+
<source lang="bash">org.navit_project.navit.navit.set_destination int32:1 string:"geo: 24.0 65.0"</source>
<pre>org.navit_project.navit.navit.set_destination int32:1 int32:0x138a4a int32:0x5d773f</pre>
+
<source lang="bash">org.navit_project.navit.navit.set_destination int32:1 int32:0x138a4a int32:0x5d773f</source>
 
|-
 
|-
 
|}
 
|}
Line 322: Line 324:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.clear_destination</pre>
+
|<source lang="bash">org.navit_project.navit.navit.clear_destination</source>
 
|-
 
|-
 
|}
 
|}
Line 343: Line 345:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.get_attr string:"zoom"</pre>
+
|<source lang="bash">org.navit_project.navit.navit.get_attr string:"zoom"</source>
 
returns:
 
returns:
<pre>
+
<source lang="bash">
 
   string "zoom"
 
   string "zoom"
 
   variant      int32 10
 
   variant      int32 10
</pre>
+
</source>
 
<hr>
 
<hr>
<pre>org.navit_project.navit.navit.get_attr string:"orientation"</pre>
+
<source lang="bash">org.navit_project.navit.navit.get_attr string:"orientation"</source>
 
returns:
 
returns:
<pre>
+
<source lang="bash">
 
   string "orientation"
 
   string "orientation"
 
   variant      int32 1
 
   variant      int32 1
</pre>
+
</source>
 
|-
 
|-
 
|}
 
|}
Line 376: Line 378:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.navit.set_attr string:"zoom" variant:int32:500</pre>
+
|<source lang="bash">org.navit_project.navit.navit.set_attr string:"zoom" variant:int32:500</source>
 
|-
 
|-
 
|}
 
|}
  
=org.navit_project.navit.vehicleprofile:=
+
===export_as_gpx===
 +
{| style="border-style:solid;border-width:1px;border-color:#aaa;background: #FFFFFF;border-collapse: collapse;font-size: 95%;width:100%;" border="1" cellpadding="5"
 +
|-
 +
|width="20px"|'''Path:'''
 +
|.navit
 +
|-
 +
|'''Arguments:'''
 +
|string:<tt>filename</tt>
 +
|-
 +
|'''Return:'''
 +
|''none''
 +
|-
 +
|'''Description:'''
 +
|Dump the current route, if any, into the file specified in the argument in the GPX format.
 +
|-
 +
|'''Example:'''
 +
|<source lang="bash">org.navit_project.navit.navit.export_as_gpx string:"/tmp/route.gpx"</source>
 +
|-
 +
|}
  
==Methods:==
+
=org.navit_project.navit.vehicleprofile=
 +
 
 +
==Methods==
 
Examples are shown for each command, and when using on the command line must be prefixed by:
 
Examples are shown for each command, and when using on the command line must be prefixed by:
 
  dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicleprofile
 
  dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicleprofile
Line 402: Line 424:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.vehicleprofile.get_attr string:"name"</pre>
+
|<source lang="bash">org.navit_project.navit.vehicleprofile.get_attr string:"name"</source>
 
returns:
 
returns:
<pre>
+
<source lang="bash">
 
   string "name"
 
   string "name"
 
   variant      string "car"
 
   variant      string "car"
</pre>
+
</source>
 
<hr>
 
<hr>
<pre>org.navit_project.navit.vehicleprofile.get_attr string:"static_speed"</pre>
+
<source lang="bash">org.navit_project.navit.vehicleprofile.get_attr string:"static_speed"</source>
 
returns:
 
returns:
<pre>
+
<source lang="bash">
 
   string "static_speed"
 
   string "static_speed"
 
   variant      int32 5
 
   variant      int32 5
</pre>
+
</source>
  
 
|}
 
|}
Line 435: Line 457:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.vehicleprofile.set_attr string:"name" variant:string:"bike"</pre>
+
|<source lang="bash">org.navit_project.navit.vehicleprofile.set_attr string:"name" variant:string:"bike"</source>
 
|-
 
|-
 
|}
 
|}
  
=org.navit_project.navit.vehicle:=
+
=org.navit_project.navit.vehicle=
  
==Methods:==
+
==Methods==
 
Examples are shown for each command, and when using on the command line must be prefixed by:
 
Examples are shown for each command, and when using on the command line must be prefixed by:
 
  dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicle
 
  dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicle
Line 461: Line 483:
 
|-
 
|-
 
|'''Example:'''
 
|'''Example:'''
|<pre>org.navit_project.navit.vehicle.set_attr string:"profilename" variant:string:"bike"</pre>
+
|<source lang="bash">org.navit_project.navit.vehicle.set_attr string:"profilename" variant:string:"bike"</source>
 +
|-
 +
|}
 +
 
 +
=org.navit_project.navit.route=
 +
 
 +
==Methods==
 +
Examples are shown for each command, and when using on the command line must be prefixed by:
 +
dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_route
 +
 
 +
===get_attr===
 +
{| style="border-style:solid;border-width:1px;border-color:#aaa;background: #FFFFFF;border-collapse: collapse;font-size: 95%;width:100%;" border="1" cellpadding="5"
 +
|-
 +
|width="20px"|'''Path:'''
 +
|.route
 +
|-
 +
|'''Arguments:'''
 +
|string:<tt>attribute</tt>
 +
|-
 +
|'''Return:'''
 +
|string:<tt>attribute</tt> variant:<tt>value</tt>
 +
|-
 +
|'''Description:'''
 +
|Gets the specified attribute value. The attribute can be anything from route_get_attr() in navit/route.c
 +
|-
 +
|'''Example:'''
 +
|<source lang="bash">org.navit_project.navit.route.get_attr string:"destination_length"</source>
 +
returns:
 +
<source lang="bash">
 +
  string "destination_length"
 +
  variant      int32 338111
 +
</source>
 
|-
 
|-
 
|}
 
|}
  
=Signals:=
+
=Signals=
  
===add bookmark signal:===
+
===add bookmark signal===
  
 
Setup the callback:
 
Setup the callback:
Line 484: Line 537:
 
The following code comes from /binding/dbus/binding_dbus.c
 
The following code comes from /binding/dbus/binding_dbus.c
  
<pre>
+
<source lang="bash">
 
{"",        "attr_iter",          "",        "",                                        "o",  "attr_iter",  request_config_attr_iter},
 
{"",        "attr_iter",          "",        "",                                        "o",  "attr_iter",  request_config_attr_iter},
 
{"",        "attr_iter_destroy",  "o",      "attr_iter",                              "",  "",      request_config_attr_iter_destroy},
 
{"",        "attr_iter_destroy",  "o",      "attr_iter",                              "",  "",      request_config_attr_iter_destroy},
Line 514: Line 567:
 
{".mapset", "get_attr_wi",        "so",      "attribute,attr_iter",                    "sv",  "attrname,value", request_mapset_get_attr},
 
{".mapset", "get_attr_wi",        "so",      "attribute,attr_iter",                    "sv",  "attrname,value", request_mapset_get_attr},
 
{".navigation","get_attr",        "s",      "attribute",                              "",  "",      request_navigation_get_attr},
 
{".navigation","get_attr",        "s",      "attribute",                              "",  "",      request_navigation_get_attr},
{".route",    "get_attr",          "s",      "attribute",                              "sv",  "attrname,value", request_route_get_attr},
 
 
{".route",    "set_attr",          "sv",      "attribute,value",                        "",    "",  request_route_set_attr},
 
{".route",    "set_attr",          "sv",      "attribute,value",                        "",    "",  request_route_set_attr},
 
{".route",    "add_attr",          "sv",      "attribute,value",                        "",    "",  request_route_add_attr},
 
{".route",    "add_attr",          "sv",      "attribute,value",                        "",    "",  request_route_add_attr},
Line 524: Line 576:
 
{".tracking","get_attr",          "s",      "attribute",                              "",  "",      request_tracking_get_attr},
 
{".tracking","get_attr",          "s",      "attribute",                              "",  "",      request_tracking_get_attr},
  
</pre>
+
</source>
  
 
[[category: navit dbus]]
 
[[category: navit dbus]]
 +
[[category: Development]]

Latest revision as of 18:19, 19 January 2017

The Navit dbus interface allows you to control certain aspects of Navit from outside the program. This document displays the requirements and implementation details of the Navit dbus interface.

Enabling[edit]

To be able to send and receive signals from Navit, you must enable it in navit.xml. Change line 13 to the following:

 <plugin path="$NAVIT_LIBDIR/*/${NAVIT_LIBPREFIX}libbinding_dbus.so" active="yes"/>

Common actions[edit]

Zoom in/out[edit]

Zoom to level 500:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_attr string:"zoom" variant:int32:500

Zoom in by factor of 2:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.zoom int32:2

Zoom out by factor of 2:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.zoom int32:-2

Set Position/Destination[edit]

Set position to longitude 24.0, latitude 65.0:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_position string:"geo: 24.0 65.0"

Set destination to longitude 24.0, latitude 65.0:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_destination string:"geo: 24.0 65.0" string:"comment"

Set map-view centre[edit]

Centre the map to longitude 24.0, latitude 65.0:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_center_by_string string:"geo: 24.0 65.0"

Change map layout[edit]

Change layout to "Car-dark":

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.set_layout string:"Car-dark"

Change vehicle profile[edit]

Change profile to "bike":

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicle org.navit_project.navit.vehicle.set_attr string:"profilename" variant:string:"bike"

Navit DBus details[edit]

DBUS Service: "org.navit_project.navit"
DBUS Bus: Session bus

org.navit_project.navit.navit[edit]

DBUS Object Path: /org/navit_project/navit/navit/[]


The way navit use dbus is not really the usual way. If you want to control your navit instance (set_destination, zoom,…), you have first to do the following (examples are in python) : 1) get the navit general object

 object = bus.get_object("org.navit_project.navit","/org/navit_project/navit")

2) get the interface of this object :

 iface = dbus.Interface(object,dbus_interface="org.navit_project.navit")

3) get an iterator through navit instances :

 iter=iface.attr_iter()

4) get the object path of the navit instance in your iterator :

 path = object.get_attr_wi("navit",iter)

5) get the navit instance you are interested in :

 navit=bus.get_object('org.navit_project.navit', path[1])

6) destroy the iter :

 iface.attr_iter_destroy(iter)

The following methods have to be applied on the navit object.

Methods[edit]

Examples are shown for each command, and when using on the command line must be prefixed by:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit

When a coordinate is specified, the coordinate can be formatted like:

[Proj:]-0xX [-]0xX

where Proj can be mg or garmin. Default: mg. For example:

mg: 0x138a4a 0x5d773f

Or

[Proj:][D][D]Dmm.ss[S][S] N/S [D][D]DMM.ss[S][S]... E/W
[Proj:][-][D]D.d[d]... [-][D][D]D.d[d]

where Proj must be geo. For example:

geo: 24.0 65.0

draw[edit]

Path: .navit
Arguments: none
Return: none
Description: Forces a redraw of the current view of the map
Example:
org.navit_project.navit.navit.draw


add_message[edit]

Path: .navit
Arguments: string: "message"
Return: none
Description: FIXME Adds a message to the messages label
Example:
org.navit_project.navit.navit.add_message string:"My Message"


set_center_by_string[edit]

Path: .navit
Arguments: string: coordinates
Return: none
Description: Centres the map over the specified position.
Example:
org.navit_project.navit.navit.set_center_by_string string:"geo: 24.0 65.0"


set_center[edit]

Path: .navit
Arguments: integer: projection string: coordinates

integer: projection integer: longitude integer: latitude

Return: none
Description: Centres the map over the specified position.
Example:
org.navit_project.navit.navit.set_center int32:1 string:"geo: 24.0 65.0"
org.navit_project.navit.navit.set_center int32:1 int32:0x138a4a int32:0x5d773f


set_center_screen[edit]

Path: .navit
Arguments: integer: pixel_x integer: pixel_y
Return: none
Description: Centers the map to a specific position on the screen.
Example:
org.navit_project.navit.navit.set_center_screen int32:200 int32:400


set_layout[edit]

Path: .navit
Arguments: string: layoutname
Return: none
Description: Changes the active map layout.
Example:
org.navit_project.navit.navit.set_layout string:"car-dark"


zoom[edit]

Path: .navit
Arguments: integer: factor (integer: pixel_x integer: pixel_y)
Return: none
Description: Zooms into the map (positive factor) or out of the map (negative factor) by the factor specified. The factor must be integers greater than 1 (zoom in) or less than -1 (zoom out). Optionally, a screen position can be specified in pixel_x and pixel_y and the function will zoom into that particular position. In order to zoom to a specific zoom-level, use the set_attr method.
Example:
org.navit_project.navit.navit.zoom int32:2
org.navit_project.navit.navit.zoom int32:6 int32:200 int32:400

block[edit]

Path: .navit
Arguments: integer: mode
Return: none
Description: FIXME
Example:
org.navit_project.navit.navit.block int32:1


set_position[edit]

Path: .navit
Arguments: string: coordinates
integer: projection string: coordinates

integer: projection integer: longitude integer: latitude

Return: none
Description: Sets the current position (useful if no gps position is available).
Example:
org.navit_project.navit.navit.set_position string:"geo: 24.0 65.0"
org.navit_project.navit.navit.set_position int32:1 string:"geo: 24.0 65.0"
org.navit_project.navit.navit.set_position int32:1 int32:0x138a4a int32:0x5d773f


set_destination[edit]

Path: .navit
Arguments: string: coordinates string:"comment"
integer: projection string: coordinates string:"comment"
integer: projection integer: longitude integer: latitude string:"comment"
Return: none
Description: Sets the destination for routing.
Example:
org.navit_project.navit.navit.set_destination string:"geo: 24.0 65.0"
org.navit_project.navit.navit.set_destination int32:1 string:"geo: 24.0 65.0"
org.navit_project.navit.navit.set_destination int32:1 int32:0x138a4a int32:0x5d773f


clear_destination[edit]

Path: .navit
Arguments: none
Return: none
Description: Removes the destination and stops routing.
Example:
org.navit_project.navit.navit.clear_destination


get_attr[edit]

Path: .navit
Arguments: string:attribute
Return: string:attribute variant:value
Description: Gets the specified attribute value. The attribute can be anything from attr_def.h.
Example:
org.navit_project.navit.navit.get_attr string:"zoom"

returns:

   string "zoom"
   variant       int32 10

org.navit_project.navit.navit.get_attr string:"orientation"

returns:

   string "orientation"
   variant       int32 1


set_attr[edit]

Path: .navit
Arguments: string:attribute variant:value
Return: none
Description: Sets the specified attribute value. The attribute can be anything from attr_def.h. As shown in the example below, this can be useful to zoom to a specific zoom level, insted of just zooming by a factor as with the zoom method.
Example:
org.navit_project.navit.navit.set_attr string:"zoom" variant:int32:500

export_as_gpx[edit]

Path: .navit
Arguments: string:filename
Return: none
Description: Dump the current route, if any, into the file specified in the argument in the GPX format.
Example:
org.navit_project.navit.navit.export_as_gpx string:"/tmp/route.gpx"

org.navit_project.navit.vehicleprofile[edit]

Methods[edit]

Examples are shown for each command, and when using on the command line must be prefixed by:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicleprofile

get_attr[edit]

Path: .vehicleprofile
Arguments: string:attribute
Return: string:attribute variant:value
Description: Gets the specified attribute value for the vehicleprofile.
Example:
org.navit_project.navit.vehicleprofile.get_attr string:"name"

returns:

   string "name"
   variant       string "car"

org.navit_project.navit.vehicleprofile.get_attr string:"static_speed"

returns:

   string "static_speed"
   variant       int32 5


set_attr[edit]

Path: .vehicleprofile
Arguments: string:attribute variant:value
Return: none
Description: Sets the specified attribute value. The example below renames the current vehicleprofile. To actually change the vehicleprofile, use the set_attr method in the .vehicle path (see below).
Example:
org.navit_project.navit.vehicleprofile.set_attr string:"name" variant:string:"bike"

org.navit_project.navit.vehicle[edit]

Methods[edit]

Examples are shown for each command, and when using on the command line must be prefixed by:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_vehicle

set_attr[edit]

Path: .vehicle
Arguments: string:attribute variant:value
Return: none
Description: Sets the specified attribute value. The example below changes the current vehicleprofile to "bike" .
Example:
org.navit_project.navit.vehicle.set_attr string:"profilename" variant:string:"bike"

org.navit_project.navit.route[edit]

Methods[edit]

Examples are shown for each command, and when using on the command line must be prefixed by:

dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit/default_route

get_attr[edit]

Path: .route
Arguments: string:attribute
Return: string:attribute variant:value
Description: Gets the specified attribute value. The attribute can be anything from route_get_attr() in navit/route.c
Example:
org.navit_project.navit.route.get_attr string:"destination_length"

returns:

  string "destination_length"
  variant       int32 338111

Signals[edit]

add bookmark signal[edit]

Setup the callback:

 dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit org.navit_project.navit.callback_attr_new string:my_signal string:bookmark_map 
 object path "/org/navit_project/navit/callback/0"
 dbus-send  --print-reply --session --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.add_attr string:callback 
 variant:objpath:/org/navit_project/navit/callback/0

Replace "my_signal" with a signal name of your choice.

Now add a bookmark and you should see this in dbus-monitor --session:

 signal sender=:1.927 -> dest=(null destination) path=/org/navit_project/navit; interface=org.navit_project.navit; member=my_signal

Undocumented methods[edit]

The following code comes from /binding/dbus/binding_dbus.c

	{"",        "attr_iter",           "",        "",                                        "o",  "attr_iter",  request_config_attr_iter},
	{"",        "attr_iter_destroy",   "o",       "attr_iter",                               "",   "",      request_config_attr_iter_destroy},
	{"",        "get_attr",            "s",       "attrname",                                "sv", "attrname,value",request_config_get_attr},
	{"",        "get_attr_wi",         "so",      "attrname,attr_iter",                      "sv", "attrname,value",request_config_get_attr},
	{"",	    "callback_new",	   "s",       "signalname",                              "o",  "callback",request_callback_new},
	{"",	    "callback_attr_new",   "ss",       "signalname,attribute",                   "o",  "callback",request_callback_new},
	{"",	    "search_list_new",	   "o",       "mapset",                                  "o",  "search",request_search_list_new},
	{".callback","destroy",            "",        "",                                        "",   "",      request_callback_destroy},
	{".graphics","get_data", 	   "s",	      "type",				 	 "ay",  "data", request_graphics_get_data},
	{".graphics","set_attr",           "sv",      "attribute,value",                         "",   "",      request_graphics_set_attr},
	{".gui",     "get_attr",           "s",       "attribute",                               "sv",  "attrname,value", request_gui_get_attr},
	{".gui",     "command_parameter",  "sa{sa{sv}}","command,parameter",                     "a{sa{sv}}",  "return", request_gui_command},
	{".gui",     "command",            "s",       "command",                                 "a{sa{sv}}",  "return", request_gui_command},
 
	{".navit",  "resize",              "ii",      "upperleft,lowerright",                    "",   "",      request_navit_resize},
	{".navit",  "attr_iter",           "",        "",                                        "o",  "attr_iter",  request_navit_attr_iter},
	{".navit",  "attr_iter_destroy",   "o",       "attr_iter",                               "",   "",      request_navit_attr_iter_destroy},
	{".navit",  "get_attr_wi",         "so",      "attribute,attr_iter",                     "sv",  "attrname,value", request_navit_get_attr},
	{".navit",  "add_attr",            "sv",      "attribute,value",                         "",   "",      request_navit_add_attr},
	{".navit",  "remove_attr",         "sv",      "attribute,value",                         "",   "",      request_navit_remove_attr},
	{".navit",  "evaluate", 	   "s",	      "command",				 "s",  "",      request_navit_evaluate},
 
	{".map",    "get_attr",            "s",       "attribute",                               "sv",  "attrname,value", request_map_get_attr},
	{".map",    "set_attr",            "sv",      "attribute,value",                         "",   "",      request_map_set_attr},
	{".mapset", "attr_iter",           "",        "",                                        "o",  "attr_iter",  request_mapset_attr_iter},
	{".mapset", "attr_iter_destroy",   "o",       "attr_iter",                               "",   "",      request_mapset_attr_iter_destroy},
	{".mapset", "get_attr",            "s",       "attribute",                               "sv",  "attrname,value", request_mapset_get_attr},
	{".mapset", "get_attr_wi",         "so",      "attribute,attr_iter",                     "sv",  "attrname,value", request_mapset_get_attr},
	{".navigation","get_attr",         "s",       "attribute",                               "",   "",      request_navigation_get_attr},
	{".route",    "set_attr",          "sv",      "attribute,value",                         "",    "",  request_route_set_attr},
	{".route",    "add_attr",          "sv",      "attribute,value",                         "",    "",  request_route_add_attr},
	{".route",    "remove_attr",       "sv",      "attribute,value",                         "",    "",  request_route_remove_attr},
	{".search_list","destroy",         "",        "",                                        "",   "",      request_search_list_destroy},
	{".search_list","get_result",      "",        "",                                        "i(iii)a{sa{sv}}",   "id,coord,dict",      request_search_list_get_result},
	{".search_list","search",          "svi",     "attribute,value,partial",                 "",   "",      request_search_list_search},
	{".search_list","select",          "sii",     "attribute_type,id,mode",                  "",   "",      request_search_list_select},
	{".tracking","get_attr",           "s",       "attribute",                               "",   "",      request_tracking_get_attr},