Untested revision of schema as of 11:50 AM
This commit is contained in:
parent
58c62ed07d
commit
ff7c6fa0ad
1 changed files with 16 additions and 15 deletions
|
|
@ -5,6 +5,7 @@
|
|||
-- sqlite3 ble_fieldtest_YYYYMMDD_HHMM.sqlite < create_exercise_26_ble_schema.sql
|
||||
--
|
||||
-- SQLite schema for Exercise 26 BLE Discovery field-test logs.
|
||||
-- 20260527_1156: aligned derived delta column name with importer: rx_tx_delta_ms.
|
||||
--
|
||||
-- This schema targets the current 19-column Exercise 26 log format only.
|
||||
--
|
||||
|
|
@ -27,7 +28,7 @@
|
|||
-- advertising payload was generated/configured. It is not a per-RF-packet
|
||||
-- transmit timestamp.
|
||||
--
|
||||
-- rx_tx_payload_delta_ms is diagnostic only. It is useful for clock,
|
||||
-- rx_tx_delta_ms is diagnostic only. It is useful for clock,
|
||||
-- scheduling, payload-age, and repeated-observation analysis. It is not
|
||||
-- BLE propagation delay.
|
||||
--
|
||||
|
|
@ -197,7 +198,7 @@ ON ble_observation_raw(clock_valid, gps_valid, gps_fix_age_ms);
|
|||
--
|
||||
-- Parsed and normalized BLE observation table.
|
||||
--
|
||||
-- rx_tx_payload_delta_ms is the receiver row timestamp minus the sender
|
||||
-- rx_tx_delta_ms is the receiver row timestamp minus the sender
|
||||
-- payload-generation timestamp. It is diagnostic only.
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -217,7 +218,7 @@ CREATE TABLE IF NOT EXISTS ble_observation (
|
|||
tx_payload_epoch_ms INTEGER,
|
||||
tx_payload_epoch_s REAL,
|
||||
|
||||
rx_tx_payload_delta_ms INTEGER,
|
||||
rx_tx_delta_ms INTEGER,
|
||||
|
||||
receiver TEXT NOT NULL REFERENCES unit(unit_name),
|
||||
heard TEXT NOT NULL REFERENCES unit(unit_name),
|
||||
|
|
@ -269,7 +270,7 @@ CREATE INDEX IF NOT EXISTS idx_obs_validity
|
|||
ON ble_observation(clock_valid, gps_valid, gps_fix_age_ms);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_obs_payload_time
|
||||
ON ble_observation(tx_payload_epoch_ms, rx_tx_payload_delta_ms);
|
||||
ON ble_observation(tx_payload_epoch_ms, rx_tx_delta_ms);
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- v_log_file_summary
|
||||
|
|
@ -378,7 +379,7 @@ GROUP BY trial_id, receiver, heard;
|
|||
--
|
||||
-- Per receiver/heard timing-delta summary.
|
||||
--
|
||||
-- rx_tx_payload_delta_ms is useful for detecting clock disagreement,
|
||||
-- rx_tx_delta_ms is useful for detecting clock disagreement,
|
||||
-- scheduling, repeated payload observations, and payload-age behavior.
|
||||
-- It is not RF propagation delay.
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
|
@ -391,9 +392,9 @@ SELECT
|
|||
|
||||
COUNT(*) AS observation_count,
|
||||
|
||||
MIN(rx_tx_payload_delta_ms) AS min_rx_tx_payload_delta_ms,
|
||||
AVG(rx_tx_payload_delta_ms) AS avg_rx_tx_payload_delta_ms,
|
||||
MAX(rx_tx_payload_delta_ms) AS max_rx_tx_payload_delta_ms
|
||||
MIN(rx_tx_delta_ms) AS min_rx_tx_delta_ms,
|
||||
AVG(rx_tx_delta_ms) AS avg_rx_tx_delta_ms,
|
||||
MAX(rx_tx_delta_ms) AS max_rx_tx_delta_ms
|
||||
FROM ble_observation
|
||||
WHERE tx_payload_epoch_ms IS NOT NULL
|
||||
AND tx_payload_epoch_ms > 0
|
||||
|
|
@ -410,9 +411,9 @@ SELECT
|
|||
heard,
|
||||
payload_seq,
|
||||
COUNT(*) AS observations,
|
||||
MIN(rx_tx_payload_delta_ms) AS min_delta_ms,
|
||||
AVG(rx_tx_payload_delta_ms) AS avg_delta_ms,
|
||||
MAX(rx_tx_payload_delta_ms) AS max_delta_ms,
|
||||
MIN(rx_tx_delta_ms) AS min_delta_ms,
|
||||
AVG(rx_tx_delta_ms) AS avg_delta_ms,
|
||||
MAX(rx_tx_delta_ms) AS max_delta_ms,
|
||||
MIN(rx_epoch_ms) AS first_rx_epoch_ms,
|
||||
MAX(rx_epoch_ms) AS last_rx_epoch_ms
|
||||
FROM ble_observation
|
||||
|
|
@ -454,9 +455,9 @@ SELECT
|
|||
MIN(rx_epoch_ms) AS first_rx_epoch_ms,
|
||||
MAX(rx_epoch_ms) AS last_rx_epoch_ms,
|
||||
MAX(rx_epoch_ms) - MIN(rx_epoch_ms) AS rx_spread_ms,
|
||||
MIN(rx_tx_payload_delta_ms) AS min_delta_ms,
|
||||
AVG(rx_tx_payload_delta_ms) AS avg_delta_ms,
|
||||
MAX(rx_tx_payload_delta_ms) AS max_delta_ms
|
||||
MIN(rx_tx_delta_ms) AS min_delta_ms,
|
||||
AVG(rx_tx_delta_ms) AS avg_delta_ms,
|
||||
MAX(rx_tx_delta_ms) AS max_delta_ms
|
||||
FROM ble_observation
|
||||
WHERE tx_payload_epoch_ms IS NOT NULL
|
||||
AND tx_payload_epoch_ms > 0
|
||||
|
|
@ -525,7 +526,7 @@ SELECT
|
|||
avg_rssi,
|
||||
payload_seq,
|
||||
tx_payload_epoch_ms,
|
||||
rx_tx_payload_delta_ms
|
||||
rx_tx_delta_ms
|
||||
FROM ble_observation
|
||||
WHERE rx_lat IS NOT NULL
|
||||
AND rx_lon IS NOT NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue