1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

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
This commit is contained in:
Werner Almesberger
2011-04-13 18:40:39 -03:00
parent a7d9dfd258
commit a1fc867bf2
3 changed files with 167 additions and 26 deletions

View File

@@ -19,6 +19,12 @@
#include "atrf.h"
#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) */
struct sweep {
struct atrf_dsc *tx;
struct atrf_dsc *rx;
@@ -27,6 +33,8 @@ struct sweep {
int power;
uint8_t cont_tx;
int samples;
double min[N_CHAN];
double max[N_CHAN];
};
struct sample {
@@ -35,6 +43,14 @@ struct sample {
};
void do_sweep(const struct sweep *sweep, struct sample *res);
/*
* 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);
#endif /* !SWEEP_H */