4.3.1. Dbus
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.
4.3.2. Enabling
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"/>
4.3.3. Common actions
4.3.3.1. Zoom in/out
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
4.3.3.2. Set Position/Destination
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"
4.3.3.3. Set map-view centre
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"
4.3.3.4. Change map layout
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"
4.3.3.5. Change vehicle profile
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"
4.3.9. Signals
4.3.9.1. add bookmark signal
Setup the callback:
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``
4.3.10. Undocumented methods
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},