Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit ca46098

Browse files
committed
added flag accessors
1 parent eff3d24 commit ca46098

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

include/libswiftnav/dgnss_management.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ void dgnss_reset_iar(void);
6363
void dgnss_init_known_baseline(u8 num_sats, sdiff_t *sdiffs, double receiver_ecef[3], double b[3]);
6464
void dgnss_update_ambiguity_state(ambiguity_state_t *s);
6565
u8 baseline_flag(s8 ret, bool fixed);
66+
u8 flag_raim_repaired(u8 flag);
67+
u8 flag_raim_available(u8 flag);
68+
u8 flag_fixed_mode(u8 flag);
6669
s8 dgnss_baseline(u8 num_sdiffs, const sdiff_t *sdiffs,
6770
const double ref_ecef[3], const ambiguity_state_t *s,
6871
u8 *num_used, double b[3],

src/dgnss_management.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,21 @@ u8 baseline_flag(s8 ret, bool fixed)
412412
| fixed; /* Fixed mode? */
413413
}
414414

415+
u8 flag_raim_repaired(u8 flag)
416+
{
417+
return flag & (1 << 4);
418+
}
419+
420+
u8 flag_raim_available(u8 flag)
421+
{
422+
return flag & (1 << 3);
423+
}
424+
425+
u8 flag_fixed_mode(u8 flag)
426+
{
427+
return flag & 1;
428+
}
429+
415430
/** Finds the baseline using low latency sdiffs.
416431
* The low latency sdiffs are not guaranteed to match up with either the
417432
* amb_test's or the float sdiffs, and thus care must be taken to transform them

src/pvt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,12 @@ s8 calc_PVT(const u8 n_used,
546546

547547
soln->raim_flag = 0;
548548

549-
/* Initial solution failed, but repair was successful. */
550549
if (code == 1) {
550+
/* Initial solution failed, but repair was successful. */
551551
soln->n_used--;
552552
soln->raim_flag = (1 << 1) | 1; /* 11 */
553553
} else if (code == 2) {
554+
/* raim was unavailable */
554555
soln->raim_flag = 0; /* 00 */
555556
} else if (code == 0) {
556557
soln->raim_flag = 1; /* 01 */

0 commit comments

Comments
 (0)