diff options
author | Teemu Ikonen <tpikonen@mailbox.org> | 2023-03-17 17:58:08 +0200 |
---|---|---|
committer | Teemu Ikonen <tpikonen@mailbox.org> | 2023-04-29 17:50:15 +0000 |
commit | 41221a1d47584e23a797540f5db1775afc28e438 (patch) | |
tree | 1db3afa1193d8657ecf7bce49b961ab641c48ae5 | |
parent | 9a2cc9c3cb3d634d6da7e31a7207eb9a35081602 (diff) | |
download | geoclue-41221a1d47584e23a797540f5db1775afc28e438.tar.gz |
mozilla: Add 'age' field to MLS locate queries
-rw-r--r-- | src/gclue-mozilla.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gclue-mozilla.c b/src/gclue-mozilla.c index 2f25a71..f6391af 100644 --- a/src/gclue-mozilla.c +++ b/src/gclue-mozilla.c @@ -255,11 +255,13 @@ gclue_mozilla_create_query (GClueMozilla *mozilla, WPABSS *bss = WPA_BSS (iter->data); char mac[BSSID_STR_LEN + 1] = { 0 }; gint16 strength_dbm; + guint age_ms; if (gclue_mozilla_should_ignore_bss (bss)) continue; json_builder_begin_object (builder); + json_builder_set_member_name (builder, "macAddress"); get_bssid_from_bss (bss, mac); json_builder_add_string_value (builder, mac); @@ -267,8 +269,12 @@ gclue_mozilla_create_query (GClueMozilla *mozilla, json_builder_set_member_name (builder, "signalStrength"); strength_dbm = wpa_bss_get_signal (bss); json_builder_add_int_value (builder, strength_dbm); - json_builder_end_object (builder); + json_builder_set_member_name (builder, "age"); + age_ms = 1000 * wpa_bss_get_age (bss); + json_builder_add_int_value (builder, age_ms); + + json_builder_end_object (builder); has_bss = TRUE; } json_builder_end_array (builder); |