2011-04-13 04:35:46 +03:00
|
|
|
/*
|
|
|
|
* atrf-path/sweep.h - Measure path characteristics
|
|
|
|
*
|
|
|
|
* Written 2011 by Werner Almesberger
|
|
|
|
* Copyright 2011 Werner Almesberger
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef SWEEP_H
|
|
|
|
#define SWEEP_H
|
|
|
|
|
2011-04-13 20:01:12 +03:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2011-04-13 04:35:46 +03:00
|
|
|
#include "atrf.h"
|
|
|
|
|
|
|
|
|
atrf-path: option -P to load a min/max profile; pass/fail indication in GUI
- sweep.h (MIN_DIFF, MAX_DIFF, struct sweep): added min/max profile
- sweep.h (do_sweep), atrf-path.c (do_half_sweep, do_sweep): compare
result against limits and return pass/fail decision
- sweep.h (N_CHAN), atrf-path.c (do_half_sweep, do_sweeps), gui.c
(N_CHAN): declare number of channels in one central place instead of
scattering it all around the program
- atrf-path.c (do_read_profile, read_profile, usage, main): new option -P
to read a min/max profile
- gui.c (indicate, main): moved indicator to separate function and
improved blink logic
- gui.c (OVER_RGBA, UNDER_RGBA, indicate, main): change color to indicate
pass/fail
2011-04-14 00:40:39 +03:00
|
|
|
#define N_CHAN 16
|
|
|
|
|
|
|
|
#define MIN_DIFF -97.0 /* RSSI(min)-TX(max) = -94 - 3 */
|
|
|
|
#define MAX_DIFF 7.0 /* RSSI(max)-TX(min) = -10 - (-17) */
|
|
|
|
|
|
|
|
|
2011-04-13 04:35:46 +03:00
|
|
|
struct sweep {
|
|
|
|
struct atrf_dsc *tx;
|
|
|
|
struct atrf_dsc *rx;
|
|
|
|
int trim_tx;
|
|
|
|
int trim_rx;
|
|
|
|
int power;
|
2011-04-13 20:01:12 +03:00
|
|
|
uint8_t cont_tx;
|
2011-04-13 04:35:46 +03:00
|
|
|
int samples;
|
atrf-path: option -P to load a min/max profile; pass/fail indication in GUI
- sweep.h (MIN_DIFF, MAX_DIFF, struct sweep): added min/max profile
- sweep.h (do_sweep), atrf-path.c (do_half_sweep, do_sweep): compare
result against limits and return pass/fail decision
- sweep.h (N_CHAN), atrf-path.c (do_half_sweep, do_sweeps), gui.c
(N_CHAN): declare number of channels in one central place instead of
scattering it all around the program
- atrf-path.c (do_read_profile, read_profile, usage, main): new option -P
to read a min/max profile
- gui.c (indicate, main): moved indicator to separate function and
improved blink logic
- gui.c (OVER_RGBA, UNDER_RGBA, indicate, main): change color to indicate
pass/fail
2011-04-14 00:40:39 +03:00
|
|
|
double min[N_CHAN];
|
|
|
|
double max[N_CHAN];
|
2011-04-13 04:35:46 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sample {
|
|
|
|
double avg;
|
|
|
|
double min, max;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
atrf-path: option -P to load a min/max profile; pass/fail indication in GUI
- sweep.h (MIN_DIFF, MAX_DIFF, struct sweep): added min/max profile
- sweep.h (do_sweep), atrf-path.c (do_half_sweep, do_sweep): compare
result against limits and return pass/fail decision
- sweep.h (N_CHAN), atrf-path.c (do_half_sweep, do_sweeps), gui.c
(N_CHAN): declare number of channels in one central place instead of
scattering it all around the program
- atrf-path.c (do_read_profile, read_profile, usage, main): new option -P
to read a min/max profile
- gui.c (indicate, main): moved indicator to separate function and
improved blink logic
- gui.c (OVER_RGBA, UNDER_RGBA, indicate, main): change color to indicate
pass/fail
2011-04-14 00:40:39 +03:00
|
|
|
/*
|
|
|
|
* do_sweep returns whether the signal is within the limits:
|
|
|
|
*
|
|
|
|
* 1: at least one sample is above the maximum
|
|
|
|
* 0: all samples are between minimum and maximum
|
|
|
|
* -1: at least one sample below the minimum, and none above the maximum
|
|
|
|
*/
|
|
|
|
|
|
|
|
int do_sweep(const struct sweep *sweep, struct sample *res);
|
2011-04-13 04:35:46 +03:00
|
|
|
|
2011-05-28 18:03:23 +03:00
|
|
|
void print_sweep(const struct sweep *sweep, const struct sample *res);
|
|
|
|
|
2011-04-13 04:35:46 +03:00
|
|
|
#endif /* !SWEEP_H */
|