mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-30 23:03:05 +00:00 
			
		
		
		
	Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into release_0010
This commit is contained in:
		| @@ -15,15 +15,15 @@ | |||||||
|                       <xs:complexType> |                       <xs:complexType> | ||||||
|                         <xs:sequence> |                         <xs:sequence> | ||||||
|                           <xs:element type="xs:byte" name="i_satellite_PRN"/> |                           <xs:element type="xs:byte" name="i_satellite_PRN"/> | ||||||
|                           <xs:element type="xs:float" name="d_TOW"/> |                           <xs:element type="xs:int" name="d_TOW"/> | ||||||
|                           <xs:element type="xs:float" name="d_Crs"/> |                           <xs:element type="xs:float" name="d_Crs"/> | ||||||
|                           <xs:element type="xs:float" name="d_M_0"/> |                           <xs:element type="xs:float" name="d_M_0"/> | ||||||
|                           <xs:element type="xs:float" name="d_Cuc"/> |                           <xs:element type="xs:float" name="d_Cuc"/> | ||||||
|                           <xs:element type="xs:float" name="d_e_eccentricity"/> |                           <xs:element type="xs:float" name="d_e_eccentricity"/> | ||||||
|                           <xs:element type="xs:float" name="d_Cus"/> |                           <xs:element type="xs:float" name="d_Cus"/> | ||||||
|                           <xs:element type="xs:float" name="d_Toe1"/> |                           <xs:element type="xs:int" name="d_Toe1"/> | ||||||
|                           <xs:element type="xs:float" name="d_Toe2"/> |                           <xs:element type="xs:int" name="d_Toe2"/> | ||||||
|                           <xs:element type="xs:float" name="d_Toc"/> |                           <xs:element type="xs:byte" name="d_Toc"/> | ||||||
|                           <xs:element type="xs:float" name="d_Cic"/> |                           <xs:element type="xs:float" name="d_Cic"/> | ||||||
|                           <xs:element type="xs:float" name="d_OMEGA0"/> |                           <xs:element type="xs:float" name="d_OMEGA0"/> | ||||||
|                           <xs:element type="xs:float" name="d_Cis"/> |                           <xs:element type="xs:float" name="d_Cis"/> | ||||||
|   | |||||||
| @@ -15,9 +15,9 @@ | |||||||
|                       <xs:complexType> |                       <xs:complexType> | ||||||
|                         <xs:sequence> |                         <xs:sequence> | ||||||
|                           <xs:element type="xs:byte" name="i_satellite_PRN"/> |                           <xs:element type="xs:byte" name="i_satellite_PRN"/> | ||||||
|                           <xs:element type="xs:float" name="d_TOW"/> |                           <xs:element type="xs:int" name="d_TOW"/> | ||||||
|                           <xs:element type="xs:float" name="d_IODE_SF2"/> |                           <xs:element type="xs:byte" name="d_IODE_SF2"/> | ||||||
|                           <xs:element type="xs:float" name="d_IODE_SF3"/> |                           <xs:element type="xs:byte" name="d_IODE_SF3"/> | ||||||
|                           <xs:element type="xs:float" name="d_Crs"/> |                           <xs:element type="xs:float" name="d_Crs"/> | ||||||
|                           <xs:element type="xs:float" name="d_Delta_n"/> |                           <xs:element type="xs:float" name="d_Delta_n"/> | ||||||
|                           <xs:element type="xs:float" name="d_M_0"/> |                           <xs:element type="xs:float" name="d_M_0"/> | ||||||
| @@ -25,8 +25,8 @@ | |||||||
|                           <xs:element type="xs:float" name="d_e_eccentricity"/> |                           <xs:element type="xs:float" name="d_e_eccentricity"/> | ||||||
|                           <xs:element type="xs:float" name="d_Cus"/> |                           <xs:element type="xs:float" name="d_Cus"/> | ||||||
|                           <xs:element type="xs:float" name="d_sqrt_A"/> |                           <xs:element type="xs:float" name="d_sqrt_A"/> | ||||||
|                           <xs:element type="xs:float" name="d_Toe"/> |                           <xs:element type="xs:int" name="d_Toe"/> | ||||||
|                           <xs:element type="xs:float" name="d_Toc"/> |                           <xs:element type="xs:int" name="d_Toc"/> | ||||||
|                           <xs:element type="xs:float" name="d_Cic"/> |                           <xs:element type="xs:float" name="d_Cic"/> | ||||||
|                           <xs:element type="xs:float" name="d_OMEGA0"/> |                           <xs:element type="xs:float" name="d_OMEGA0"/> | ||||||
|                           <xs:element type="xs:float" name="d_Cis"/> |                           <xs:element type="xs:float" name="d_Cis"/> | ||||||
| @@ -41,7 +41,7 @@ | |||||||
|                           <xs:element type="xs:byte" name="i_SV_accuracy"/> |                           <xs:element type="xs:byte" name="i_SV_accuracy"/> | ||||||
|                           <xs:element type="xs:byte" name="i_SV_health"/> |                           <xs:element type="xs:byte" name="i_SV_health"/> | ||||||
|                           <xs:element type="xs:float" name="d_TGD"/> |                           <xs:element type="xs:float" name="d_TGD"/> | ||||||
|                           <xs:element type="xs:float" name="d_IODC"/> |                           <xs:element type="xs:byte" name="d_IODC"/> | ||||||
|                           <xs:element type="xs:short" name="i_AODO"/> |                           <xs:element type="xs:short" name="i_AODO"/> | ||||||
|                           <xs:element type="xs:byte" name="b_fit_interval_flag"/> |                           <xs:element type="xs:byte" name="b_fit_interval_flag"/> | ||||||
|                           <xs:element type="xs:float" name="d_spare1"/> |                           <xs:element type="xs:float" name="d_spare1"/> | ||||||
|   | |||||||
| @@ -30,25 +30,25 @@ | |||||||
|                           <xs:element type="xs:float" name="C_rs_3"/> |                           <xs:element type="xs:float" name="C_rs_3"/> | ||||||
|                           <xs:element type="xs:float" name="C_ic_4"/> |                           <xs:element type="xs:float" name="C_ic_4"/> | ||||||
|                           <xs:element type="xs:float" name="C_is_4"/> |                           <xs:element type="xs:float" name="C_is_4"/> | ||||||
|                           <xs:element type="xs:float" name="t0e_1"/> |                           <xs:element type="xs:int" name="t0e_1"/> | ||||||
|                           <xs:element type="xs:float" name="t0c_4"/> |                           <xs:element type="xs:int" name="t0c_4"/> | ||||||
|                           <xs:element type="xs:float" name="af0_4"/> |                           <xs:element type="xs:float" name="af0_4"/> | ||||||
|                           <xs:element type="xs:float" name="af1_4"/> |                           <xs:element type="xs:float" name="af1_4"/> | ||||||
|                           <xs:element type="xs:float" name="af2_4"/> |                           <xs:element type="xs:float" name="af2_4"/> | ||||||
|                           <xs:element type="xs:float" name="WN_5"/> |                           <xs:element type="xs:short" name="WN_5"/> | ||||||
|                           <xs:element type="xs:float" name="TOW_5"/> |                           <xs:element type="xs:int" name="TOW_5"/> | ||||||
|                           <xs:element type="xs:float" name="Galileo_satClkDrift"/> |                           <xs:element type="xs:float" name="Galileo_satClkDrift"/> | ||||||
|                           <xs:element type="xs:float" name="Galileo_dtr"/> |                           <xs:element type="xs:float" name="Galileo_dtr"/> | ||||||
|                           <xs:element type="xs:byte" name="flag_all_ephemeris"/> |                           <xs:element type="xs:byte" name="flag_all_ephemeris"/> | ||||||
|                           <xs:element type="xs:byte" name="IOD_ephemeris"/> |                           <xs:element type="xs:byte" name="IOD_ephemeris"/> | ||||||
|                           <xs:element type="xs:byte" name="IOD_nav_1"/> |                           <xs:element type="xs:byte" name="IOD_nav_1"/> | ||||||
|                           <xs:element type="xs:float" name="SISA_3"/> |                           <xs:element type="xs:byte" name="SISA_3"/> | ||||||
|                           <xs:element type="xs:byte" name="E5a_HS"/> |                           <xs:element type="xs:byte" name="E5a_HS"/> | ||||||
|                           <xs:element type="xs:float" name="E5b_HS_5"/> |                           <xs:element type="xs:byte" name="E5b_HS_5"/> | ||||||
|                           <xs:element type="xs:float" name="E1B_HS_5"/> |                           <xs:element type="xs:byte" name="E1B_HS_5"/> | ||||||
|                           <xs:element type="xs:byte" name="E5a_DVS"/> |                           <xs:element type="xs:byte" name="E5a_DVS"/> | ||||||
|                           <xs:element type="xs:float" name="E5b_DVS_5"/> |                           <xs:element type="xs:byte" name="E5b_DVS_5"/> | ||||||
|                           <xs:element type="xs:float" name="E1B_DVS_5"/> |                           <xs:element type="xs:byte" name="E1B_DVS_5"/> | ||||||
|                           <xs:element type="xs:float" name="BGD_E1E5a_5"/> |                           <xs:element type="xs:float" name="BGD_E1E5a_5"/> | ||||||
|                           <xs:element type="xs:float" name="BGD_E1E5b_5"/> |                           <xs:element type="xs:float" name="BGD_E1E5b_5"/> | ||||||
|                         </xs:sequence> |                         </xs:sequence> | ||||||
|   | |||||||
| @@ -13,8 +13,8 @@ | |||||||
|               <xs:element type="xs:byte" name="Region3_flag_5"/> |               <xs:element type="xs:byte" name="Region3_flag_5"/> | ||||||
|               <xs:element type="xs:byte" name="Region4_flag_5"/> |               <xs:element type="xs:byte" name="Region4_flag_5"/> | ||||||
|               <xs:element type="xs:byte" name="Region5_flag_5"/> |               <xs:element type="xs:byte" name="Region5_flag_5"/> | ||||||
|               <xs:element type="xs:float" name="TOW_5"/> |               <xs:element type="xs:int" name="TOW_5"/> | ||||||
|               <xs:element type="xs:float" name="WN_5"/> |               <xs:element type="xs:short" name="WN_5"/> | ||||||
|             </xs:sequence> |             </xs:sequence> | ||||||
|             <xs:attribute type="xs:byte" name="class_id"/> |             <xs:attribute type="xs:byte" name="class_id"/> | ||||||
|             <xs:attribute type="xs:byte" name="tracking_level"/> |             <xs:attribute type="xs:byte" name="tracking_level"/> | ||||||
|   | |||||||
| @@ -7,12 +7,12 @@ | |||||||
|             <xs:sequence> |             <xs:sequence> | ||||||
|               <xs:element type="xs:float" name="A0_6"/> |               <xs:element type="xs:float" name="A0_6"/> | ||||||
|               <xs:element type="xs:float" name="A1_6"/> |               <xs:element type="xs:float" name="A1_6"/> | ||||||
|               <xs:element type="xs:float" name="Delta_tLS_6"/> |               <xs:element type="xs:byte" name="Delta_tLS_6"/> | ||||||
|               <xs:element type="xs:float" name="t0t_6"/> |               <xs:element type="xs:int" name="t0t_6"/> | ||||||
|               <xs:element type="xs:float" name="WNot_6"/> |               <xs:element type="xs:short" name="WNot_6"/> | ||||||
|               <xs:element type="xs:short" name="WN_LSF_6"/> |               <xs:element type="xs:short" name="WN_LSF_6"/> | ||||||
|               <xs:element type="xs:byte" name="DN_6"/> |               <xs:element type="xs:byte" name="DN_6"/> | ||||||
|               <xs:element type="xs:float" name="Delta_tLSF_6"/> |               <xs:element type="xs:byte" name="Delta_tLSF_6"/> | ||||||
|               <xs:element type="xs:byte" name="flag_utc_model"/> |               <xs:element type="xs:byte" name="flag_utc_model"/> | ||||||
|             </xs:sequence> |             </xs:sequence> | ||||||
|             <xs:attribute type="xs:byte" name="class_id"/> |             <xs:attribute type="xs:byte" name="class_id"/> | ||||||
|   | |||||||
| @@ -8,12 +8,12 @@ | |||||||
|               <xs:element type="xs:byte" name="valid"/> |               <xs:element type="xs:byte" name="valid"/> | ||||||
|               <xs:element type="xs:float" name="d_A1"/> |               <xs:element type="xs:float" name="d_A1"/> | ||||||
|               <xs:element type="xs:float" name="d_A0"/> |               <xs:element type="xs:float" name="d_A0"/> | ||||||
|               <xs:element type="xs:float" name="d_t_OT"/> |               <xs:element type="xs:int" name="d_t_OT"/> | ||||||
|               <xs:element type="xs:short" name="i_WN_T"/> |               <xs:element type="xs:short" name="i_WN_T"/> | ||||||
|               <xs:element type="xs:float" name="d_DeltaT_LS"/> |               <xs:element type="xs:byte" name="d_DeltaT_LS"/> | ||||||
|               <xs:element type="xs:short" name="i_WN_LSF"/> |               <xs:element type="xs:short" name="i_WN_LSF"/> | ||||||
|               <xs:element type="xs:byte" name="i_DN"/> |               <xs:element type="xs:byte" name="i_DN"/> | ||||||
|               <xs:element type="xs:float" name="d_DeltaT_LSF"/> |               <xs:element type="xs:byte" name="d_DeltaT_LSF"/> | ||||||
|             </xs:sequence> |             </xs:sequence> | ||||||
|             <xs:attribute type="xs:byte" name="class_id"/> |             <xs:attribute type="xs:byte" name="class_id"/> | ||||||
|             <xs:attribute type="xs:byte" name="tracking_level"/> |             <xs:attribute type="xs:byte" name="tracking_level"/> | ||||||
|   | |||||||
| @@ -645,7 +645,7 @@ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, | |||||||
|     for (i = 0; i < n; i++) |     for (i = 0; i < n; i++) | ||||||
|         { |         { | ||||||
|             if (!(ext = strrchr(efiles[i], '.'))) continue; |             if (!(ext = strrchr(efiles[i], '.'))) continue; | ||||||
|             if (strcmp(ext, ".sbs") != 0 && strcmp(ext, ".SBS") && |             if (strcmp(ext, ".sbs") != 0 && strcmp(ext, ".SBS") != 0 && | ||||||
|                 strcmp(ext, ".ems") != 0 && strcmp(ext, ".EMS") != 0) continue; |                 strcmp(ext, ".ems") != 0 && strcmp(ext, ".EMS") != 0) continue; | ||||||
|  |  | ||||||
|             readmsgs(efiles[i], sel, ts, te, sbs); |             readmsgs(efiles[i], sel, ts, te, sbs); | ||||||
|   | |||||||
| @@ -682,7 +682,7 @@ void decode_solopt(char *buff, solopt_t *opt) | |||||||
|  |  | ||||||
|     trace(4, "decode_solhead: buff=%s\n", buff); |     trace(4, "decode_solhead: buff=%s\n", buff); | ||||||
|  |  | ||||||
|     if (strncmp(buff, COMMENTH, 1) != 0 && strncmp(buff, "+", 1)) return; |     if (strncmp(buff, COMMENTH, 1) != 0 && strncmp(buff, "+", 1) != 0) return; | ||||||
|  |  | ||||||
|     if (strstr(buff, "GPST")) |     if (strstr(buff, "GPST")) | ||||||
|         opt->times = TIMES_GPST; |         opt->times = TIMES_GPST; | ||||||
|   | |||||||
| @@ -141,7 +141,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( | |||||||
|             d_samples_per_symbol = 0U; |             d_samples_per_symbol = 0U; | ||||||
|             d_PRN_code_period_ms = 0U; |             d_PRN_code_period_ms = 0U; | ||||||
|             d_required_symbols = 0U; |             d_required_symbols = 0U; | ||||||
|             d_frame_length_symbols = 0.0; |             d_frame_length_symbols = 0U; | ||||||
|             CodeLength = 0; |             CodeLength = 0; | ||||||
|             DataLength = 0; |             DataLength = 0; | ||||||
|             std::cout << "Galileo unified telemetry decoder error: Unknown frame type " << std::endl; |             std::cout << "Galileo unified telemetry decoder error: Unknown frame type " << std::endl; | ||||||
|   | |||||||
| @@ -38,7 +38,7 @@ | |||||||
|  |  | ||||||
|  |  | ||||||
| #ifndef _rotl | #ifndef _rotl | ||||||
| #define _rotl(X, N) ((X << N) ^ (X >> (32 - N)))  // Used in the parity check algorithm | #define _rotl(X, N) (((X) << (N)) ^ ((X) >> (32 - (N))))  // Used in the parity check algorithm | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|   | |||||||
| @@ -95,15 +95,15 @@ void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count, | |||||||
|         unsigned int metric,m0,m1,decision;\ |         unsigned int metric,m0,m1,decision;\ | ||||||
|         metric = (v->poly->c0[i] ^ sym0) + (v->poly->c1[i] ^ sym1);\ |         metric = (v->poly->c0[i] ^ sym0) + (v->poly->c1[i] ^ sym1);\ | ||||||
|         m0 = v->old_metrics[i] + metric;\ |         m0 = v->old_metrics[i] + metric;\ | ||||||
|         m1 = v->old_metrics[i+32] + (510 - metric);\ |         m1 = v->old_metrics[(i)+32] + (510 - metric);\ | ||||||
|         decision = (signed int)(m0-m1) > 0;\ |         decision = (signed int)(m0-m1) > 0;\ | ||||||
|         v->new_metrics[2*i] = decision ? m1 : m0;\ |         v->new_metrics[2*(i)] = decision ? m1 : m0;\ | ||||||
|         d->w[i/16] |= decision << ((2*i)&31);\ |         d->w[(i)/16] |= decision << ((2*(i))&31);\ | ||||||
|         m0 -= (metric+metric-510);\ |         m0 -= (metric+metric-510);\ | ||||||
|         m1 += (metric+metric-510);\ |         m1 += (metric+metric-510);\ | ||||||
|         decision = (signed int)(m0-m1) > 0;\ |         decision = (signed int)(m0-m1) > 0;\ | ||||||
|         v->new_metrics[2*i+1] = decision ? m1 : m0;\ |         v->new_metrics[2*(i)+1] = decision ? m1 : m0;\ | ||||||
|         d->w[i/16] |= decision << ((2*i+1)&31);\ |         d->w[(i)/16] |= decision << ((2*(i)+1)&31);\ | ||||||
| } | } | ||||||
|  |  | ||||||
| /** Update a v27_t decoder with a block of symbols. | /** Update a v27_t decoder with a block of symbols. | ||||||
|   | |||||||
| @@ -220,12 +220,12 @@ void gnss_sdr_supl_client::read_supl_data() | |||||||
|         { |         { | ||||||
|             gps_utc.d_A0 = static_cast<double>(assist.utc.a0) * pow(2.0, -30); |             gps_utc.d_A0 = static_cast<double>(assist.utc.a0) * pow(2.0, -30); | ||||||
|             gps_utc.d_A1 = static_cast<double>(assist.utc.a1) * pow(2.0, -50); |             gps_utc.d_A1 = static_cast<double>(assist.utc.a1) * pow(2.0, -50); | ||||||
|             gps_utc.d_DeltaT_LS = static_cast<double>(assist.utc.delta_tls); |             gps_utc.d_DeltaT_LS = static_cast<int32_t>(assist.utc.delta_tls); | ||||||
|             gps_utc.d_DeltaT_LSF = static_cast<double>(assist.utc.delta_tlsf); |             gps_utc.d_DeltaT_LSF = static_cast<int32_t>(assist.utc.delta_tlsf); | ||||||
|             gps_utc.d_t_OT = static_cast<double>(assist.utc.tot) * pow(2.0, 12); |             gps_utc.d_t_OT = static_cast<int32_t>(assist.utc.tot) * pow(2.0, 12); | ||||||
|             gps_utc.i_DN = static_cast<double>(assist.utc.dn); |             gps_utc.i_DN = static_cast<int32_t>(assist.utc.dn); | ||||||
|             gps_utc.i_WN_T = static_cast<double>(assist.utc.wnt); |             gps_utc.i_WN_T = static_cast<int32_t>(assist.utc.wnt); | ||||||
|             gps_utc.i_WN_LSF = static_cast<double>(assist.utc.wnlsf); |             gps_utc.i_WN_LSF = static_cast<int32_t>(assist.utc.wnlsf); | ||||||
|             gps_utc.valid = true; |             gps_utc.valid = true; | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -268,7 +268,7 @@ void gnss_sdr_supl_client::read_supl_data() | |||||||
|                     gps_almanac_iterator->second.d_OMEGA0 = static_cast<double>(a->OMEGA_0) * pow(2.0, -23); |                     gps_almanac_iterator->second.d_OMEGA0 = static_cast<double>(a->OMEGA_0) * pow(2.0, -23); | ||||||
|                     gps_almanac_iterator->second.d_sqrt_A = static_cast<double>(a->A_sqrt) * pow(2.0, -11); |                     gps_almanac_iterator->second.d_sqrt_A = static_cast<double>(a->A_sqrt) * pow(2.0, -11); | ||||||
|                     gps_almanac_iterator->second.d_OMEGA_DOT = static_cast<double>(a->OMEGA_dot) * pow(2.0, -38); |                     gps_almanac_iterator->second.d_OMEGA_DOT = static_cast<double>(a->OMEGA_dot) * pow(2.0, -38); | ||||||
|                     gps_almanac_iterator->second.i_Toa = static_cast<int32_t>(a->toa) * pow(2.0, 12); |                     gps_almanac_iterator->second.i_Toa = static_cast<int32_t>(a->toa * pow(2.0, 12)); | ||||||
|                     gps_almanac_iterator->second.d_e_eccentricity = static_cast<double>(a->e) * pow(2.0, -21); |                     gps_almanac_iterator->second.d_e_eccentricity = static_cast<double>(a->e) * pow(2.0, -21); | ||||||
|                     gps_almanac_iterator->second.d_M_0 = static_cast<double>(a->M0) * pow(2.0, -23); |                     gps_almanac_iterator->second.d_M_0 = static_cast<double>(a->M0) * pow(2.0, -23); | ||||||
|                 } |                 } | ||||||
|   | |||||||
| @@ -52,9 +52,9 @@ asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { | |||||||
| #undef	NEXT_PHASE | #undef	NEXT_PHASE | ||||||
| #undef	PREV_PHASE | #undef	PREV_PHASE | ||||||
| #define	_CH_PHASE(ctx, inc) do {					\ | #define	_CH_PHASE(ctx, inc) do {					\ | ||||||
| 		if(ctx->phase == 0)					\ | 		if((ctx)->phase == 0)					\ | ||||||
| 			ctx->context = 0;				\ | 			(ctx)->context = 0;				\ | ||||||
| 		ctx->phase += inc;					\ | 		(ctx)->phase += (inc);					\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
| #define	NEXT_PHASE(ctx)	_CH_PHASE(ctx, +1) | #define	NEXT_PHASE(ctx)	_CH_PHASE(ctx, +1) | ||||||
| #define	PREV_PHASE(ctx)	_CH_PHASE(ctx, -1) | #define	PREV_PHASE(ctx)	_CH_PHASE(ctx, -1) | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ | |||||||
| 		asn_dec_rval_t rval;					\ | 		asn_dec_rval_t rval;					\ | ||||||
| 		rval.code = _code;					\ | 		rval.code = _code;					\ | ||||||
| 		if(opt_ctx) opt_ctx->step = step; /* Save context */	\ | 		if(opt_ctx) opt_ctx->step = step; /* Save context */	\ | ||||||
| 		if(_code == RC_OK || opt_ctx)				\ | 		if((_code) == RC_OK || opt_ctx)				\ | ||||||
| 			rval.consumed = consumed_myself;		\ | 			rval.consumed = consumed_myself;		\ | ||||||
| 		else							\ | 		else							\ | ||||||
| 			rval.consumed = 0;	/* Context-free */	\ | 			rval.consumed = 0;	/* Context-free */	\ | ||||||
|   | |||||||
| @@ -46,8 +46,8 @@ | |||||||
|  */ |  */ | ||||||
| #undef	NEXT_PHASE | #undef	NEXT_PHASE | ||||||
| #define	NEXT_PHASE(ctx)	do {			\ | #define	NEXT_PHASE(ctx)	do {			\ | ||||||
| 		ctx->phase++;			\ | 		(ctx)->phase++;			\ | ||||||
| 		ctx->step = 0;			\ | 		(ctx)->step = 0;			\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
|  |  | ||||||
| /* | /* | ||||||
|   | |||||||
| @@ -47,10 +47,10 @@ | |||||||
| #undef	NEXT_PHASE | #undef	NEXT_PHASE | ||||||
| #undef	PHASE_OUT | #undef	PHASE_OUT | ||||||
| #define	NEXT_PHASE(ctx)	do {			\ | #define	NEXT_PHASE(ctx)	do {			\ | ||||||
| 		ctx->phase++;			\ | 		(ctx)->phase++;			\ | ||||||
| 		ctx->step = 0;			\ | 		(ctx)->step = 0;			\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
| #define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0) | #define	PHASE_OUT(ctx)	do { (ctx)->phase = 10; } while(0) | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * Return a standardized complex structure. |  * Return a standardized complex structure. | ||||||
|   | |||||||
| @@ -47,10 +47,10 @@ | |||||||
| #undef	NEXT_PHASE | #undef	NEXT_PHASE | ||||||
| #undef	PHASE_OUT | #undef	PHASE_OUT | ||||||
| #define	NEXT_PHASE(ctx)	do {			\ | #define	NEXT_PHASE(ctx)	do {			\ | ||||||
| 		ctx->phase++;			\ | 		(ctx)->phase++;			\ | ||||||
| 		ctx->step = 0;			\ | 		(ctx)->step = 0;			\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
| #define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0) | #define	PHASE_OUT(ctx)	do { (ctx)->phase = 10; } while(0) | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * Return a standardized complex structure. |  * Return a standardized complex structure. | ||||||
|   | |||||||
| @@ -774,11 +774,11 @@ static int write_out(const void *buffer, size_t size, void *key) { | |||||||
| } | } | ||||||
|  |  | ||||||
| static int argument_is_stdin(char *av[], int idx) { | static int argument_is_stdin(char *av[], int idx) { | ||||||
| 	if(strcmp(av[idx], "-")) { | 	if(strcmp(av[idx], "-") != 0) { | ||||||
| 		return 0;	/* Certainly not <stdin> */ | 		return 0;	/* Certainly not <stdin> */ | ||||||
| 	} else { | 	} else { | ||||||
| 		/* This might be <stdin>, unless `./program -- -` */ | 		/* This might be <stdin>, unless `./program -- -` */ | ||||||
| 		if(strcmp(av[-1], "--")) | 		if(strcmp(av[-1], "--") != 0) | ||||||
| 			return 1; | 			return 1; | ||||||
| 		else | 		else | ||||||
| 			return 0; | 			return 0; | ||||||
|   | |||||||
| @@ -181,12 +181,12 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { | |||||||
| #define	XER_GOT_BODY(chunk_buf, chunk_size, size)	do {	\ | #define	XER_GOT_BODY(chunk_buf, chunk_size, size)	do {	\ | ||||||
| 		ssize_t converted_size = body_receiver		\ | 		ssize_t converted_size = body_receiver		\ | ||||||
| 			(struct_key, chunk_buf, chunk_size,	\ | 			(struct_key, chunk_buf, chunk_size,	\ | ||||||
| 				(size_t)chunk_size < size);	\ | 				(size_t)(chunk_size) < (size));	\ | ||||||
| 		if(converted_size == -1) RETURN(RC_FAIL);	\ | 		if(converted_size == -1) RETURN(RC_FAIL);	\ | ||||||
| 		if(converted_size == 0				\ | 		if(converted_size == 0				\ | ||||||
| 			&& size == (size_t)chunk_size)		\ | 			&& (size) == (size_t)(chunk_size))		\ | ||||||
| 			RETURN(RC_WMORE);			\ | 			RETURN(RC_WMORE);			\ | ||||||
| 		chunk_size = converted_size;			\ | 		(chunk_size) = converted_size;			\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
| #define	XER_GOT_EMPTY()	do {					\ | #define	XER_GOT_EMPTY()	do {					\ | ||||||
| 	if(body_receiver(struct_key, 0, 0, size > 0) == -1)	\ | 	if(body_receiver(struct_key, 0, 0, size > 0) == -1)	\ | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ _charclass[256] = { | |||||||
| #define	TOKEN_CB_CALL(type, _ns, _current_too, _final) do {	\ | #define	TOKEN_CB_CALL(type, _ns, _current_too, _final) do {	\ | ||||||
| 		int _ret;					\ | 		int _ret;					\ | ||||||
| 		pstate_e ns  = _ns;				\ | 		pstate_e ns  = _ns;				\ | ||||||
| 		ssize_t _sz = (p - chunk_start) + _current_too;	\ | 		ssize_t _sz = (p - chunk_start) + (_current_too);	\ | ||||||
| 		if (!_sz) {					\ | 		if (!_sz) {					\ | ||||||
| 			/* Shortcut */				\ | 			/* Shortcut */				\ | ||||||
| 			state = _ns;				\ | 			state = _ns;				\ | ||||||
| @@ -68,11 +68,11 @@ _charclass[256] = { | |||||||
| 		}						\ | 		}						\ | ||||||
| 		_ret = cb(type, chunk_start, _sz, key);		\ | 		_ret = cb(type, chunk_start, _sz, key);		\ | ||||||
| 		if(_ret < _sz) {				\ | 		if(_ret < _sz) {				\ | ||||||
| 			if(_current_too && _ret == -1)		\ | 			if((_current_too) && _ret == -1)		\ | ||||||
| 				state = ns;			\ | 				state = ns;			\ | ||||||
| 			goto finish;				\ | 			goto finish;				\ | ||||||
| 		}						\ | 		}						\ | ||||||
| 		chunk_start = p + _current_too;			\ | 		chunk_start = p + (_current_too);			\ | ||||||
| 		state = ns;					\ | 		state = ns;					\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -369,7 +369,7 @@ asn_GT2time_frac(const GeneralizedTime_t *st, int *frac_value, int *frac_digits, | |||||||
| 			errno = EINVAL;				\ | 			errno = EINVAL;				\ | ||||||
| 			return -1;				\ | 			return -1;				\ | ||||||
| 		} else {					\ | 		} else {					\ | ||||||
| 			var = var * 10 + (ch - 0x30);		\ | 			(var) = (var) * 10 + (ch - 0x30);		\ | ||||||
| 			buf++;					\ | 			buf++;					\ | ||||||
| 		}						\ | 		}						\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
|   | |||||||
| @@ -52,9 +52,9 @@ asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { | |||||||
| #undef	NEXT_PHASE | #undef	NEXT_PHASE | ||||||
| #undef	PREV_PHASE | #undef	PREV_PHASE | ||||||
| #define	_CH_PHASE(ctx, inc) do {					\ | #define	_CH_PHASE(ctx, inc) do {					\ | ||||||
| 		if(ctx->phase == 0)					\ | 		if((ctx)->phase == 0)					\ | ||||||
| 			ctx->context = 0;				\ | 			(ctx)->context = 0;				\ | ||||||
| 		ctx->phase += inc;					\ | 		(ctx)->phase += (inc);					\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
| #define	NEXT_PHASE(ctx)	_CH_PHASE(ctx, +1) | #define	NEXT_PHASE(ctx)	_CH_PHASE(ctx, +1) | ||||||
| #define	PREV_PHASE(ctx)	_CH_PHASE(ctx, -1) | #define	PREV_PHASE(ctx)	_CH_PHASE(ctx, -1) | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ | |||||||
| 		asn_dec_rval_t rval;					\ | 		asn_dec_rval_t rval;					\ | ||||||
| 		rval.code = _code;					\ | 		rval.code = _code;					\ | ||||||
| 		if(opt_ctx) opt_ctx->step = step; /* Save context */	\ | 		if(opt_ctx) opt_ctx->step = step; /* Save context */	\ | ||||||
| 		if(_code == RC_OK || opt_ctx)				\ | 		if((_code) == RC_OK || opt_ctx)				\ | ||||||
| 			rval.consumed = consumed_myself;		\ | 			rval.consumed = consumed_myself;		\ | ||||||
| 		else							\ | 		else							\ | ||||||
| 			rval.consumed = 0;	/* Context-free */	\ | 			rval.consumed = 0;	/* Context-free */	\ | ||||||
|   | |||||||
| @@ -46,8 +46,8 @@ | |||||||
|  */ |  */ | ||||||
| #undef	NEXT_PHASE | #undef	NEXT_PHASE | ||||||
| #define	NEXT_PHASE(ctx)	do {			\ | #define	NEXT_PHASE(ctx)	do {			\ | ||||||
| 		ctx->phase++;			\ | 		(ctx)->phase++;			\ | ||||||
| 		ctx->step = 0;			\ | 		(ctx)->step = 0;			\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
|  |  | ||||||
| /* | /* | ||||||
|   | |||||||
| @@ -47,10 +47,10 @@ | |||||||
| #undef	NEXT_PHASE | #undef	NEXT_PHASE | ||||||
| #undef	PHASE_OUT | #undef	PHASE_OUT | ||||||
| #define	NEXT_PHASE(ctx)	do {			\ | #define	NEXT_PHASE(ctx)	do {			\ | ||||||
| 		ctx->phase++;			\ | 		(ctx)->phase++;			\ | ||||||
| 		ctx->step = 0;			\ | 		(ctx)->step = 0;			\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
| #define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0) | #define	PHASE_OUT(ctx)	do { (ctx)->phase = 10; } while(0) | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * Return a standardized complex structure. |  * Return a standardized complex structure. | ||||||
|   | |||||||
| @@ -47,10 +47,10 @@ | |||||||
| #undef	NEXT_PHASE | #undef	NEXT_PHASE | ||||||
| #undef	PHASE_OUT | #undef	PHASE_OUT | ||||||
| #define	NEXT_PHASE(ctx)	do {			\ | #define	NEXT_PHASE(ctx)	do {			\ | ||||||
| 		ctx->phase++;			\ | 		(ctx)->phase++;			\ | ||||||
| 		ctx->step = 0;			\ | 		(ctx)->step = 0;			\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
| #define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0) | #define	PHASE_OUT(ctx)	do { (ctx)->phase = 10; } while(0) | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * Return a standardized complex structure. |  * Return a standardized complex structure. | ||||||
|   | |||||||
| @@ -181,12 +181,12 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { | |||||||
| #define	XER_GOT_BODY(chunk_buf, chunk_size, size)	do {	\ | #define	XER_GOT_BODY(chunk_buf, chunk_size, size)	do {	\ | ||||||
| 		ssize_t converted_size = body_receiver		\ | 		ssize_t converted_size = body_receiver		\ | ||||||
| 			(struct_key, chunk_buf, chunk_size,	\ | 			(struct_key, chunk_buf, chunk_size,	\ | ||||||
| 				(size_t)chunk_size < size);	\ | 				(size_t)(chunk_size) < (size));	\ | ||||||
| 		if(converted_size == -1) RETURN(RC_FAIL);	\ | 		if(converted_size == -1) RETURN(RC_FAIL);	\ | ||||||
| 		if(converted_size == 0				\ | 		if(converted_size == 0				\ | ||||||
| 			&& size == (size_t)chunk_size)		\ | 			&& (size) == (size_t)(chunk_size))		\ | ||||||
| 			RETURN(RC_WMORE);			\ | 			RETURN(RC_WMORE);			\ | ||||||
| 		chunk_size = converted_size;			\ | 		(chunk_size) = converted_size;			\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
| #define	XER_GOT_EMPTY()	do {					\ | #define	XER_GOT_EMPTY()	do {					\ | ||||||
| 	if(body_receiver(struct_key, 0, 0, size > 0) == -1)	\ | 	if(body_receiver(struct_key, 0, 0, size > 0) == -1)	\ | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ _charclass[256] = { | |||||||
| #define	TOKEN_CB_CALL(type, _ns, _current_too, _final) do {	\ | #define	TOKEN_CB_CALL(type, _ns, _current_too, _final) do {	\ | ||||||
| 		int _ret;					\ | 		int _ret;					\ | ||||||
| 		pstate_e ns  = _ns;				\ | 		pstate_e ns  = _ns;				\ | ||||||
| 		ssize_t _sz = (p - chunk_start) + _current_too;	\ | 		ssize_t _sz = (p - chunk_start) + (_current_too);	\ | ||||||
| 		if (!_sz) {					\ | 		if (!_sz) {					\ | ||||||
| 			/* Shortcut */				\ | 			/* Shortcut */				\ | ||||||
| 			state = _ns;				\ | 			state = _ns;				\ | ||||||
| @@ -68,11 +68,11 @@ _charclass[256] = { | |||||||
| 		}						\ | 		}						\ | ||||||
| 		_ret = cb(type, chunk_start, _sz, key);		\ | 		_ret = cb(type, chunk_start, _sz, key);		\ | ||||||
| 		if(_ret < _sz) {				\ | 		if(_ret < _sz) {				\ | ||||||
| 			if(_current_too && _ret == -1)		\ | 			if((_current_too) && _ret == -1)		\ | ||||||
| 				state = ns;			\ | 				state = ns;			\ | ||||||
| 			goto finish;				\ | 			goto finish;				\ | ||||||
| 		}						\ | 		}						\ | ||||||
| 		chunk_start = p + _current_too;			\ | 		chunk_start = p + (_current_too);			\ | ||||||
| 		state = ns;					\ | 		state = ns;					\ | ||||||
| 	} while(0) | 	} while(0) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -54,7 +54,7 @@ const int32_t GPS_CNAV_DATA_PAGE_BITS = 300; | |||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_PRN({{9, 6}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_PRN({{9, 6}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_MSG_TYPE({{15, 6}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_MSG_TYPE({{15, 6}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_TOW({{21, 17}});  // GPS Time Of Week in seconds | const std::vector<std::pair<int32_t, int32_t> > CNAV_TOW({{21, 17}});  // GPS Time Of Week in seconds | ||||||
| const double CNAV_TOW_LSB = 6.0; | const int32_t CNAV_TOW_LSB = 6; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_ALERT_FLAG({{38, 1}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_ALERT_FLAG({{38, 1}}); | ||||||
|  |  | ||||||
| // MESSAGE TYPE 10 (Ephemeris 1) | // MESSAGE TYPE 10 (Ephemeris 1) | ||||||
| @@ -62,11 +62,11 @@ const std::vector<std::pair<int32_t, int32_t> > CNAV_ALERT_FLAG({{38, 1}}); | |||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_WN({{39, 13}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_WN({{39, 13}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_HEALTH({{52, 3}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_HEALTH({{52, 3}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP1({{55, 11}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP1({{55, 11}}); | ||||||
| const double CNAV_TOP1_LSB = 300.0; | const int32_t CNAV_TOP1_LSB = 300; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_URA({{66, 5}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_URA({{66, 5}}); | ||||||
|  |  | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE1({{71, 11}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE1({{71, 11}}); | ||||||
| const double CNAV_TOE1_LSB = 300.0; | const int32_t CNAV_TOE1_LSB = 300; | ||||||
|  |  | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_A({{82, 26}});  // Relative to AREF = 26,559,710 meters | const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_A({{82, 26}});  // Relative to AREF = 26,559,710 meters | ||||||
| const double CNAV_DELTA_A_LSB = TWO_N9; | const double CNAV_DELTA_A_LSB = TWO_N9; | ||||||
| @@ -90,7 +90,7 @@ const std::vector<std::pair<int32_t, int32_t> > CNAV_L2_PHASING_FLAG({{273, 1}}) | |||||||
| // MESSAGE TYPE 11 (Ephemeris 2) | // MESSAGE TYPE 11 (Ephemeris 2) | ||||||
|  |  | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE2({{39, 11}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_TOE2({{39, 11}}); | ||||||
| const double CNAV_TOE2_LSB = 300.0; | const int32_t CNAV_TOE2_LSB = 300; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_OMEGA0({{50, 33}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_OMEGA0({{50, 33}}); | ||||||
| const double CNAV_OMEGA0_LSB = TWO_N32 * PI;  // semi-circles to radians | const double CNAV_OMEGA0_LSB = TWO_N32 * PI;  // semi-circles to radians | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_I0({{83, 33}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_I0({{83, 33}}); | ||||||
| @@ -116,12 +116,12 @@ const double CNAV_CUC_LSB = TWO_N30; | |||||||
| // MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY) | // MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY) | ||||||
|  |  | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP2({{39, 11}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_TOP2({{39, 11}}); | ||||||
| const double CNAV_TOP2_LSB = 300.0; | const int32_t CNAV_TOP2_LSB = 300; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED0({{50, 5}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED0({{50, 5}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED1({{55, 3}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED1({{55, 3}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED2({{58, 3}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_URA_NED2({{58, 3}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_TOC({{61, 11}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_TOC({{61, 11}}); | ||||||
| const double CNAV_TOC_LSB = 300.0; | const int32_t CNAV_TOC_LSB = 300; | ||||||
| const std::vector<std::pair<int, int> > CNAV_AF0({{72, 26}}); | const std::vector<std::pair<int, int> > CNAV_AF0({{72, 26}}); | ||||||
| const double CNAV_AF0_LSB = TWO_N35; | const double CNAV_AF0_LSB = TWO_N35; | ||||||
| const std::vector<std::pair<int, int> > CNAV_AF1({{98, 20}}); | const std::vector<std::pair<int, int> > CNAV_AF1({{98, 20}}); | ||||||
| @@ -167,9 +167,9 @@ const double CNAV_A1_LSB = TWO_N51; | |||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_A2({{157, 7}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_A2({{157, 7}}); | ||||||
| const double CNAV_A2_LSB = TWO_N68; | const double CNAV_A2_LSB = TWO_N68; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLS({{164, 8}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLS({{164, 8}}); | ||||||
| const double CNAV_DELTA_TLS_LSB = 1; | const int32_t CNAV_DELTA_TLS_LSB = 1; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_TOT({{172, 16}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_TOT({{172, 16}}); | ||||||
| const double CNAV_TOT_LSB = TWO_P4; | const int32_t CNAV_TOT_LSB = TWO_P4; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_WN_OT({{188, 13}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_WN_OT({{188, 13}}); | ||||||
| const int32_t CNAV_WN_OT_LSB = 1; | const int32_t CNAV_WN_OT_LSB = 1; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_WN_LSF({{201, 13}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_WN_LSF({{201, 13}}); | ||||||
| @@ -177,7 +177,7 @@ const int32_t CNAV_WN_LSF_LSB = 1; | |||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_DN({{214, 4}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_DN({{214, 4}}); | ||||||
| const int32_t CNAV_DN_LSB = 1; | const int32_t CNAV_DN_LSB = 1; | ||||||
| const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLSF({{218, 8}}); | const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLSF({{218, 8}}); | ||||||
| const double CNAV_DELTA_TLSF_LSB = 1; | const int32_t CNAV_DELTA_TLSF_LSB = 1; | ||||||
|  |  | ||||||
|  |  | ||||||
| // TODO: Add more frames (Almanac, etc...) | // TODO: Add more frames (Almanac, etc...) | ||||||
|   | |||||||
| @@ -118,7 +118,7 @@ const std::vector<std::pair<int32_t, int32_t>> T_GD({{197, 8}}); | |||||||
| const double T_GD_LSB = TWO_N31; | const double T_GD_LSB = TWO_N31; | ||||||
| const std::vector<std::pair<int32_t, int32_t>> IODC({{83, 2}, {211, 8}}); | const std::vector<std::pair<int32_t, int32_t>> IODC({{83, 2}, {211, 8}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t>> T_OC({{219, 16}}); | const std::vector<std::pair<int32_t, int32_t>> T_OC({{219, 16}}); | ||||||
| const double T_OC_LSB = TWO_P4; | const int32_t T_OC_LSB = static_cast<int32_t>(TWO_P4); | ||||||
| const std::vector<std::pair<int32_t, int32_t>> A_F2({{241, 8}}); | const std::vector<std::pair<int32_t, int32_t>> A_F2({{241, 8}}); | ||||||
| const double A_F2_LSB = TWO_N55; | const double A_F2_LSB = TWO_N55; | ||||||
| const std::vector<std::pair<int32_t, int32_t>> A_F1({{249, 16}}); | const std::vector<std::pair<int32_t, int32_t>> A_F1({{249, 16}}); | ||||||
| @@ -143,7 +143,7 @@ const double C_US_LSB = TWO_N29; | |||||||
| const std::vector<std::pair<int32_t, int32_t>> SQRT_A({{227, 8}, {241, 24}}); | const std::vector<std::pair<int32_t, int32_t>> SQRT_A({{227, 8}, {241, 24}}); | ||||||
| const double SQRT_A_LSB = TWO_N19; | const double SQRT_A_LSB = TWO_N19; | ||||||
| const std::vector<std::pair<int32_t, int32_t>> T_OE({{271, 16}}); | const std::vector<std::pair<int32_t, int32_t>> T_OE({{271, 16}}); | ||||||
| const double T_OE_LSB = TWO_P4; | const int32_t T_OE_LSB = static_cast<int32_t>(TWO_P4); | ||||||
| const std::vector<std::pair<int32_t, int32_t>> FIT_INTERVAL_FLAG({{271, 1}}); | const std::vector<std::pair<int32_t, int32_t>> FIT_INTERVAL_FLAG({{271, 1}}); | ||||||
| const std::vector<std::pair<int32_t, int32_t>> AODO({{272, 5}}); | const std::vector<std::pair<int32_t, int32_t>> AODO({{272, 5}}); | ||||||
| const int32_t AODO_LSB = 900; | const int32_t AODO_LSB = 900; | ||||||
|   | |||||||
| @@ -322,7 +322,7 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) | |||||||
|             FNAV_A0_4 *= FNAV_A0_4_LSB; |             FNAV_A0_4 *= FNAV_A0_4_LSB; | ||||||
|             FNAV_A1_4 = static_cast<double>(read_navigation_signed(data_bits, FNAV_A1_4_bit)); |             FNAV_A1_4 = static_cast<double>(read_navigation_signed(data_bits, FNAV_A1_4_bit)); | ||||||
|             FNAV_A1_4 *= FNAV_A1_4_LSB; |             FNAV_A1_4 *= FNAV_A1_4_LSB; | ||||||
|             FNAV_deltatls_4 = static_cast<double>(read_navigation_signed(data_bits, FNAV_deltatls_4_bit)); |             FNAV_deltatls_4 = static_cast<int32_t>(read_navigation_signed(data_bits, FNAV_deltatls_4_bit)); | ||||||
|             FNAV_t0t_4 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); |             FNAV_t0t_4 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); | ||||||
|             FNAV_t0t_4 *= FNAV_t0t_4_LSB; |             FNAV_t0t_4 *= FNAV_t0t_4_LSB; | ||||||
|             FNAV_WNot_4 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); |             FNAV_WNot_4 = static_cast<int32_t>(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); | ||||||
|   | |||||||
| @@ -125,8 +125,8 @@ void Galileo_Navigation_Message::reset() | |||||||
|     BGD_E1E5b_5 = 0.0; |     BGD_E1E5b_5 = 0.0; | ||||||
|     E5b_HS_5 = 0; |     E5b_HS_5 = 0; | ||||||
|     E1B_HS_5 = 0; |     E1B_HS_5 = 0; | ||||||
|     E5b_DVS_5 = 0; |     E5b_DVS_5 = false; | ||||||
|     E1B_DVS_5 = 0; |     E1B_DVS_5 = false; | ||||||
|  |  | ||||||
|     // GST |     // GST | ||||||
|     WN_5 = 0; |     WN_5 = 0; | ||||||
|   | |||||||
| @@ -37,17 +37,17 @@ Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris() | |||||||
| { | { | ||||||
|     i_satellite_PRN = 0U; |     i_satellite_PRN = 0U; | ||||||
|  |  | ||||||
|     d_Toe1 = -1.0; |     d_Toe1 = -1; | ||||||
|     d_Toe2 = -1.0; |     d_Toe2 = -1; | ||||||
|  |  | ||||||
|     d_TOW = 0.0; |     d_TOW = 0; | ||||||
|     d_Crs = 0.0; |     d_Crs = 0.0; | ||||||
|     d_M_0 = 0.0; |     d_M_0 = 0.0; | ||||||
|     d_Cuc = 0.0; |     d_Cuc = 0.0; | ||||||
|     d_e_eccentricity = 0.0; |     d_e_eccentricity = 0.0; | ||||||
|     d_Cus = 0.0; |     d_Cus = 0.0; | ||||||
|  |  | ||||||
|     d_Toc = 0.0; |     d_Toc = 0; | ||||||
|     d_Cic = 0.0; |     d_Cic = 0.0; | ||||||
|     d_OMEGA0 = 0.0; |     d_OMEGA0 = 0.0; | ||||||
|     d_Cis = 0.0; |     d_Cis = 0.0; | ||||||
| @@ -79,7 +79,7 @@ Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris() | |||||||
|  |  | ||||||
|     i_URA = 0; |     i_URA = 0; | ||||||
|     i_signal_health = 0; |     i_signal_health = 0; | ||||||
|     d_Top = 0.0; |     d_Top = 0; | ||||||
|     d_DELTA_A = 0.0; |     d_DELTA_A = 0.0; | ||||||
|     d_A_DOT = 0.0; |     d_A_DOT = 0.0; | ||||||
|     d_Delta_n = 0.0; |     d_Delta_n = 0.0; | ||||||
|   | |||||||
| @@ -54,7 +54,7 @@ public: | |||||||
|     int32_t i_GPS_week;        //!< GPS week number, aka WN [week] |     int32_t i_GPS_week;        //!< GPS week number, aka WN [week] | ||||||
|     int32_t i_URA;             //!< ED Accuracy Index |     int32_t i_URA;             //!< ED Accuracy Index | ||||||
|     int32_t i_signal_health;   //!< Signal health (L1/L2/L5) |     int32_t i_signal_health;   //!< Signal health (L1/L2/L5) | ||||||
|     double d_Top;              //!< Data predict time of week |     int32_t d_Top;             //!< Data predict time of week | ||||||
|     double d_DELTA_A;          //!< Semi-major axis difference at reference time |     double d_DELTA_A;          //!< Semi-major axis difference at reference time | ||||||
|     double d_A_DOT;            //!< Change rate in semi-major axis |     double d_A_DOT;            //!< Change rate in semi-major axis | ||||||
|     double d_Delta_n;          //!< Mean Motion Difference From Computed Value [semi-circles/s] |     double d_Delta_n;          //!< Mean Motion Difference From Computed Value [semi-circles/s] | ||||||
| @@ -63,8 +63,8 @@ public: | |||||||
|     double d_e_eccentricity;   //!< Eccentricity |     double d_e_eccentricity;   //!< Eccentricity | ||||||
|     double d_OMEGA;            //!< Argument of Perigee [semi-cicles] |     double d_OMEGA;            //!< Argument of Perigee [semi-cicles] | ||||||
|     double d_OMEGA0;           //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] |     double d_OMEGA0;           //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] | ||||||
|     double d_Toe1;             //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] |     int32_t d_Toe1;            //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] | ||||||
|     double d_Toe2;             //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] |     int32_t d_Toe2;            //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] | ||||||
|     double d_DELTA_OMEGA_DOT;  //!< Rate of Right Ascension  difference [semi-circles/s] |     double d_DELTA_OMEGA_DOT;  //!< Rate of Right Ascension  difference [semi-circles/s] | ||||||
|     double d_i_0;              //!< Inclination Angle at Reference Time [semi-circles] |     double d_i_0;              //!< Inclination Angle at Reference Time [semi-circles] | ||||||
|     double d_IDOT;             //!< Rate of Inclination Angle [semi-circles/s] |     double d_IDOT;             //!< Rate of Inclination Angle [semi-circles/s] | ||||||
| @@ -76,7 +76,7 @@ public: | |||||||
|     double d_Cuc;              //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] |     double d_Cuc;              //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] | ||||||
|  |  | ||||||
|     // Clock Correction and Accuracy Parameters |     // Clock Correction and Accuracy Parameters | ||||||
|     double d_Toc;   //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] |     int32_t d_Toc;  //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] | ||||||
|     double d_A_f0;  //!< Coefficient 0 of code phase offset model [s] |     double d_A_f0;  //!< Coefficient 0 of code phase offset model [s] | ||||||
|     double d_A_f1;  //!< Coefficient 1 of code phase offset model [s/s] |     double d_A_f1;  //!< Coefficient 1 of code phase offset model [s/s] | ||||||
|     double d_A_f2;  //!< Coefficient 2 of code phase offset model [s/s^2] |     double d_A_f2;  //!< Coefficient 2 of code phase offset model [s/s^2] | ||||||
| @@ -92,7 +92,7 @@ public: | |||||||
|     double d_ISCL5I; |     double d_ISCL5I; | ||||||
|     double d_ISCL5Q; |     double d_ISCL5Q; | ||||||
|  |  | ||||||
|     double d_TOW;  //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] |     int32_t d_TOW;  //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] | ||||||
|  |  | ||||||
|     /*! \brief If true, enhanced level of integrity assurance. |     /*! \brief If true, enhanced level of integrity assurance. | ||||||
|      * |      * | ||||||
|   | |||||||
| @@ -55,7 +55,7 @@ void Gps_CNAV_Navigation_Message::reset() | |||||||
|     d_satvel_Y = 0.0; |     d_satvel_Y = 0.0; | ||||||
|     d_satvel_Z = 0.0; |     d_satvel_Z = 0.0; | ||||||
|  |  | ||||||
|     d_TOW = 0.0; |     d_TOW = 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -148,7 +148,7 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT | |||||||
|     PRN = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_PRN)); |     PRN = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_PRN)); | ||||||
|     ephemeris_record.i_satellite_PRN = PRN; |     ephemeris_record.i_satellite_PRN = PRN; | ||||||
|  |  | ||||||
|     d_TOW = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOW)); |     d_TOW = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOW)); | ||||||
|     d_TOW *= CNAV_TOW_LSB; |     d_TOW *= CNAV_TOW_LSB; | ||||||
|     ephemeris_record.d_TOW = d_TOW; |     ephemeris_record.d_TOW = d_TOW; | ||||||
|  |  | ||||||
| @@ -162,10 +162,10 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT | |||||||
|         case 10:  // Ephemeris 1/2 |         case 10:  // Ephemeris 1/2 | ||||||
|             ephemeris_record.i_GPS_week = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_WN)); |             ephemeris_record.i_GPS_week = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_WN)); | ||||||
|             ephemeris_record.i_signal_health = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_HEALTH)); |             ephemeris_record.i_signal_health = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_HEALTH)); | ||||||
|             ephemeris_record.d_Top = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOP1)); |             ephemeris_record.d_Top = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOP1)); | ||||||
|             ephemeris_record.d_Top *= CNAV_TOP1_LSB; |             ephemeris_record.d_Top *= CNAV_TOP1_LSB; | ||||||
|             ephemeris_record.d_URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA)); |             ephemeris_record.d_URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA)); | ||||||
|             ephemeris_record.d_Toe1 = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOE1)); |             ephemeris_record.d_Toe1 = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOE1)); | ||||||
|             ephemeris_record.d_Toe1 *= CNAV_TOE1_LSB; |             ephemeris_record.d_Toe1 *= CNAV_TOE1_LSB; | ||||||
|             ephemeris_record.d_DELTA_A = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_A)); |             ephemeris_record.d_DELTA_A = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_A)); | ||||||
|             ephemeris_record.d_DELTA_A *= CNAV_DELTA_A_LSB; |             ephemeris_record.d_DELTA_A *= CNAV_DELTA_A_LSB; | ||||||
| @@ -188,7 +188,7 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT | |||||||
|             b_flag_ephemeris_1 = true; |             b_flag_ephemeris_1 = true; | ||||||
|             break; |             break; | ||||||
|         case 11:  // Ephemeris 2/2 |         case 11:  // Ephemeris 2/2 | ||||||
|             ephemeris_record.d_Toe2 = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOE2)); |             ephemeris_record.d_Toe2 = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOE2)); | ||||||
|             ephemeris_record.d_Toe2 *= CNAV_TOE2_LSB; |             ephemeris_record.d_Toe2 *= CNAV_TOE2_LSB; | ||||||
|             ephemeris_record.d_OMEGA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_OMEGA0)); |             ephemeris_record.d_OMEGA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_OMEGA0)); | ||||||
|             ephemeris_record.d_OMEGA0 *= CNAV_OMEGA0_LSB; |             ephemeris_record.d_OMEGA0 *= CNAV_OMEGA0_LSB; | ||||||
| @@ -214,7 +214,7 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT | |||||||
|             break; |             break; | ||||||
|         case 30:  // (CLOCK, IONO, GRUP DELAY) |         case 30:  // (CLOCK, IONO, GRUP DELAY) | ||||||
|             //clock |             //clock | ||||||
|             ephemeris_record.d_Toc = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOC)); |             ephemeris_record.d_Toc = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOC)); | ||||||
|             ephemeris_record.d_Toc *= CNAV_TOC_LSB; |             ephemeris_record.d_Toc *= CNAV_TOC_LSB; | ||||||
|             ephemeris_record.d_URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA_NED0)); |             ephemeris_record.d_URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA_NED0)); | ||||||
|             ephemeris_record.d_URA1 = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_URA_NED1)); |             ephemeris_record.d_URA1 = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_URA_NED1)); | ||||||
| @@ -282,9 +282,9 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT | |||||||
|             b_flag_iono_valid = true; |             b_flag_iono_valid = true; | ||||||
|             break; |             break; | ||||||
|         case 33:  // (CLOCK & UTC) |         case 33:  // (CLOCK & UTC) | ||||||
|             ephemeris_record.d_Top = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOP1)); |             ephemeris_record.d_Top = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOP1)); | ||||||
|             ephemeris_record.d_Top = ephemeris_record.d_Top * CNAV_TOP1_LSB; |             ephemeris_record.d_Top = ephemeris_record.d_Top * CNAV_TOP1_LSB; | ||||||
|             ephemeris_record.d_Toc = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_TOC)); |             ephemeris_record.d_Toc = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOC)); | ||||||
|             ephemeris_record.d_Toc = ephemeris_record.d_Toc * CNAV_TOC_LSB; |             ephemeris_record.d_Toc = ephemeris_record.d_Toc * CNAV_TOC_LSB; | ||||||
|             ephemeris_record.d_A_f0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF0)); |             ephemeris_record.d_A_f0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF0)); | ||||||
|             ephemeris_record.d_A_f0 = ephemeris_record.d_A_f0 * CNAV_AF0_LSB; |             ephemeris_record.d_A_f0 = ephemeris_record.d_A_f0 * CNAV_AF0_LSB; | ||||||
| @@ -300,10 +300,10 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT | |||||||
|             utc_model_record.d_A2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A2)); |             utc_model_record.d_A2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A2)); | ||||||
|             utc_model_record.d_A2 = utc_model_record.d_A2 * CNAV_A2_LSB; |             utc_model_record.d_A2 = utc_model_record.d_A2 * CNAV_A2_LSB; | ||||||
|  |  | ||||||
|             utc_model_record.d_DeltaT_LS = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_TLS)); |             utc_model_record.d_DeltaT_LS = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DELTA_TLS)); | ||||||
|             utc_model_record.d_DeltaT_LS = utc_model_record.d_DeltaT_LS * CNAV_DELTA_TLS_LSB; |             utc_model_record.d_DeltaT_LS = utc_model_record.d_DeltaT_LS * CNAV_DELTA_TLS_LSB; | ||||||
|  |  | ||||||
|             utc_model_record.d_t_OT = static_cast<double>(read_navigation_signed(data_bits, CNAV_TOT)); |             utc_model_record.d_t_OT = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_TOT)); | ||||||
|             utc_model_record.d_t_OT = utc_model_record.d_t_OT * CNAV_TOT_LSB; |             utc_model_record.d_t_OT = utc_model_record.d_t_OT * CNAV_TOT_LSB; | ||||||
|  |  | ||||||
|             utc_model_record.i_WN_T = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_WN_OT)); |             utc_model_record.i_WN_T = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_WN_OT)); | ||||||
| @@ -315,7 +315,7 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT | |||||||
|             utc_model_record.i_DN = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DN)); |             utc_model_record.i_DN = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DN)); | ||||||
|             utc_model_record.i_DN = utc_model_record.i_DN * CNAV_DN_LSB; |             utc_model_record.i_DN = utc_model_record.i_DN * CNAV_DN_LSB; | ||||||
|  |  | ||||||
|             utc_model_record.d_DeltaT_LSF = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_TLSF)); |             utc_model_record.d_DeltaT_LSF = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DELTA_TLSF)); | ||||||
|             utc_model_record.d_DeltaT_LSF = utc_model_record.d_DeltaT_LSF * CNAV_DELTA_TLSF_LSB; |             utc_model_record.d_DeltaT_LSF = utc_model_record.d_DeltaT_LSF * CNAV_DELTA_TLSF_LSB; | ||||||
|             b_flag_utc_valid = true; |             b_flag_utc_valid = true; | ||||||
|             break; |             break; | ||||||
|   | |||||||
| @@ -65,7 +65,7 @@ private: | |||||||
|     Gps_CNAV_Utc_Model utc_model_record; |     Gps_CNAV_Utc_Model utc_model_record; | ||||||
|  |  | ||||||
| public: | public: | ||||||
|     double d_TOW; |     int32_t d_TOW; | ||||||
|     bool b_flag_ephemeris_1; |     bool b_flag_ephemeris_1; | ||||||
|     bool b_flag_ephemeris_2; |     bool b_flag_ephemeris_2; | ||||||
|     bool b_flag_iono_valid;  //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono |     bool b_flag_iono_valid;  //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono | ||||||
|   | |||||||
| @@ -37,12 +37,12 @@ Gps_CNAV_Utc_Model::Gps_CNAV_Utc_Model() | |||||||
|     d_A2 = 0.0; |     d_A2 = 0.0; | ||||||
|     d_A1 = 0.0; |     d_A1 = 0.0; | ||||||
|     d_A0 = 0.0; |     d_A0 = 0.0; | ||||||
|     d_t_OT = 0.0; |     d_t_OT = 0; | ||||||
|     i_WN_T = 0; |     i_WN_T = 0; | ||||||
|     d_DeltaT_LS = 0.0; |     d_DeltaT_LS = 0; | ||||||
|     i_WN_LSF = 0; |     i_WN_LSF = 0; | ||||||
|     i_DN = 0; |     i_DN = 0; | ||||||
|     d_DeltaT_LSF = 0.0; |     d_DeltaT_LSF = 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -49,12 +49,12 @@ public: | |||||||
|     double d_A2;           //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200H) [s/s] |     double d_A2;           //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200H) [s/s] | ||||||
|     double d_A1;           //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200H) [s/s] |     double d_A1;           //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200H) [s/s] | ||||||
|     double d_A0;           //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200H) [s] |     double d_A0;           //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200H) [s] | ||||||
|     double d_t_OT;        //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200H) [s] |     int32_t d_t_OT;        //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200H) [s] | ||||||
|     int32_t i_WN_T;        //!< UTC reference week number [weeks] |     int32_t i_WN_T;        //!< UTC reference week number [weeks] | ||||||
|     double d_DeltaT_LS;   //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. |     int32_t d_DeltaT_LS;   //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. | ||||||
|     int32_t i_WN_LSF;      //!< Week number at the end of which the leap second becomes effective [weeks] |     int32_t i_WN_LSF;      //!< Week number at the end of which the leap second becomes effective [weeks] | ||||||
|     int32_t i_DN;          //!< Day number (DN) at the end of which the leap second becomes effective [days] |     int32_t i_DN;          //!< Day number (DN) at the end of which the leap second becomes effective [days] | ||||||
|     double d_DeltaT_LSF;  //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] |     int32_t d_DeltaT_LSF;  //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * Default constructor |      * Default constructor | ||||||
|   | |||||||
| @@ -38,7 +38,7 @@ | |||||||
| Gps_Ephemeris::Gps_Ephemeris() | Gps_Ephemeris::Gps_Ephemeris() | ||||||
| { | { | ||||||
|     i_satellite_PRN = 0U; |     i_satellite_PRN = 0U; | ||||||
|     d_TOW = 0.0; |     d_TOW = 0; | ||||||
|     d_Crs = 0.0; |     d_Crs = 0.0; | ||||||
|     d_Delta_n = 0.0; |     d_Delta_n = 0.0; | ||||||
|     d_M_0 = 0.0; |     d_M_0 = 0.0; | ||||||
| @@ -46,8 +46,8 @@ Gps_Ephemeris::Gps_Ephemeris() | |||||||
|     d_e_eccentricity = 0.0; |     d_e_eccentricity = 0.0; | ||||||
|     d_Cus = 0.0; |     d_Cus = 0.0; | ||||||
|     d_sqrt_A = 0.0; |     d_sqrt_A = 0.0; | ||||||
|     d_Toe = 0.0; |     d_Toe = 0; | ||||||
|     d_Toc = 0.0; |     d_Toc = 0; | ||||||
|     d_Cic = 0.0; |     d_Cic = 0.0; | ||||||
|     d_OMEGA0 = 0.0; |     d_OMEGA0 = 0.0; | ||||||
|     d_Cis = 0.0; |     d_Cis = 0.0; | ||||||
| @@ -61,10 +61,10 @@ Gps_Ephemeris::Gps_Ephemeris() | |||||||
|     b_L2_P_data_flag = false; |     b_L2_P_data_flag = false; | ||||||
|     i_SV_accuracy = 0; |     i_SV_accuracy = 0; | ||||||
|     i_SV_health = 0; |     i_SV_health = 0; | ||||||
|     d_IODE_SF2 = 0.0; |     d_IODE_SF2 = 0; | ||||||
|     d_IODE_SF3 = 0.0; |     d_IODE_SF3 = 0; | ||||||
|     d_TGD = 0.0;  // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] |     d_TGD = 0.0;  // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] | ||||||
|     d_IODC = 0.0;  // Issue of Data, Clock |     d_IODC = 0;   // Issue of Data, Clock | ||||||
|     i_AODO = 0;   // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] |     i_AODO = 0;   // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] | ||||||
|  |  | ||||||
|     b_fit_interval_flag = false;  // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0  =  4 hours, 1  =  greater than 4 hours. |     b_fit_interval_flag = false;  // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0  =  4 hours, 1  =  greater than 4 hours. | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ private: | |||||||
|  |  | ||||||
| public: | public: | ||||||
|     uint32_t i_satellite_PRN;  // SV PRN NUMBER |     uint32_t i_satellite_PRN;  // SV PRN NUMBER | ||||||
|     double d_TOW;              //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] |     int32_t d_TOW;             //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] | ||||||
|     double d_Crs;              //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] |     double d_Crs;              //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] | ||||||
|     double d_Delta_n;          //!< Mean Motion Difference From Computed Value [semi-circles/s] |     double d_Delta_n;          //!< Mean Motion Difference From Computed Value [semi-circles/s] | ||||||
|     double d_M_0;              //!< Mean Anomaly at Reference Time [semi-circles] |     double d_M_0;              //!< Mean Anomaly at Reference Time [semi-circles] | ||||||
| @@ -68,8 +68,8 @@ public: | |||||||
|     double d_e_eccentricity;   //!< Eccentricity [dimensionless] |     double d_e_eccentricity;   //!< Eccentricity [dimensionless] | ||||||
|     double d_Cus;              //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] |     double d_Cus;              //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] | ||||||
|     double d_sqrt_A;           //!< Square Root of the Semi-Major Axis [sqrt(m)] |     double d_sqrt_A;           //!< Square Root of the Semi-Major Axis [sqrt(m)] | ||||||
|     double d_Toe;              //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] |     int32_t d_Toe;             //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] | ||||||
|     double d_Toc;              //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] |     int32_t d_Toc;             //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] | ||||||
|     double d_Cic;              //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] |     double d_Cic;              //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] | ||||||
|     double d_OMEGA0;           //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] |     double d_OMEGA0;           //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] | ||||||
|     double d_Cis;              //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] |     double d_Cis;              //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] | ||||||
| @@ -84,9 +84,9 @@ public: | |||||||
|     int32_t i_SV_accuracy;     //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) |     int32_t i_SV_accuracy;     //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) | ||||||
|     int32_t i_SV_health; |     int32_t i_SV_health; | ||||||
|     double d_TGD;        //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] |     double d_TGD;        //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] | ||||||
|     double d_IODC;      //!< Issue of Data, Clock |     int32_t d_IODC;      //!< Issue of Data, Clock | ||||||
|     double d_IODE_SF2;  //!< Issue of Data, Ephemeris (IODE), subframe 2 |     int32_t d_IODE_SF2;  //!< Issue of Data, Ephemeris (IODE), subframe 2 | ||||||
|     double d_IODE_SF3;  //!< Issue of Data, Ephemeris(IODE), subframe 3 |     int32_t d_IODE_SF3;  //!< Issue of Data, Ephemeris(IODE), subframe 3 | ||||||
|     int32_t i_AODO;      //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] |     int32_t i_AODO;      //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] | ||||||
|  |  | ||||||
|     bool b_fit_interval_flag;  //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. |     bool b_fit_interval_flag;  //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. | ||||||
|   | |||||||
| @@ -39,14 +39,14 @@ m * \file gps_navigation_message.cc | |||||||
| void Gps_Navigation_Message::reset() | void Gps_Navigation_Message::reset() | ||||||
| { | { | ||||||
|     b_valid_ephemeris_set_flag = false; |     b_valid_ephemeris_set_flag = false; | ||||||
|     d_TOW = 0.0; |     d_TOW = 0; | ||||||
|     d_TOW_SF1 = 0.0; |     d_TOW_SF1 = 0; | ||||||
|     d_TOW_SF2 = 0.0; |     d_TOW_SF2 = 0; | ||||||
|     d_TOW_SF3 = 0.0; |     d_TOW_SF3 = 0; | ||||||
|     d_TOW_SF4 = 0.0; |     d_TOW_SF4 = 0; | ||||||
|     d_TOW_SF5 = 0.0; |     d_TOW_SF5 = 0; | ||||||
|     d_IODE_SF2 = 0.0; |     d_IODE_SF2 = 0; | ||||||
|     d_IODE_SF3 = 0.0; |     d_IODE_SF3 = 0; | ||||||
|     d_Crs = 0.0; |     d_Crs = 0.0; | ||||||
|     d_Delta_n = 0.0; |     d_Delta_n = 0.0; | ||||||
|     d_M_0 = 0.0; |     d_M_0 = 0.0; | ||||||
| @@ -54,8 +54,8 @@ void Gps_Navigation_Message::reset() | |||||||
|     d_e_eccentricity = 0.0; |     d_e_eccentricity = 0.0; | ||||||
|     d_Cus = 0.0; |     d_Cus = 0.0; | ||||||
|     d_sqrt_A = 0.0; |     d_sqrt_A = 0.0; | ||||||
|     d_Toe = 0.0; |     d_Toe = 0; | ||||||
|     d_Toc = 0.0; |     d_Toc = 0; | ||||||
|     d_Cic = 0.0; |     d_Cic = 0.0; | ||||||
|     d_OMEGA0 = 0.0; |     d_OMEGA0 = 0.0; | ||||||
|     d_Cis = 0.0; |     d_Cis = 0.0; | ||||||
| @@ -70,7 +70,7 @@ void Gps_Navigation_Message::reset() | |||||||
|     i_SV_accuracy = 0; |     i_SV_accuracy = 0; | ||||||
|     i_SV_health = 0; |     i_SV_health = 0; | ||||||
|     d_TGD = 0.0; |     d_TGD = 0.0; | ||||||
|     d_IODC = -1.0; |     d_IODC = -1; | ||||||
|     i_AODO = 0; |     i_AODO = 0; | ||||||
|  |  | ||||||
|     b_fit_interval_flag = false; |     b_fit_interval_flag = false; | ||||||
| @@ -117,12 +117,12 @@ void Gps_Navigation_Message::reset() | |||||||
|     d_beta3 = 0.0; |     d_beta3 = 0.0; | ||||||
|     d_A1 = 0.0; |     d_A1 = 0.0; | ||||||
|     d_A0 = 0.0; |     d_A0 = 0.0; | ||||||
|     d_t_OT = 0.0; |     d_t_OT = 0; | ||||||
|     i_WN_T = 0; |     i_WN_T = 0; | ||||||
|     d_DeltaT_LS = 0.0; |     d_DeltaT_LS = 0; | ||||||
|     i_WN_LSF = 0; |     i_WN_LSF = 0; | ||||||
|     i_DN = 0; |     i_DN = 0; | ||||||
|     d_DeltaT_LSF = 0.0; |     d_DeltaT_LSF = 0; | ||||||
|  |  | ||||||
|     // Almanac |     // Almanac | ||||||
|     i_Toa = 0; |     i_Toa = 0; | ||||||
| @@ -257,9 +257,9 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|             // The transmitted TOW is actual TOW of the next subframe |             // The transmitted TOW is actual TOW of the next subframe | ||||||
|             // (the variable subframe at this point contains bits of the last subframe). |             // (the variable subframe at this point contains bits of the last subframe). | ||||||
|             //TOW = bin2dec(subframe(31:47)) * 6; |             //TOW = bin2dec(subframe(31:47)) * 6; | ||||||
|             d_TOW_SF1 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW)); |             d_TOW_SF1 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, TOW)); | ||||||
|             //we are in the first subframe (the transmitted TOW is the start time of the next subframe) ! |             //we are in the first subframe (the transmitted TOW is the start time of the next subframe) ! | ||||||
|             d_TOW_SF1 = d_TOW_SF1 * 6.0; |             d_TOW_SF1 = d_TOW_SF1 * 6; | ||||||
|             d_TOW = d_TOW_SF1;  // Set transmission time |             d_TOW = d_TOW_SF1;  // Set transmission time | ||||||
|             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); |             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); | ||||||
|             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); |             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); | ||||||
| @@ -271,8 +271,8 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|             i_code_on_L2 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2)); |             i_code_on_L2 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2)); | ||||||
|             d_TGD = static_cast<double>(read_navigation_signed(subframe_bits, T_GD)); |             d_TGD = static_cast<double>(read_navigation_signed(subframe_bits, T_GD)); | ||||||
|             d_TGD = d_TGD * T_GD_LSB; |             d_TGD = d_TGD * T_GD_LSB; | ||||||
|             d_IODC = static_cast<double>(read_navigation_unsigned(subframe_bits, IODC)); |             d_IODC = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, IODC)); | ||||||
|             d_Toc = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OC)); |             d_Toc = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, T_OC)); | ||||||
|             d_Toc = d_Toc * T_OC_LSB; |             d_Toc = d_Toc * T_OC_LSB; | ||||||
|             d_A_f0 = static_cast<double>(read_navigation_signed(subframe_bits, A_F0)); |             d_A_f0 = static_cast<double>(read_navigation_signed(subframe_bits, A_F0)); | ||||||
|             d_A_f0 = d_A_f0 * A_F0_LSB; |             d_A_f0 = d_A_f0 * A_F0_LSB; | ||||||
| @@ -283,13 +283,13 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|             break; |             break; | ||||||
|  |  | ||||||
|         case 2:  //--- It is subframe 2 ------------------- |         case 2:  //--- It is subframe 2 ------------------- | ||||||
|             d_TOW_SF2 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW)); |             d_TOW_SF2 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, TOW)); | ||||||
|             d_TOW_SF2 = d_TOW_SF2 * 6.0; |             d_TOW_SF2 = d_TOW_SF2 * 6; | ||||||
|             d_TOW = d_TOW_SF2;  // Set transmission time |             d_TOW = d_TOW_SF2;  // Set transmission time | ||||||
|             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); |             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); | ||||||
|             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); |             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); | ||||||
|             b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); |             b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); | ||||||
|             d_IODE_SF2 = static_cast<double>(read_navigation_unsigned(subframe_bits, IODE_SF2)); |             d_IODE_SF2 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, IODE_SF2)); | ||||||
|             d_Crs = static_cast<double>(read_navigation_signed(subframe_bits, C_RS)); |             d_Crs = static_cast<double>(read_navigation_signed(subframe_bits, C_RS)); | ||||||
|             d_Crs = d_Crs * C_RS_LSB; |             d_Crs = d_Crs * C_RS_LSB; | ||||||
|             d_Delta_n = static_cast<double>(read_navigation_signed(subframe_bits, DELTA_N)); |             d_Delta_n = static_cast<double>(read_navigation_signed(subframe_bits, DELTA_N)); | ||||||
| @@ -304,7 +304,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|             d_Cus = d_Cus * C_US_LSB; |             d_Cus = d_Cus * C_US_LSB; | ||||||
|             d_sqrt_A = static_cast<double>(read_navigation_unsigned(subframe_bits, SQRT_A)); |             d_sqrt_A = static_cast<double>(read_navigation_unsigned(subframe_bits, SQRT_A)); | ||||||
|             d_sqrt_A = d_sqrt_A * SQRT_A_LSB; |             d_sqrt_A = d_sqrt_A * SQRT_A_LSB; | ||||||
|             d_Toe = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OE)); |             d_Toe = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, T_OE)); | ||||||
|             d_Toe = d_Toe * T_OE_LSB; |             d_Toe = d_Toe * T_OE_LSB; | ||||||
|             b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG); |             b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG); | ||||||
|             i_AODO = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, AODO)); |             i_AODO = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, AODO)); | ||||||
| @@ -312,8 +312,8 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|             break; |             break; | ||||||
|  |  | ||||||
|         case 3:  // --- It is subframe 3 ------------------------------------- |         case 3:  // --- It is subframe 3 ------------------------------------- | ||||||
|             d_TOW_SF3 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW)); |             d_TOW_SF3 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, TOW)); | ||||||
|             d_TOW_SF3 = d_TOW_SF3 * 6.0; |             d_TOW_SF3 = d_TOW_SF3 * 6; | ||||||
|             d_TOW = d_TOW_SF3;  // Set transmission time |             d_TOW = d_TOW_SF3;  // Set transmission time | ||||||
|             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); |             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); | ||||||
|             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); |             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); | ||||||
| @@ -332,7 +332,7 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|             d_OMEGA = d_OMEGA * OMEGA_LSB; |             d_OMEGA = d_OMEGA * OMEGA_LSB; | ||||||
|             d_OMEGA_DOT = static_cast<double>(read_navigation_signed(subframe_bits, OMEGA_DOT)); |             d_OMEGA_DOT = static_cast<double>(read_navigation_signed(subframe_bits, OMEGA_DOT)); | ||||||
|             d_OMEGA_DOT = d_OMEGA_DOT * OMEGA_DOT_LSB; |             d_OMEGA_DOT = d_OMEGA_DOT * OMEGA_DOT_LSB; | ||||||
|             d_IODE_SF3 = static_cast<double>(read_navigation_unsigned(subframe_bits, IODE_SF3)); |             d_IODE_SF3 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, IODE_SF3)); | ||||||
|             d_IDOT = static_cast<double>(read_navigation_signed(subframe_bits, I_DOT)); |             d_IDOT = static_cast<double>(read_navigation_signed(subframe_bits, I_DOT)); | ||||||
|             d_IDOT = d_IDOT * I_DOT_LSB; |             d_IDOT = d_IDOT * I_DOT_LSB; | ||||||
|             break; |             break; | ||||||
| @@ -340,8 +340,8 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|         case 4:  // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32) |         case 4:  // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32) | ||||||
|             int32_t SV_data_ID; |             int32_t SV_data_ID; | ||||||
|             int32_t SV_page; |             int32_t SV_page; | ||||||
|             d_TOW_SF4 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW)); |             d_TOW_SF4 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, TOW)); | ||||||
|             d_TOW_SF4 = d_TOW_SF4 * 6.0; |             d_TOW_SF4 = d_TOW_SF4 * 6; | ||||||
|             d_TOW = d_TOW_SF4;  // Set transmission time |             d_TOW = d_TOW_SF4;  // Set transmission time | ||||||
|             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); |             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); | ||||||
|             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); |             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); | ||||||
| @@ -384,13 +384,13 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|                     d_A1 = d_A1 * A_1_LSB; |                     d_A1 = d_A1 * A_1_LSB; | ||||||
|                     d_A0 = static_cast<double>(read_navigation_signed(subframe_bits, A_0)); |                     d_A0 = static_cast<double>(read_navigation_signed(subframe_bits, A_0)); | ||||||
|                     d_A0 = d_A0 * A_0_LSB; |                     d_A0 = d_A0 * A_0_LSB; | ||||||
|                     d_t_OT = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OT)); |                     d_t_OT = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, T_OT)); | ||||||
|                     d_t_OT = d_t_OT * T_OT_LSB; |                     d_t_OT = d_t_OT * T_OT_LSB; | ||||||
|                     i_WN_T = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, WN_T)); |                     i_WN_T = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, WN_T)); | ||||||
|                     d_DeltaT_LS = static_cast<double>(read_navigation_signed(subframe_bits, DELTAT_LS)); |                     d_DeltaT_LS = static_cast<int32_t>(read_navigation_signed(subframe_bits, DELTAT_LS)); | ||||||
|                     i_WN_LSF = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, WN_LSF)); |                     i_WN_LSF = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, WN_LSF)); | ||||||
|                     i_DN = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, DN));  // Right-justified ? |                     i_DN = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, DN));  // Right-justified ? | ||||||
|                     d_DeltaT_LSF = static_cast<double>(read_navigation_signed(subframe_bits, DELTAT_LSF)); |                     d_DeltaT_LSF = static_cast<int32_t>(read_navigation_signed(subframe_bits, DELTAT_LSF)); | ||||||
|                     flag_iono_valid = true; |                     flag_iono_valid = true; | ||||||
|                     flag_utc_model_valid = true; |                     flag_utc_model_valid = true; | ||||||
|                 } |                 } | ||||||
| @@ -417,8 +417,8 @@ int32_t Gps_Navigation_Message::subframe_decoder(char* subframe) | |||||||
|         case 5:  //--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time. |         case 5:  //--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time. | ||||||
|             int32_t SV_data_ID_5; |             int32_t SV_data_ID_5; | ||||||
|             int32_t SV_page_5; |             int32_t SV_page_5; | ||||||
|             d_TOW_SF5 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW)); |             d_TOW_SF5 = static_cast<int32_t>(read_navigation_unsigned(subframe_bits, TOW)); | ||||||
|             d_TOW_SF5 = d_TOW_SF5 * 6.0; |             d_TOW_SF5 = d_TOW_SF5 * 6; | ||||||
|             d_TOW = d_TOW_SF5;  // Set transmission time |             d_TOW = d_TOW_SF5;  // Set transmission time | ||||||
|             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); |             b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG); | ||||||
|             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); |             b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG); | ||||||
|   | |||||||
| @@ -62,14 +62,14 @@ private: | |||||||
| public: | public: | ||||||
|     bool b_valid_ephemeris_set_flag;  // flag indicating that this ephemeris set have passed the validation check |     bool b_valid_ephemeris_set_flag;  // flag indicating that this ephemeris set have passed the validation check | ||||||
|     // broadcast orbit 1 |     // broadcast orbit 1 | ||||||
|     double d_TOW;      //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] |     int32_t d_TOW;      //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] | ||||||
|     double d_TOW_SF1;  //!< Time of GPS Week from HOW word of Subframe 1 [s] |     int32_t d_TOW_SF1;  //!< Time of GPS Week from HOW word of Subframe 1 [s] | ||||||
|     double d_TOW_SF2;  //!< Time of GPS Week from HOW word of Subframe 2 [s] |     int32_t d_TOW_SF2;  //!< Time of GPS Week from HOW word of Subframe 2 [s] | ||||||
|     double d_TOW_SF3;  //!< Time of GPS Week from HOW word of Subframe 3 [s] |     int32_t d_TOW_SF3;  //!< Time of GPS Week from HOW word of Subframe 3 [s] | ||||||
|     double d_TOW_SF4;  //!< Time of GPS Week from HOW word of Subframe 4 [s] |     int32_t d_TOW_SF4;  //!< Time of GPS Week from HOW word of Subframe 4 [s] | ||||||
|     double d_TOW_SF5;  //!< Time of GPS Week from HOW word of Subframe 5 [s] |     int32_t d_TOW_SF5;  //!< Time of GPS Week from HOW word of Subframe 5 [s] | ||||||
|     double d_IODE_SF2; |     int32_t d_IODE_SF2; | ||||||
|     double d_IODE_SF3; |     int32_t d_IODE_SF3; | ||||||
|     double d_Crs;      //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] |     double d_Crs;      //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] | ||||||
|     double d_Delta_n;  //!< Mean Motion Difference From Computed Value [semi-circles/s] |     double d_Delta_n;  //!< Mean Motion Difference From Computed Value [semi-circles/s] | ||||||
|     double d_M_0;      //!< Mean Anomaly at Reference Time [semi-circles] |     double d_M_0;      //!< Mean Anomaly at Reference Time [semi-circles] | ||||||
| @@ -79,8 +79,8 @@ public: | |||||||
|     double d_Cus;             //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] |     double d_Cus;             //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] | ||||||
|     double d_sqrt_A;          //!< Square Root of the Semi-Major Axis [sqrt(m)] |     double d_sqrt_A;          //!< Square Root of the Semi-Major Axis [sqrt(m)] | ||||||
|     // broadcast orbit 3 |     // broadcast orbit 3 | ||||||
|     double d_Toe;     //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] |     int32_t d_Toe;    //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] | ||||||
|     double d_Toc;     //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] |     int32_t d_Toc;    //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] | ||||||
|     double d_Cic;     //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] |     double d_Cic;     //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] | ||||||
|     double d_OMEGA0;  //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] |     double d_OMEGA0;  //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] | ||||||
|     double d_Cis;     //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] |     double d_Cis;     //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] | ||||||
| @@ -98,7 +98,7 @@ public: | |||||||
|     int32_t i_SV_accuracy;  //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) |     int32_t i_SV_accuracy;  //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) | ||||||
|     int32_t i_SV_health; |     int32_t i_SV_health; | ||||||
|     double d_TGD;    //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] |     double d_TGD;    //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] | ||||||
|     double d_IODC;  //!< Issue of Data, Clock |     int32_t d_IODC;  //!< Issue of Data, Clock | ||||||
|     // broadcast orbit 7 |     // broadcast orbit 7 | ||||||
|     int32_t i_AODO;            //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] |     int32_t i_AODO;            //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] | ||||||
|     bool b_fit_interval_flag;  //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. |     bool b_fit_interval_flag;  //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. | ||||||
| @@ -162,14 +162,15 @@ public: | |||||||
|  |  | ||||||
|     // UTC parameters |     // UTC parameters | ||||||
|     bool flag_utc_model_valid;  //!< If set, it indicates that the UTC model parameters are filled |     bool flag_utc_model_valid;  //!< If set, it indicates that the UTC model parameters are filled | ||||||
|     double d_A1;                //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] |  | ||||||
|     double d_A0;                //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s] |     double d_A0;                //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s] | ||||||
|     double d_t_OT;              //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200E) [s] |     double d_A1;                //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] | ||||||
|  |     double d_A2;                //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] | ||||||
|  |     int32_t d_t_OT;             //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200E) [s] | ||||||
|     int32_t i_WN_T;             //!< UTC reference week number [weeks] |     int32_t i_WN_T;             //!< UTC reference week number [weeks] | ||||||
|     double d_DeltaT_LS;         //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. |     int32_t d_DeltaT_LS;        //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. | ||||||
|     int32_t i_WN_LSF;           //!< Week number at the end of which the leap second becomes effective [weeks] |     int32_t i_WN_LSF;           //!< Week number at the end of which the leap second becomes effective [weeks] | ||||||
|     int32_t i_DN;               //!< Day number (DN) at the end of which the leap second becomes effective [days] |     int32_t i_DN;               //!< Day number (DN) at the end of which the leap second becomes effective [days] | ||||||
|     double d_DeltaT_LSF;        //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] |     int32_t d_DeltaT_LSF;       //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] | ||||||
|  |  | ||||||
|     // Satellite velocity |     // Satellite velocity | ||||||
|     double d_satvel_X;  //!< Earth-fixed velocity coordinate x of the satellite [m] |     double d_satvel_X;  //!< Earth-fixed velocity coordinate x of the satellite [m] | ||||||
|   | |||||||
| @@ -35,14 +35,15 @@ | |||||||
| Gps_Utc_Model::Gps_Utc_Model() | Gps_Utc_Model::Gps_Utc_Model() | ||||||
| { | { | ||||||
|     valid = false; |     valid = false; | ||||||
|     d_A1 = 0.0; |  | ||||||
|     d_A0 = 0.0; |     d_A0 = 0.0; | ||||||
|     d_t_OT = 0.0; |     d_A1 = 0.0; | ||||||
|  |     d_A2 = 0.0; | ||||||
|  |     d_t_OT = 0; | ||||||
|     i_WN_T = 0; |     i_WN_T = 0; | ||||||
|     d_DeltaT_LS = 0.0; |     d_DeltaT_LS = 0; | ||||||
|     i_WN_LSF = 0; |     i_WN_LSF = 0; | ||||||
|     i_DN = 0; |     i_DN = 0; | ||||||
|     d_DeltaT_LSF = 0.0; |     d_DeltaT_LSF = 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -45,14 +45,15 @@ class Gps_Utc_Model | |||||||
| public: | public: | ||||||
|     bool valid; |     bool valid; | ||||||
|     // UTC parameters |     // UTC parameters | ||||||
|     double d_A1;          //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] |  | ||||||
|     double d_A0;           //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s] |     double d_A0;           //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s] | ||||||
|     double d_t_OT;        //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200E) [s] |     double d_A1;           //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] | ||||||
|  |     double d_A2;           //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] | ||||||
|  |     int32_t d_t_OT;        //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200E) [s] | ||||||
|     int32_t i_WN_T;        //!< UTC reference week number [weeks] |     int32_t i_WN_T;        //!< UTC reference week number [weeks] | ||||||
|     double d_DeltaT_LS;   //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. |     int32_t d_DeltaT_LS;   //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. | ||||||
|     int32_t i_WN_LSF;      //!< Week number at the end of which the leap second becomes effective [weeks] |     int32_t i_WN_LSF;      //!< Week number at the end of which the leap second becomes effective [weeks] | ||||||
|     int32_t i_DN;          //!< Day number (DN) at the end of which the leap second becomes effective [days] |     int32_t i_DN;          //!< Day number (DN) at the end of which the leap second becomes effective [days] | ||||||
|     double d_DeltaT_LSF;  //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] |     int32_t d_DeltaT_LSF;  //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * Default constructor |      * Default constructor | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez