With the switch to the skytraq GPS unit, we don't have the same level
of detail in the GPS stream, so stop reporting that in the telemetry
stream, in the UI and writing it to eeprom.
Signed-off-by: Keith Packard <keithp@keithp.com>
nsat = 0;
for (k = 0; k < f->gps.sats[j].nsat; k++) {
fprintf (gps_file, " %12.7f", (double) f->gps.sats[j].sat[k].c_n);
nsat = 0;
for (k = 0; k < f->gps.sats[j].nsat; k++) {
fprintf (gps_file, " %12.7f", (double) f->gps.sats[j].sat[k].c_n);
- if (f->gps.sats[j].sat[k].state == 0xbf)
+ if (f->gps.sats[j].sat[k].svid != 0)
nsat++;
}
fprintf(gps_file, " %d\n", nsat);
nsat++;
}
fprintf(gps_file, " %d\n", nsat);
}
nsat = 0;
for (k = 0; k < f->gps.sats[j].nsat; k++)
}
nsat = 0;
for (k = 0; k < f->gps.sats[j].nsat; k++)
- if (f->gps.sats[j].sat[k].state == 0xbf)
+ if (f->gps.sats[j].sat[k].svid != 0)
nsat++;
fprintf(kml_file, "%12.7f, %12.7f, %12.7f <!-- time %12.7f sats %d -->",
nsat++;
fprintf(kml_file, "%12.7f, %12.7f, %12.7f <!-- time %12.7f sats %d -->",
case AO_LOG_GPS_SAT:
sat.time = tick;
sat.svid = a;
case AO_LOG_GPS_SAT:
sat.time = tick;
sat.svid = a;
- sat.state = (b & 0xff);
sat.c_n = (b >> 8) & 0xff;
gpssat_add(&f->gps, &sat);
break;
sat.c_n = (b >> 8) & 0xff;
gpssat_add(&f->gps, &sat);
break;
}
if (tracking_pos >= 0 && nword >= tracking_pos + 2 && strcmp(words[tracking_pos], "SAT") == 0) {
int c, n, pos;
}
if (tracking_pos >= 0 && nword >= tracking_pos + 2 && strcmp(words[tracking_pos], "SAT") == 0) {
int c, n, pos;
+ int per_sat;
+ int state;
+
+ if (version >= 2)
+ per_sat = 2;
+ else
+ per_sat = 3;
cc_parse_int(&n, words[tracking_pos + 1]);
pos = tracking_pos + 2;
cc_parse_int(&n, words[tracking_pos + 1]);
pos = tracking_pos + 2;
- if (nword >= pos + n * 3) {
+ if (nword >= pos + n * per_sat) {
telem->gps_tracking.channels = n;
for (c = 0; c < n; c++) {
cc_parse_int(&telem->gps_tracking.sats[c].svid,
words[pos + 0]);
telem->gps_tracking.channels = n;
for (c = 0; c < n; c++) {
cc_parse_int(&telem->gps_tracking.sats[c].svid,
words[pos + 0]);
- cc_parse_hex(&telem->gps_tracking.sats[c].state,
- words[pos + 1]);
+ if (version < 2)
+ cc_parse_hex(&state, words[pos + 1]);
cc_parse_int(&telem->gps_tracking.sats[c].c_n0,
cc_parse_int(&telem->gps_tracking.sats[c].c_n0,
- words[pos + 2]);
- pos += 3;
+ words[pos + per_sat - 1]);
+ pos += per_sat;
}
} else {
telem->gps_tracking.channels = 0;
}
} else {
telem->gps_tracking.channels = 0;
struct cc_gpssat {
double time;
uint16_t svid;
struct cc_gpssat {
double time;
uint16_t svid;
} gps_altitude;
struct {
uint16_t svid;
} gps_altitude;
struct {
uint16_t svid;
uint8_t c_n;
} gps_sat;
struct {
uint8_t c_n;
} gps_sat;
struct {
uint16_t v_error; /* m */
};
uint16_t v_error; /* m */
};
-#define SIRF_SAT_STATE_ACQUIRED (1 << 0)
-#define SIRF_SAT_STATE_CARRIER_PHASE_VALID (1 << 1)
-#define SIRF_SAT_BIT_SYNC_COMPLETE (1 << 2)
-#define SIRF_SAT_SUBFRAME_SYNC_COMPLETE (1 << 3)
-#define SIRF_SAT_CARRIER_PULLIN_COMPLETE (1 << 4)
-#define SIRF_SAT_CODE_LOCKED (1 << 5)
-#define SIRF_SAT_ACQUISITION_FAILED (1 << 6)
-#define SIRF_SAT_EPHEMERIS_AVAILABLE (1 << 7)
-
struct ao_gps_sat_data {
uint8_t svid;
struct ao_gps_sat_data {
uint8_t svid;
sat = gps_tracking_data->sats;
v = 0;
for (c = 0; c < n; c++) {
sat = gps_tracking_data->sats;
v = 0;
for (c = 0; c < n; c++) {
- if (sat->svid && sat->state)
v++;
sat++;
}
printf("%d ", v);
sat = gps_tracking_data->sats;
for (c = 0; c < n; c++) {
v++;
sat++;
}
printf("%d ", v);
sat = gps_tracking_data->sats;
for (c = 0; c < n; c++) {
- if (sat->svid && sat->state)
- printf (" %3d %02x %3d",
+ if (sat->svid)
+ printf (" %3d %3d",
struct sirf_measured_sat_data {
uint8_t svid;
struct sirf_measured_sat_data {
uint8_t svid;
static const struct sirf_packet_parse measured_sat_data_packet[] = {
{ SIRF_U8, offsetof (struct sirf_measured_sat_data, svid) }, /* 0 SV id */
static const struct sirf_packet_parse measured_sat_data_packet[] = {
{ SIRF_U8, offsetof (struct sirf_measured_sat_data, svid) }, /* 0 SV id */
- { SIRF_DISCARD, 2 }, /* 1 azimuth, 2 elevation */
- { SIRF_U16, offsetof (struct sirf_measured_sat_data, state) }, /* 2 state */
+ { SIRF_DISCARD, 4 }, /* 1 azimuth, 2 elevation, 3 state */
{ SIRF_U8, offsetof (struct sirf_measured_sat_data, c_n_1) }, /* C/N0 1 */
{ SIRF_DISCARD, 9 }, /* C/N0 2-10 */
{ SIRF_END, 0 },
{ SIRF_U8, offsetof (struct sirf_measured_sat_data, c_n_1) }, /* C/N0 1 */
{ SIRF_DISCARD, 9 }, /* C/N0 2-10 */
{ SIRF_END, 0 },
ao_gps_tracking_data.channels = ao_sirf_tracker_data.channels;
for (i = 0; i < 12; i++) {
ao_gps_tracking_data.sats[i].svid = ao_sirf_tracker_data.sats[i].svid;
ao_gps_tracking_data.channels = ao_sirf_tracker_data.channels;
for (i = 0; i < 12; i++) {
ao_gps_tracking_data.sats[i].svid = ao_sirf_tracker_data.sats[i].svid;
- ao_gps_tracking_data.sats[i].state = (uint8_t) ao_sirf_tracker_data.sats[i].state;
ao_gps_tracking_data.sats[i].c_n_1 = ao_sirf_tracker_data.sats[i].c_n_1;
}
ao_mutex_put(&ao_gps_mutex);
ao_gps_tracking_data.sats[i].c_n_1 = ao_sirf_tracker_data.sats[i].c_n_1;
}
ao_mutex_put(&ao_gps_mutex);
ao_gps_skip_field(); /* elevation */
ao_gps_lexchar();
ao_gps_skip_field(); /* azimuth */
ao_gps_skip_field(); /* elevation */
ao_gps_lexchar();
ao_gps_skip_field(); /* azimuth */
- if (ao_gps_tracking_next.sats[i].c_n_1 = ao_gps_decimal(2)) /* C/N0 */
- ao_gps_tracking_next.sats[i].state = 0xbf;
- else
- ao_gps_tracking_next.sats[i].state = 0;
+ if (!(ao_gps_tracking_next.sats[i].c_n_1 = ao_gps_decimal(2))) /* C/N0 */
+ ao_gps_tracking_next.sats[i].svid = 0;
ao_gps_tracking_next.channels = i + 1;
}
if (ao_gps_char == '*') {
ao_gps_tracking_next.channels = i + 1;
}
if (ao_gps_char == '*') {
struct ao_gps_sat_data {
uint8_t svid;
struct ao_gps_sat_data {
uint8_t svid;
printf("\n");
printf ("\t");
for (i = 0; i < 12; i++)
printf("\n");
printf ("\t");
for (i = 0; i < 12; i++)
ao_gps_tracking_data.sats[i].svid,
ao_gps_tracking_data.sats[i].svid,
- ao_gps_tracking_data.sats[i].state);
+ ao_gps_tracking_data.sats[i].c_n_1);