Merge lp:~thomas-voss/location-service/adjust-documentation into lp:location-service

Proposed by Thomas Voß
Status: Merged
Approved by: Thomas Voß
Approved revision: 313
Merged at revision: 312
Proposed branch: lp:~thomas-voss/location-service/adjust-documentation
Merge into: lp:location-service
Diff against target: 112 lines (+83/-2)
1 file modified
doc/cli.md (+83/-2)
To merge this branch: bzr merge lp:~thomas-voss/location-service/adjust-documentation
Reviewer Review Type Date Requested Status
Simon Fels (community) Approve
Thomas Voß Pending
Review via email: mp+324034@code.launchpad.net

Commit message

Adjust documentation.

Description of the change

Adjust documentation.

To post a comment you must log in.
Revision history for this message
Simon Fels (morphis) wrote :

Minor comments inline.

review: Needs Fixing
312. By Thomas Voß

Add examples.

313. By Thomas Voß

Add example invocation for standalone tests.

Revision history for this message
Thomas Voß (thomas-voss) :
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/cli.md'
2--- doc/cli.md 2017-01-30 09:08:21 +0000
3+++ doc/cli.md 2017-05-16 06:49:43 +0000
4@@ -4,16 +4,18 @@
5 and monitoring the service. The following commands are available:
6
7 - `list`: Lists all provider implementations known to the service.
8- - `monitor`: Connects to a locationd instance, monitoring its activity.
9+ - `monitor`: Connects to a locationd instance, monitoring its activity. Supports KML or tabular data output of position/heading/velocity data.
10 - `provider`: Executes a known provider implementation in an out-of-process sandbox.
11 - `run`: Executes the service.
12+ - `set`: Persist the given key/value pair.
13 - `status`: Queries the status of a service instance.
14- - `test`: Executes runtime tests against known provider implementations.
15+ - `test`: Executes standalone runtime tests against individual provider implementations.
16
17 For all of the commands, an exit status of 0 indicates success. An exit status of 1 indicates
18 an error. Normal output goes to stdout, while all errors/warnings are output to stderr.
19
20 ## Snap-Specific Command Names
21+
22 If you are using the cli from a snap (`snap install locationd --channel edge`), the commands will
23 be wrapped up for you in a convenient way, following the pattern locationd.$COMMAND. With that, if
24 you want to check on the status of the service, simply run:
25@@ -21,8 +23,87 @@
26 $ locationd.status
27 ~~~
28
29+## Hotplug Support
30+
31+locationd itself does not interface with udev directly but instead delegates to the host
32+system's udev setup and the user/administrator to define reasonable udev rules.
33+
34 ## Testing Scenarios
35+
36 For testing purposes, it is often handy to inspect position/velocity/heading estimates on the command line.
37 The `monitor` command helps here. It connects to the service, starts the positioning engine and outputs
38 position estimates to stdout until it receives a SIGTERM.
39
40+~~~bash
41+$ locationd.monitor
42+I0516 08:36:56.752629 8124 monitor.cpp:226] Enabled position/heading/velocity updates...
43+51.44483 7.21064 13.27 n/a n/a n/a n/a
44+51.44483 7.21064 13.26 n/a n/a n/a n/a
45+51.44483 7.21069 16.36 n/a n/a n/a n/a
46+51.44483 7.21069 16.36 n/a n/a n/a n/a
47+51.44483 7.21068 15.94 n/a n/a n/a n/a
48+51.44483 7.21064 12.66 n/a n/a n/a n/a
49+51.44484 7.21063 12.26 n/a n/a n/a n/a
50+51.44484 7.21063 12.26 n/a n/a n/a n/a
51+51.44485 7.21059 10.00 n/a n/a n/a n/a
52+51.44485 7.21059 10.00 n/a n/a n/a n/a
53+51.44485 7.21058 10.08 n/a n/a n/a n/a
54+51.44485 7.21058 10.08 n/a n/a n/a n/a
55+51.44485 7.21059 10.00 n/a n/a n/a n/a
56+51.44485 7.21059 10.00 n/a n/a n/a n/a
57+51.44485 7.21059 10.00 n/a n/a n/a n/a
58+51.44485 7.21059 10.00 n/a n/a n/a n/a
59+~~~
60+
61+## Standalone Runtime Tests
62+
63+Sometimes it is convenient to be able to test specific provider
64+implementations in isolation, i.e., without the respective provider
65+running in the context of locationd. To this end, the `test` command
66+is available. Right now, two test suites `sirf` and `ubx` are
67+available. Please make sure that the underlying serial devices are not
68+in use by any other process before executing the test suite.
69+The behavior of the test-suites can be adjusted by the following environment variables:
70+
71+ * `ubx`:
72+ * `UBX_PROVIDER_TEST_DEVICE`: Mandatory, path to the serial device connecting to the uBlox receiver.
73+ * `UBX_PROVIDER_TEST_TRIALS`: Defaults to 15, number of independent positioning attempts from cold start.
74+ * `UBX_PROVIDER_TEST_ASSIST_NOW_ENABLE`: Defaults to `false`, toggles usage of uBlox AssistNow Online for assisted GNSS.
75+ * `UBX_PROVIDER_TEST_ASSIST_NOW_TOKEN`: Defaults to the empty string, token used to verify access to the uBlox AssistNow services.
76+ * `UBX_PROVIDER_TEST_ASSIST_NOW_ACQUISITION_TIMEOUT`: Defaults to `5` seconds, the provider waits this long for an initial fix before reaching out for assistance data.
77+ * `sirf`:
78+ * `SIRF_PROVIDER_TEST_DEVICE`: Mandatory, path to the serial device connecting to the SiRF receiver.
79+ * `SIRF_PROVIDER_TEST_TRIALS`: Defaults to 15, number of independent positioning attempts from cold start.
80+
81+An example invocation for testing the uBlox provider would look like:
82+
83+~~~bash
84+$ sudo UBX_PROVIDER_TEST_DEVICE=/dev/ttyACM1 UBX_PROVIDER_TEST_TRIALS=50 locationd.test --test-suite=ubx
85+~~~
86+
87+## Verbose Logging
88+
89+locationd and all of its commands can be switched to verbose mode by
90+setting the environment variable `GLOG_v` to `1`, e.g.:
91+
92+~~~bash
93+$ sudo GLOG_v=1 locationd.provide --id=mls::Provider
94+I0516 08:40:15.010741 8200 service.cpp:190] static void location::dbus::stub::Service::on_bus_acquired(GObject*, GAsyncResult*, gpointer)
95+I0516 08:40:15.015348 8200 service.cpp:221] static void location::dbus::stub::Service::on_name_appeared_for_creation(GDBusConnection*, const gchar*, const gchar*, gpointer)
96+I0516 08:40:15.022554 8200 service.cpp:165] static void location::dbus::stub::Service::on_proxy_ready(GObject*, GAsyncResult*, gpointer)
97+I0516 08:40:15.029153 8200 w11t_manager.cpp:452] static void location::connectivity::w11t::Supplicant::on_bus_ready(GObject*, GAsyncResult*, gpointer)
98+I0516 08:40:15.033778 8200 service.cpp:244] static void location::dbus::stub::Service::on_provider_added(GObject*, GAsyncResult*, gpointer)
99+I0516 08:40:15.034494 8200 w11t_manager.cpp:477] static void location::connectivity::w11t::Supplicant::on_proxy_ready(GObject*, GAsyncResult*, gpointer)
100+I0516 08:40:15.036355 8200 w11t_manager.cpp:285] static void location::connectivity::w11t::Interface::on_proxy_ready(GObject*, GAsyncResult*, gpointer)
101+I0516 08:40:21.915056 8200 provider.cpp:467] static bool location::providers::remote::Provider::Skeleton::handle_activate(ComUbuntuLocationServiceProvider*, GDBusMethodInvocation*, gpointer)
102+I0516 08:40:26.832139 8200 w11t_manager.cpp:310] static void location::connectivity::w11t::Interface::handle_scan_done(FiW1Wpasupplicant1WirelessInterface*, gboolean, gpointer)
103+I0516 08:40:26.832207 8200 provider.cpp:91] Wireless network scan finished.
104+I0516 08:40:33.293536 8200 w11t_manager.cpp:325] static void location::connectivity::w11t::Interface::handle_bss_added(FiW1Wpasupplicant1WirelessInterface*, const char*, GVariant*, gpointer)
105+I0516 08:40:33.294180 8200 w11t_manager.cpp:310] static void location::connectivity::w11t::Interface::handle_scan_done(FiW1Wpasupplicant1WirelessInterface*, gboolean, gpointer)
106+I0516 08:40:33.294219 8200 provider.cpp:91] Wireless network scan finished.
107+I0516 08:40:33.297814 8200 w11t_manager.cpp:98] static void location::connectivity::w11t::BSS::on_proxy_ready(GObject*, GAsyncResult*, gpointer)
108+I0516 08:40:43.278961 8200 w11t_manager.cpp:354] static void location::connectivity::w11t::Interface::handle_bss_removed(FiW1Wpasupplicant1WirelessInterface*, const char*, gpointer)
109+I0516 08:40:43.279033 8200 w11t_manager.cpp:310] static void location::connectivity::w11t::Interface::handle_scan_done(FiW1Wpasupplicant1WirelessInterface*, gboolean, gpointer)
110+I0516 08:40:43.279059 8200 provider.cpp:91] Wireless network scan finished.
111+I0516 08:40:43.284925 8200 w11t_manager.cpp:169] static void location::connectivity::w11t::BSS::on_age_changed(GObject*, GParamSpec*, gpointer)
112+~~~

Subscribers

People subscribed via source and target branches

to all changes: