Ignore:
Timestamp:
Dec 1, 2010, 3:26:47 PM (13 years ago)
Author:
stoecker
Message:

first test of Galileo ephemeris type 1045

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/rtcm3torinex/lib/rtcm3torinex.c

    r2699 r2756  
    140140  LOADBITS(a) \
    141141  b = (bitfield<<(64-numbits))>>(64-(a)); \
     142  numbits -= (a); \
     143}
     144
     145/* extract bits from data stream
     146   b = variable to store result, a = number of bits */
     147#define GETBITSFACTOR(b, a, c) \
     148{ \
     149  LOADBITS(a) \
     150  b = ((bitfield<<(sizeof(bitfield)*8-numbits))>>(sizeof(bitfield)*8-(a)))*(c); \
    142151  numbits -= (a); \
    143152}
     
    397406
    398407        ret = 1019;
     408      }
     409      break;
     410    case 1045:
     411      {
     412        struct galileoephemeris *ge;
     413        int sv;
     414
     415        ge = &handle->ephemerisGALILEO;
     416        memset(ge, 0, sizeof(*ge));
     417
     418        GETBITS(sv, 6)
     419        ge->satellite = sv;
     420        GETBITS(ge->Week, 12)
     421        GETBITS(ge->IODnav, 10)
     422        GETBITS(ge->SISA, 8)
     423        GETFLOATSIGN(ge->IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13))
     424        GETBITSFACTOR(ge->TOC, 14, 60)
     425        GETFLOATSIGN(ge->clock_driftrate, 6, 1.0/(double)(1<<30)/(double)(1<<29))
     426        GETFLOATSIGN(ge->clock_drift, 21, 1.0/(double)(1<<30)/(double)(1<<16))
     427        GETFLOATSIGN(ge->clock_bias, 31, 1.0/(double)(1<<30)/(double)(1<<4))
     428        GETFLOATSIGN(ge->Crs, 16, 1.0/(double)(1<<5))
     429        GETFLOATSIGN(ge->Delta_n, 16, R2R_PI/(double)(1<<30)/(double)(1<<13))
     430        GETFLOATSIGN(ge->M0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     431        GETFLOATSIGN(ge->Cuc, 16, 1.0/(double)(1<<29))
     432        GETFLOAT(ge->e, 32, 1.0/(double)(1<<30)/(double)(1<<3))
     433        GETFLOATSIGN(ge->Cus, 16, 1.0/(double)(1<<29))
     434        GETFLOAT(ge->sqrt_A, 32, 1.0/(double)(1<<19))
     435        GETBITSFACTOR(ge->TOE, 14, 60)
     436        GETFLOATSIGN(ge->Cic, 16, 1.0/(double)(1<<29))
     437        GETFLOATSIGN(ge->OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     438        GETFLOATSIGN(ge->Cis, 16, 1.0/(double)(1<<29))
     439        GETFLOATSIGN(ge->i0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     440        GETFLOATSIGN(ge->Crc, 16, 1.0/(double)(1<<5))
     441        GETFLOATSIGN(ge->omega, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     442        GETFLOATSIGN(ge->OMEGADOT, 24, R2R_PI/(double)(1<<30)/(double)(1<<13))
     443        GETFLOATSIGN(ge->BGD_1_5A, 10, 1.0/(double)(1<<30)/(double)(1<<2))
     444        GETBITS(ge->E5aHS, 2)
     445        GETBITS(sv, 1)
     446        if(sv)
     447          ge->flags |= GALEPHF_E5ADINVALID;
     448        ret = 1045;
    399449      }
    400450      break;
Note: See TracChangeset for help on using the changeset viewer.