diff --git a/src/algorithms/observables/adapters/gps_l1_ca_observables.cc b/src/algorithms/observables/adapters/gps_l1_ca_observables.cc index 3d23c38e4..ef338924f 100644 --- a/src/algorithms/observables/adapters/gps_l1_ca_observables.cc +++ b/src/algorithms/observables/adapters/gps_l1_ca_observables.cc @@ -1,12 +1,12 @@ /*! * \file gps_l1_ca_observables.cc * \brief Implementation of an adapter of a GPS L1 C/A observables block - * to a SignalConditionerInterface + * to a ObservablesInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver diff --git a/src/algorithms/observables/adapters/gps_l1_ca_observables.h b/src/algorithms/observables/adapters/gps_l1_ca_observables.h index 62dde1b32..a1ce4055e 100644 --- a/src/algorithms/observables/adapters/gps_l1_ca_observables.h +++ b/src/algorithms/observables/adapters/gps_l1_ca_observables.h @@ -1,12 +1,12 @@ /*! * \file gps_l1_ca_observables.h * \brief Interface of an adapter of a GPS L1 C/A observables block - * to a SignalConditionerInterface + * to a ObservablesInterface * \author Javier Arribas, 2011. jarribas(at)cttc.es * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index b1cf98887..301e64166 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -223,6 +223,9 @@ const bits_slice SQRT_A[]= {{227,8},{241,24}}; const double SQRT_A_LSB=TWO_N19; const bits_slice T_OE[]= {{271,16}}; const double T_OE_LSB=TWO_P4; +const bits_slice FIT_INTERVAL_FLAG[]= {{271,1}}; +const bits_slice AODO[] = {{272,5}}; +const int AODO_LSB = 900; // SUBFRAME 3 @@ -289,9 +292,55 @@ const double DN_LSB = 1; const bits_slice DELTAT_LSF[]= {{271,8}}; const double DELTAT_LSF_LSB = 1; +// Page 25 - Antispoofing, SV config and SV health (PRN 25 -32) +const bits_slice HEALTH_SV25[]={{229,6}}; +const bits_slice HEALTH_SV26[]={{241,6}}; +const bits_slice HEALTH_SV27[]={{247,6}}; +const bits_slice HEALTH_SV28[]={{253,6}}; +const bits_slice HEALTH_SV29[]={{259,6}}; +const bits_slice HEALTH_SV30[]={{271,6}}; +const bits_slice HEALTH_SV31[]={{277,6}}; +const bits_slice HEALTH_SV32[]={{283,6}}; + + + // SUBFRAME 5 //! \todo read all pages of subframe 5 + +// page 25 - Health (PRN 1 - 24) +const bits_slice T_OA[]={{69,8}}; +const double T_OA_LSB = TWO_P12; +const bits_slice WN_A[]={{77,8}}; +const bits_slice HEALTH_SV1[]={{91,6}}; +const bits_slice HEALTH_SV2[]={{97,6}}; +const bits_slice HEALTH_SV3[]={{103,6}}; +const bits_slice HEALTH_SV4[]={{109,6}}; +const bits_slice HEALTH_SV5[]={{121,6}}; +const bits_slice HEALTH_SV6[]={{127,6}}; +const bits_slice HEALTH_SV7[]={{133,6}}; +const bits_slice HEALTH_SV8[]={{139,6}}; +const bits_slice HEALTH_SV9[]={{151,6}}; +const bits_slice HEALTH_SV10[]={{157,6}}; +const bits_slice HEALTH_SV11[]={{163,6}}; +const bits_slice HEALTH_SV12[]={{169,6}}; +const bits_slice HEALTH_SV13[]={{181,6}}; +const bits_slice HEALTH_SV14[]={{187,6}}; +const bits_slice HEALTH_SV15[]={{193,6}}; +const bits_slice HEALTH_SV16[]={{199,6}}; +const bits_slice HEALTH_SV17[]={{211,6}}; +const bits_slice HEALTH_SV18[]={{217,6}}; +const bits_slice HEALTH_SV19[]={{223,6}}; +const bits_slice HEALTH_SV20[]={{229,6}}; +const bits_slice HEALTH_SV21[]={{241,6}}; +const bits_slice HEALTH_SV22[]={{247,6}}; +const bits_slice HEALTH_SV23[]={{253,6}}; +const bits_slice HEALTH_SV24[]={{259,6}}; + + + + + #endif /* GNSS_SDR_GPS_L1_CA_H_ */ diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 5c9a3f3e0..ac3f86059 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -32,48 +32,41 @@ #include "gps_navigation_message.h" - #define num_of_slices(x) sizeof(x)/sizeof(bits_slice) void gps_navigation_message::reset() { d_TOW=0; - //broadcast orbit 1 d_IODE_SF2=0; d_IODE_SF3=0; d_Crs=0; d_Delta_n=0; d_M_0=0; - //broadcast orbit 2 d_Cuc=0; d_e_eccentricity=0; d_Cus=0; d_sqrt_A=0; - //broadcast orbit 3 d_Toe=0; d_Toc=0; d_Cic=0; d_OMEGA0=0; d_Cis=0; - //broadcast orbit 4 d_i_0=0; d_Crc=0; d_OMEGA=0; d_OMEGA_DOT=0; - //broadcast orbit 5 d_IDOT=0; - d_codes_on_L2=0; - d_GPS_week=0; + i_code_on_L2=0; + i_GPS_week=0; b_L2_P_data_flag=false; - //broadcast orbit 6 - d_SV_accuracy=0; - d_SV_health=0; + i_SV_accuracy=0; + i_SV_health=0; d_TGD=0; d_IODC=-1; - //broadcast orbit 7 + i_AODO=0; - d_fit_interval=0; + b_fit_interval_flag=false; d_spare1=0; d_spare2=0; @@ -116,12 +109,20 @@ void gps_navigation_message::reset() d_A1=0; d_A0=0; d_t_OT=0; - d_WN_T=0; + i_WN_T=0; d_DeltaT_LS=0; - d_WN_LSF=0; - d_DN=0; + i_WN_LSF=0; + i_DN=0; d_DeltaT_LSF=0; + + //Almanac + d_Toa = 0; + i_WN_A = 0; + for (int i=1; i < 32; i++ ) + { + almanacHealth[i]=0; + } } @@ -430,12 +431,12 @@ int gps_navigation_message::subframe_decoder(char *subframe) b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG); // It contains WN, SV clock corrections, health and accuracy - d_GPS_week = (double)read_navigation_unsigned(subframe_bits,GPS_WEEK,num_of_slices(GPS_WEEK)); - d_SV_accuracy = (double)read_navigation_unsigned(subframe_bits,SV_ACCURACY,num_of_slices(SV_ACCURACY)); //should be an int (20.3.3.3.1.3) - d_SV_health = (double)read_navigation_unsigned(subframe_bits,SV_HEALTH,num_of_slices(SV_HEALTH)); + i_GPS_week = (int)read_navigation_unsigned(subframe_bits,GPS_WEEK,num_of_slices(GPS_WEEK)); + i_SV_accuracy = (int)read_navigation_unsigned(subframe_bits,SV_ACCURACY,num_of_slices(SV_ACCURACY)); // (20.3.3.3.1.3) + i_SV_health = (int)read_navigation_unsigned(subframe_bits,SV_HEALTH,num_of_slices(SV_HEALTH)); b_L2_P_data_flag = read_navigation_bool(subframe_bits,L2_P_DATA_FLAG); // - d_codes_on_L2 = (double)read_navigation_unsigned(subframe_bits,CA_OR_P_ON_L2,num_of_slices(CA_OR_P_ON_L2)); + i_code_on_L2 = (int)read_navigation_unsigned(subframe_bits,CA_OR_P_ON_L2,num_of_slices(CA_OR_P_ON_L2)); d_TGD = (double)read_navigation_signed(subframe_bits,T_GD,num_of_slices(T_GD)); d_TGD = d_TGD*T_GD_LSB; d_IODC = (double)read_navigation_unsigned(subframe_bits,IODC,num_of_slices(IODC)); @@ -462,15 +463,11 @@ int gps_navigation_message::subframe_decoder(char *subframe) */ break; - case 2: - //tmp_TOW=(double)read_navigation_unsigned(subframe_bits,TOW,num_of_slices(TOW)); - //std::cout<<"tmp_TOW="< almanacHealth; + // Flags /*! \brief If true, enhanced level of integrity assurance. @@ -165,10 +172,10 @@ public: 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_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_WN_T; //!< UTC reference week number [weeks] + int i_WN_T; //!< UTC reference week number [weeks] double d_DeltaT_LS; //!< delta time due to leap seconds [s] - double d_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - double d_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] + int i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] + int 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]