Changeset 8783 in ntrip


Ignore:
Timestamp:
Jul 19, 2019, 1:27:47 PM (3 months ago)
Author:
stuerze
Message:

initial input regarding IRNSS RTCM data decoding

Location:
trunk/BNC/src/RTCM3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r8708 r8783  
    421421    };
    422422
     423/**
     424 * MSM signal types for IRNSS
     425 *
     426 * NOTE: Uses 0.0, 1.0 for wavelength as sat index dependence is done later!
     427 */
     428static struct CodeData irn[RTCM3_MSM_NUMSIG] = {
     429        {0.0, 0},
     430        {0.0, 0},
     431        {0.0, 0},
     432        {0.0, 0},
     433        {0.0, 0},
     434        {0.0, 0},
     435        {0.0, 0},
     436        {IRNSS_WAVELENGTH_S, "9A"},
     437        {0.0, 0},
     438        {0.0, 0},
     439        {0.0, 0},
     440        {0.0, 0},
     441        {0.0, 0},
     442        {0.0, 0},
     443        {0.0, 0},
     444        {0.0, 0},
     445        {0.0, 0},
     446        {0.0, 0},
     447        {0.0, 0},
     448        {0.0, 0},
     449        {0.0, 0},
     450        {IRNSS_WAVELENGTH_L5, "5A"},
     451        {0.0, 0},
     452        {0.0, 0},
     453        {0.0, 0},
     454        {0.0, 0},
     455        {0.0, 0},
     456        {0.0, 0},
     457        {0.0, 0},
     458        {0.0, 0},
     459        {0.0, 0},
     460        {0.0, 0}
     461    };
     462
    423463#define UINT64(c) c ## ULL
    424464
     
    438478  /* id */
    439479  char sys;
    440   if (type >= 1121)
     480  if      (type >= 1121)
    441481    sys = 'C';
    442482  else if (type >= 1111)
     
    448488  else if (type >= 1081)
    449489    sys = 'R';
    450   else
     490  else if (type >= 1071)
    451491    sys = 'G';
     492  else if (type >=   21) // test
     493    sys = 'I';
    452494
    453495  bncTime CurrentObsTime;
    454   if (sys == 'C') /* BDS */ {
     496  if      (sys == 'C') /* BDS */ {
    455497    GETBITS(i, 30)
    456498    CurrentObsTime.setBDS(i);
     
    700742              cd = gal[RTCM3_MSM_NUMSIG - j - 1];
    701743              break;
     744            case 'I':
     745              cd = irn[RTCM3_MSM_NUMSIG - j - 1];
     746              break;
    702747          }
    703748          if (cd.code) {
     
    10021047    i <<= 4;
    10031048    eph._TOC.set(i * 1000);
    1004     GETFLOATSIGN(eph._clock_driftrate, 8,
    1005         1.0 / (double )(1 << 30) / (double )(1 << 25))
    1006     GETFLOATSIGN(eph._clock_drift, 16,
    1007         1.0 / (double )(1 << 30) / (double )(1 << 13))
    1008     GETFLOATSIGN(eph._clock_bias, 22,
    1009         1.0 / (double )(1 << 30) / (double )(1 << 1))
     1049    GETFLOATSIGN(eph._clock_driftrate, 8, 1.0 / (double )(1 << 30) / (double )(1 << 25))
     1050    GETFLOATSIGN(eph._clock_drift,    16, 1.0 / (double )(1 << 30) / (double )(1 << 13))
     1051    GETFLOATSIGN(eph._clock_bias,     22, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    10101052    GETBITS(eph._IODC, 10)
    1011     GETFLOATSIGN(eph._Crs, 16, 1.0 / (double )(1 << 5))
    1012     GETFLOATSIGN(eph._Delta_n, 16, R2R_PI/(double)(1<<30)/(double)(1<<13))
    1013     GETFLOATSIGN(eph._M0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1014     GETFLOATSIGN(eph._Cuc, 16, 1.0 / (double )(1 << 29))
    1015     GETFLOAT(eph._e, 32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
    1016     GETFLOATSIGN(eph._Cus, 16, 1.0 / (double )(1 << 29))
    1017     GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19))
     1053    GETFLOATSIGN(eph._Crs,            16, 1.0 / (double )(1 << 5))
     1054    GETFLOATSIGN(eph._Delta_n,        16, R2R_PI/(double)(1<<30)/(double)(1<<13))
     1055    GETFLOATSIGN(eph._M0,             32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1056    GETFLOATSIGN(eph._Cuc,            16, 1.0 / (double )(1 << 29))
     1057    GETFLOAT(eph._e,                  32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
     1058    GETFLOATSIGN(eph._Cus,            16, 1.0 / (double )(1 << 29))
     1059    GETFLOAT(eph._sqrt_A,             32, 1.0 / (double )(1 << 19))
    10181060    GETBITS(i, 16)
    10191061    i <<= 4;
     
    10271069    if (eph._TOEweek > week + 1 || eph._TOEweek < week - 1) /* invalid week */
    10281070      return false;
    1029     GETFLOATSIGN(eph._Cic, 16, 1.0 / (double )(1 << 29))
    1030     GETFLOATSIGN(eph._OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1031     GETFLOATSIGN(eph._Cis, 16, 1.0 / (double )(1 << 29))
    1032     GETFLOATSIGN(eph._i0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1033     GETFLOATSIGN(eph._Crc, 16, 1.0 / (double )(1 << 5))
    1034     GETFLOATSIGN(eph._omega, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1071    GETFLOATSIGN(eph._Cic,      16, 1.0 / (double )(1 << 29))
     1072    GETFLOATSIGN(eph._OMEGA0,   32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1073    GETFLOATSIGN(eph._Cis,      16, 1.0 / (double )(1 << 29))
     1074    GETFLOATSIGN(eph._i0,       32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1075    GETFLOATSIGN(eph._Crc,      16, 1.0 / (double )(1 << 5))
     1076    GETFLOATSIGN(eph._omega,    32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    10351077    GETFLOATSIGN(eph._OMEGADOT, 24, R2R_PI/(double)(1<<30)/(double)(1<<13))
    1036     GETFLOATSIGN(eph._TGD, 8, 1.0 / (double )(1 << 30) / (double )(1 << 1))
     1078    GETFLOATSIGN(eph._TGD,       8, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    10371079    GETBITS(eph._health, 6)
    10381080    GETBITS(eph._L2PFlag, 1)
     
    10821124    eph._TOC.setTk(i * 15 * 60 * 1000); /* tb */
    10831125
    1084     GETFLOATSIGNM(eph._x_velocity, 24, 1.0 / (double )(1 << 20))
    1085     GETFLOATSIGNM(eph._x_pos, 27, 1.0 / (double )(1 << 11))
     1126    GETFLOATSIGNM(eph._x_velocity,    24, 1.0 / (double )(1 << 20))
     1127    GETFLOATSIGNM(eph._x_pos,         27, 1.0 / (double )(1 << 11))
    10861128    GETFLOATSIGNM(eph._x_acceleration, 5, 1.0 / (double )(1 << 30))
    1087     GETFLOATSIGNM(eph._y_velocity, 24, 1.0 / (double )(1 << 20))
    1088     GETFLOATSIGNM(eph._y_pos, 27, 1.0 / (double )(1 << 11))
     1129    GETFLOATSIGNM(eph._y_velocity,    24, 1.0 / (double )(1 << 20))
     1130    GETFLOATSIGNM(eph._y_pos,         27, 1.0 / (double )(1 << 11))
    10891131    GETFLOATSIGNM(eph._y_acceleration, 5, 1.0 / (double )(1 << 30))
    1090     GETFLOATSIGNM(eph._z_velocity, 24, 1.0 / (double )(1 << 20))
    1091     GETFLOATSIGNM(eph._z_pos, 27, 1.0 / (double )(1 << 11))
     1132    GETFLOATSIGNM(eph._z_velocity,    24, 1.0 / (double )(1 << 20))
     1133    GETFLOATSIGNM(eph._z_pos,         27, 1.0 / (double )(1 << 11))
    10921134    GETFLOATSIGNM(eph._z_acceleration, 5, 1.0 / (double )(1 << 30))
    10931135
    10941136    GETBITS(eph._P3, 1)    /* P3 */
    1095     GETFLOATSIGNM(eph._gamma, 11, 1.0 / (double )(1 << 30) / (double )(1 << 10))
    1096     GETBITS(eph._M_P, 2) /* GLONASS-M P, */
     1137    GETFLOATSIGNM(eph._gamma,      11, 1.0 / (double )(1 << 30) / (double )(1 << 10))
     1138    GETBITS(eph._M_P,  2) /* GLONASS-M P, */
    10971139    GETBITS(eph._M_l3, 1) /*GLONASS-M ln (third string) */
    1098     GETFLOATSIGNM(eph._tau, 22, 1.0 / (double )(1 << 30))    /* GLONASS tau n(tb) */
     1140    GETFLOATSIGNM(eph._tau,        22, 1.0 / (double )(1 << 30))    /* GLONASS tau n(tb) */
    10991141    GETFLOATSIGNM(eph._M_delta_tau, 5, 1.0 / (double )(1 << 30))  /* GLONASS-M delta tau n(tb) */
    11001142    GETBITS(eph._E, 5)
    1101     GETBITS(eph._M_P4, 1) /* GLONASS-M P4 */
    1102     GETBITS(eph._M_FT, 4) /* GLONASS-M Ft */
     1143    GETBITS(eph._M_P4,  1) /* GLONASS-M P4 */
     1144    GETBITS(eph._M_FT,  4) /* GLONASS-M Ft */
    11031145    GETBITS(eph._M_NT, 11) /* GLONASS-M Nt */
    1104     GETBITS(eph._M_M, 2) /* GLONASS-M M */
     1146    GETBITS(eph._M_M,   2) /* GLONASS-M M */
    11051147    GETBITS(eph._additional_data_availability, 1) /* GLONASS-M The Availability of Additional Data */
    1106     GETBITS(eph._NA, 11) /* GLONASS-M Na */
    1107     GETFLOATSIGNM(eph._tauC, 32, 1.0/(double)(1<<30)/(double)(1<<1)) /* GLONASS tau c */
     1148    GETBITS(eph._NA,  11) /* GLONASS-M Na */
     1149    GETFLOATSIGNM(eph._tauC,       32, 1.0/(double)(1<<30)/(double)(1<<1)) /* GLONASS tau c */
    11081150    GETBITS(eph._M_N4, 5) /* GLONASS-M N4 */
    1109     GETFLOATSIGNM(eph._M_tau_GPS, 22, 1.0/(double)(1<<30)) /* GLONASS-M tau GPS */
     1151    GETFLOATSIGNM(eph._M_tau_GPS,  22, 1.0/(double)(1<<30)) /* GLONASS-M tau GPS */
    11101152    GETBITS(eph._M_l5, 1) /* GLONASS-M ln (fifth string) */
    11111153
     
    11141156    eph._gps_utc = gnumleap(year, month, day);
    11151157    eph._tt = eph._TOC;
    1116    
     1158
    11171159    eph._xv(1) = eph._x_pos * 1.e3;
    11181160    eph._xv(2) = eph._y_pos * 1.e3;
     
    11541196    eph._TOC.set(i * 1000);
    11551197
    1156     GETFLOATSIGN(eph._clock_driftrate, 8,
    1157         1.0 / (double )(1 << 30) / (double )(1 << 25))
    1158     GETFLOATSIGN(eph._clock_drift, 16,
    1159         1.0 / (double )(1 << 30) / (double )(1 << 13))
    1160     GETFLOATSIGN(eph._clock_bias, 22,
    1161         1.0 / (double )(1 << 30) / (double )(1 << 1))
     1198    GETFLOATSIGN(eph._clock_driftrate, 8, 1.0 / (double )(1 << 30) / (double )(1 << 25))
     1199    GETFLOATSIGN(eph._clock_drift,    16, 1.0 / (double )(1 << 30) / (double )(1 << 13))
     1200    GETFLOATSIGN(eph._clock_bias,     22, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    11621201    GETBITS(eph._IODE, 8)
    1163     GETFLOATSIGN(eph._Crs, 16, 1.0 / (double )(1 << 5))
     1202    GETFLOATSIGN(eph._Crs,     16, 1.0 / (double )(1 << 5))
    11641203    GETFLOATSIGN(eph._Delta_n, 16, R2R_PI/(double)(1<<30)/(double)(1<<13))
    1165     GETFLOATSIGN(eph._M0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1166     GETFLOATSIGN(eph._Cuc, 16, 1.0 / (double )(1 << 29))
    1167     GETFLOAT(eph._e, 32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
    1168     GETFLOATSIGN(eph._Cus, 16, 1.0 / (double )(1 << 29))
    1169     GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19))
     1204    GETFLOATSIGN(eph._M0,      32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1205    GETFLOATSIGN(eph._Cuc,     16, 1.0 / (double )(1 << 29))
     1206    GETFLOAT(eph._e,           32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
     1207    GETFLOATSIGN(eph._Cus,     16, 1.0 / (double )(1 << 29))
     1208    GETFLOAT(eph._sqrt_A,      32, 1.0 / (double )(1 << 19))
    11701209    GETBITS(i, 16)
    11711210    i <<= 4;
     
    11741213    t.set(i*1000);
    11751214    eph._TOEweek = t.gpsw();
    1176     GETFLOATSIGN(eph._Cic, 16, 1.0 / (double )(1 << 29))
    1177     GETFLOATSIGN(eph._OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1178     GETFLOATSIGN(eph._Cis, 16, 1.0 / (double )(1 << 29))
    1179     GETFLOATSIGN(eph._i0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1180     GETFLOATSIGN(eph._Crc, 16, 1.0 / (double )(1 << 5))
    1181     GETFLOATSIGN(eph._omega, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1215    GETFLOATSIGN(eph._Cic,      16, 1.0 / (double )(1 << 29))
     1216    GETFLOATSIGN(eph._OMEGA0,   32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1217    GETFLOATSIGN(eph._Cis,      16, 1.0 / (double )(1 << 29))
     1218    GETFLOATSIGN(eph._i0,       32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1219    GETFLOATSIGN(eph._Crc,      16, 1.0 / (double )(1 << 5))
     1220    GETFLOATSIGN(eph._omega,    32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    11821221    GETFLOATSIGN(eph._OMEGADOT, 24, R2R_PI/(double)(1<<30)/(double)(1<<13))
    1183     GETFLOATSIGN(eph._IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13))
     1222    GETFLOATSIGN(eph._IDOT,     14, R2R_PI/(double)(1<<30)/(double)(1<<13))
    11841223    GETBITS(eph._L2Codes, 2)
    11851224    GETBITS(week, 10)
     
    11961235      eph._ura = ceil(10.0 * pow(2.0, i / 2.0)) / 10.0;
    11971236    GETBITS(eph._health, 6)
    1198     GETFLOATSIGN(eph._TGD, 8, 1.0 / (double )(1 << 30) / (double )(1 << 1))
     1237    GETFLOATSIGN(eph._TGD,       8, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    11991238    GETBITS(eph._IODC, 10)
    12001239    GETBITS(eph._fitInterval, 1)
    12011240    eph._TOT = 0.9999e9;
    1202     eph._L2PFlag = 0; /* does not exist for QZSS */
     1241
     1242    emit newGPSEph(eph);
     1243    decoded = true;
     1244  }
     1245  return decoded;
     1246}
     1247
     1248//
     1249////////////////////////////////////////////////////////////////////////////
     1250bool RTCM3Decoder::DecodeIRNSSEphemeris(unsigned char* data, int size) {
     1251  bool decoded = false;
     1252
     1253  if (size == 67) {
     1254    t_ephGPS eph;
     1255    int i, week, L5Flag, SFlag;
     1256    uint64_t numbits = 0, bitfield = 0;
     1257
     1258    data += 3; /* header */
     1259    size -= 6; /* header + crc */
     1260    SKIPBITS(12)
     1261
     1262    eph._receptDateTime = currentDateAndTimeGPS();
     1263
     1264    GETBITS(i, 6)
     1265    eph._prn.set('I', i);
     1266    GETBITS(week, 10)
     1267    GETFLOATSIGN(eph._clock_bias,     22, 1.0 / (double )(1 << 30) / (double )(1 << 1))
     1268    GETFLOATSIGN(eph._clock_drift,    16, 1.0 / (double )(1 << 30) / (double )(1 << 13))
     1269    GETFLOATSIGN(eph._clock_driftrate, 8, 1.0 / (double )(1 << 30) / (double )(1 << 25))
     1270    GETBITS(i, 4)
     1271    eph._ura = accuracyFromIndex(i, eph.type());
     1272    GETBITS(i, 16)
     1273    i <<= 4;
     1274    eph._TOC.set(i * 1000);
     1275    GETFLOATSIGN(eph._TGD, 8, 1.0 / (double )(1 << 30) / (double )(1 <<  1))
     1276    GETFLOATSIGN(eph._Delta_n, 22, R2R_PI/(double)(1<<30)/(double)(1 << 11))
     1277    // IODCE
     1278    GETBITS(eph._IODE, 8)
     1279    eph._IODC = eph._IODE;
     1280    SKIPBITS(10)
     1281    GETBITS(L5Flag, 1)
     1282    GETBITS(SFlag, 1)
     1283    if      (L5Flag == 0 && SFlag == 0) {
     1284      eph._health = 0.0;
     1285    }
     1286    else if (L5Flag == 0 && SFlag == 1) {
     1287      eph._health = 1.0;
     1288    }
     1289    else if (L5Flag == 1 && SFlag == 0) {
     1290      eph._health = 2.0;
     1291    }
     1292    else if (L5Flag == 1 && SFlag == 1) {
     1293      eph._health = 3.0;
     1294    }
     1295    GETFLOATSIGN(eph._Cuc,  15, 1.0 / (double )(1 << 28))
     1296    GETFLOATSIGN(eph._Cus,  15, 1.0 / (double )(1 << 28))
     1297    GETFLOATSIGN(eph._Cic,  15, 1.0 / (double )(1 << 28))
     1298    GETFLOATSIGN(eph._Cis,  15, 1.0 / (double )(1 << 28))
     1299    GETFLOATSIGN(eph._Crc,  15, 1.0 / (double )(1 <<  4))
     1300    GETFLOATSIGN(eph._Crs,  15, 1.0 / (double )(1 <<  4))
     1301    GETFLOATSIGN(eph._IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13))
     1302    GETFLOATSIGN(eph._M0,   32, R2R_PI/(double)(1<<30)/(double)(1<< 1))
     1303    GETBITS(i, 16)
     1304    i <<= 4;
     1305    eph._TOEsec = i;
     1306    bncTime t;
     1307    t.set(i * 1000);
     1308    eph._TOEweek = t.gpsw();
     1309    int numOfRollOvers = int(floor(t.gpsw()/1024.0));
     1310    week += (numOfRollOvers * 1024);
     1311    /* week from HOW, differs from TOC, TOE week, we use adapted value instead */
     1312    if (eph._TOEweek > week + 1 || eph._TOEweek < week - 1) /* invalid week */
     1313      return false;
     1314    GETFLOAT(eph._e,            32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
     1315    GETFLOAT(eph._sqrt_A,       32, 1.0 / (double )(1 << 19))
     1316    GETFLOATSIGN(eph._OMEGA0,   32, R2R_PI/(double)(1<<30)/(double)(1<< 1))
     1317    GETFLOATSIGN(eph._omega,    32, R2R_PI/(double)(1<<30)/(double)(1<< 1))
     1318    GETFLOATSIGN(eph._OMEGADOT, 22, R2R_PI/(double)(1<<30)/(double)(1<<11))
     1319    GETFLOATSIGN(eph._i0,       32, R2R_PI/(double)(1<<30)/(double)(1<< 1))
     1320    SKIPBITS(2)
     1321    SKIPBITS(2)
     1322    eph._TOT = 0.9999e9;
    12031323
    12041324    emit newGPSEph(eph);
     
    12741394    eph._prn.set('E', i, eph._inav ? 1 : 0);
    12751395
    1276     GETBITS(eph._TOEweek, 12)
     1396    GETBITS(eph._TOEweek, 12) //FIXME: roll-over after week 4095!!
    12771397    GETBITS(eph._IODnav, 10)
    12781398    GETBITS(i, 8)
     
    12811401    GETBITSFACTOR(i, 14, 60)
    12821402    eph._TOC.set(1024 + eph._TOEweek, i);
    1283     GETFLOATSIGN(eph._clock_driftrate, 6,
    1284         1.0 / (double )(1 << 30) / (double )(1 << 29))
    1285     GETFLOATSIGN(eph._clock_drift, 21,
    1286         1.0 / (double )(1 << 30) / (double )(1 << 16))
    1287     GETFLOATSIGN(eph._clock_bias, 31,
    1288         1.0 / (double )(1 << 30) / (double )(1 << 4))
    1289     GETFLOATSIGN(eph._Crs, 16, 1.0 / (double )(1 << 5))
    1290     GETFLOATSIGN(eph._Delta_n, 16, R2R_PI/(double)(1<<30)/(double)(1<<13))
    1291     GETFLOATSIGN(eph._M0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1292     GETFLOATSIGN(eph._Cuc, 16, 1.0 / (double )(1 << 29))
    1293     GETFLOAT(eph._e, 32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
    1294     GETFLOATSIGN(eph._Cus, 16, 1.0 / (double )(1 << 29))
    1295     GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19))
     1403    GETFLOATSIGN(eph._clock_driftrate, 6, 1.0 / (double )(1 << 30) / (double )(1 << 29))
     1404    GETFLOATSIGN(eph._clock_drift,    21, 1.0 / (double )(1 << 30) / (double )(1 << 16))
     1405    GETFLOATSIGN(eph._clock_bias,     31, 1.0 / (double )(1 << 30) / (double )(1 << 4))
     1406    GETFLOATSIGN(eph._Crs,            16, 1.0 / (double )(1 << 5))
     1407    GETFLOATSIGN(eph._Delta_n,        16, R2R_PI/(double)(1<<30)/(double)(1<<13))
     1408    GETFLOATSIGN(eph._M0,             32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1409    GETFLOATSIGN(eph._Cuc,            16, 1.0 / (double )(1 << 29))
     1410    GETFLOAT(eph._e,                  32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
     1411    GETFLOATSIGN(eph._Cus,            16, 1.0 / (double )(1 << 29))
     1412    GETFLOAT(eph._sqrt_A,             32, 1.0 / (double )(1 << 19))
    12961413    GETBITSFACTOR(eph._TOEsec, 14, 60)
    12971414    /* FIXME: overwrite value, copied from old code */
    12981415    eph._TOEsec = eph._TOC.gpssec();
    1299     GETFLOATSIGN(eph._Cic, 16, 1.0 / (double )(1 << 29))
    1300     GETFLOATSIGN(eph._OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1301     GETFLOATSIGN(eph._Cis, 16, 1.0 / (double )(1 << 29))
    1302     GETFLOATSIGN(eph._i0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1303     GETFLOATSIGN(eph._Crc, 16, 1.0 / (double )(1 << 5))
    1304     GETFLOATSIGN(eph._omega, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1416    GETFLOATSIGN(eph._Cic,      16, 1.0 / (double )(1 << 29))
     1417    GETFLOATSIGN(eph._OMEGA0,   32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1418    GETFLOATSIGN(eph._Cis,      16, 1.0 / (double )(1 << 29))
     1419    GETFLOATSIGN(eph._i0,       32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1420    GETFLOATSIGN(eph._Crc,      16, 1.0 / (double )(1 << 5))
     1421    GETFLOATSIGN(eph._omega,    32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    13051422    GETFLOATSIGN(eph._OMEGADOT, 24, R2R_PI/(double)(1<<30)/(double)(1<<13))
    13061423    GETFLOATSIGN(eph._BGD_1_5A, 10,
     
    13111428      eph._e5aDataInValid = false;
    13121429
    1313       GETFLOATSIGN(eph._BGD_1_5B, 10,
    1314           1.0 / (double )(1 << 30) / (double )(1 << 2))
     1430      GETFLOATSIGN(eph._BGD_1_5B, 10, 1.0 / (double )(1 << 30) / (double )(1 << 2))
    13151431      GETBITS(eph._E5bHS, 2)
    13161432      GETBITS(eph._e5bDataInValid, 1)
     
    13651481    i <<= 3;
    13661482    eph._TOC.setBDS(i * 1000);
    1367     GETFLOATSIGN(eph._clock_driftrate, 11,
    1368         1.0 / (double )(1 << 30) / (double )(1 << 30) / (double )(1 << 6))
    1369     GETFLOATSIGN(eph._clock_drift, 22,
    1370         1.0 / (double )(1 << 30) / (double )(1 << 20))
    1371     GETFLOATSIGN(eph._clock_bias, 24,
    1372         1.0 / (double )(1 << 30) / (double )(1 << 3))
     1483    GETFLOATSIGN(eph._clock_driftrate, 11,  1.0 / (double )(1 << 30) / (double )(1 << 30) / (double )(1 << 6))
     1484    GETFLOATSIGN(eph._clock_drift,     22,  1.0 / (double )(1 << 30) / (double )(1 << 20))
     1485    GETFLOATSIGN(eph._clock_bias,      24,  1.0 / (double )(1 << 30) / (double )(1 << 3))
    13731486    GETBITS(eph._AODC, 5)
    1374     GETFLOATSIGN(eph._Crs, 18, 1.0 / (double )(1 << 6))
     1487    GETFLOATSIGN(eph._Crs,     18, 1.0 / (double )(1 << 6))
    13751488    GETFLOATSIGN(eph._Delta_n, 16, R2R_PI/(double)(1<<30)/(double)(1<<13))
    1376     GETFLOATSIGN(eph._M0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1377     GETFLOATSIGN(eph._Cuc, 18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    1378     GETFLOAT(eph._e, 32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
    1379     GETFLOATSIGN(eph._Cus, 18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    1380     GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19))
     1489    GETFLOATSIGN(eph._M0,      32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1490    GETFLOATSIGN(eph._Cuc,     18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
     1491    GETFLOAT(eph._e,           32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
     1492    GETFLOATSIGN(eph._Cus,     18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
     1493    GETFLOAT(eph._sqrt_A,      32, 1.0 / (double )(1 << 19))
    13811494    GETBITS(i, 17)
    13821495    i <<= 3;
    13831496    eph._TOEsec = i;
    13841497    eph._TOE.setBDS(i * 1000);
    1385     GETFLOATSIGN(eph._Cic, 18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    1386     GETFLOATSIGN(eph._OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1387     GETFLOATSIGN(eph._Cis, 18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    1388     GETFLOATSIGN(eph._i0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    1389     GETFLOATSIGN(eph._Crc, 18, 1.0 / (double )(1 << 6))
    1390     GETFLOATSIGN(eph._omega, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1498    GETFLOATSIGN(eph._Cic,      18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
     1499    GETFLOATSIGN(eph._OMEGA0,   32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1500    GETFLOATSIGN(eph._Cis,      18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
     1501    GETFLOATSIGN(eph._i0,       32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     1502    GETFLOATSIGN(eph._Crc,      18, 1.0 / (double )(1 << 6))
     1503    GETFLOATSIGN(eph._omega,    32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    13911504    GETFLOATSIGN(eph._OMEGADOT, 24, R2R_PI/(double)(1<<30)/(double)(1<<13))
    1392     GETFLOATSIGN(eph._TGD1, 10, 0.0000000001)
    1393     GETFLOATSIGN(eph._TGD2, 10, 0.0000000001)
     1505    GETFLOATSIGN(eph._TGD1,     10, 0.0000000001)
     1506    GETFLOATSIGN(eph._TGD2,     10, 0.0000000001)
    13941507    GETBITS(eph._SatH1, 1)
    13951508
     
    15291642        }
    15301643      }
    1531       else if (id >= 1070 && id <= 1229) /* MSM */ {
     1644      else if ((id >= 1070 && id <= 1229) ||
     1645               (id >=   21 && id <=   27)) /* MSM */ {
    15321646        if (DecodeRTCM3MSM(_Message, _BlockSize))
    15331647          decoded = true;
     
    15731687              decoded = true;
    15741688            break;
     1689          case 29:
     1690            if (DecodeIRNSSEphemeris(_Message, _BlockSize))
     1691              decoded = true;
     1692            break;
    15751693          case 1045:
    15761694          case 1046:
  • trunk/BNC/src/RTCM3/RTCM3Decoder.h

    r8197 r8783  
    132132  bool DecodeQZSSEphemeris(unsigned char* buffer, int bufLen);
    133133  /**
     134   * Extract ephemeris data from 29 (allocated for testing) RTCM3 messages.
     135   * @param buffer the buffer containing an 29 RTCM block
     136   * @param bufLen the length of the buffer (the message length including header+crc)
     137   * @return <code>true</code> when data block was decodable
     138   */
     139  bool DecodeIRNSSEphemeris(unsigned char* buffer, int bufLen);
     140  /**
    134141   * Extract ephemeris data from 1045 and 1046 RTCM3 messages.
    135142   * @param buffer the buffer containing an 1045 and 1046 RTCM block
  • trunk/BNC/src/RTCM3/gnss.h

    r8682 r8783  
    7070#define BDS_WAVELENGTH_B3  (LIGHTSPEED / BDS_FREQU_B3) /* m */
    7171
     72#define IRNSS_FREQU_L5     1176450000.0 /* Hz */
     73#define IRNSS_FREQU_S      2492028000.0 /* Hz */
     74#define IRNSS_WAVELENGTH_L5 (LIGHTSPEED / IRNSS_FREQU_L5) /* m */
     75#define IRNSS_WAVELENGTH_S  (LIGHTSPEED / IRNSS_FREQU_S)  /* m */
     76
    7277#define R2R_PI          3.1415926535898
    7378
Note: See TracChangeset for help on using the changeset viewer.