Ejemplo n.º 1
0
/* decode navigation data (GPS/QZS L1CA subframe) ------------------------------
*
* args   : uint8_t *buff    I   navigation data bits
*          sdreph_t *eph    I/O sdr ephemeris structure
* return : int                  subframe ID (1-5)
*-----------------------------------------------------------------------------*/
int decode_frame_l1ca(const uint8_t *buff, sdreph_t *eph)
{
    int id=getbitu(buff,49,3); /* subframe ID */

    switch (id) {
    case 1: decode_subfrm1(buff,eph); break;
    case 2: decode_subfrm2(buff,eph); break;
    case 3: decode_subfrm3(buff,eph); break;
    case 4: decode_subfrm4(buff,eph); break;
    case 5: decode_subfrm5(buff,eph); break;
    }
    return id;
}
Ejemplo n.º 2
0
/* decode gps/qzss navigation data frame ---------------------------------------
* decode navigation data frame and extract ephemeris and ion/utc parameters
* args   : unsigned char *buff I gps navigation data frame (without parity)
*                                  buff[0-29]: 24 bits x 10 words
*          eph_t *eph    IO     ephemeris message      (NULL: no input)
*          alm_t *alm    IO     almanac                (NULL: no input)
*          double *ion   IO     ionospheric parameters (NULL: no input)
*          double *utc   IO     delta-utc parameters   (NULL: no input)
*          int   *leaps  IO     leap seconds (s)       (NULL: no input)
* return : status (0:no valid, 1-5:subframe id)
* notes  : use cpu time to resolve modulo 1024 ambiguity of the week number
*          see ref [1]
*          utc[3] reference week for utc parameter is truncated in 8 bits
*          ion and utc parameters by qzss indicate local iono and qzst-utc
*          parameters.
*-----------------------------------------------------------------------------*/
extern int decode_frame(const unsigned char *buff, eph_t *eph, alm_t *alm,
                        double *ion, double *utc, int *leaps)
{
    int id=getbitu(buff,43,3); /* subframe id */
    
    trace(3,"decodefrm: id=%d\n",id);
    
    switch (id) {
        case 1: return decode_subfrm1(buff,eph);
        case 2: return decode_subfrm2(buff,eph);
        case 3: return decode_subfrm3(buff,eph);
        case 4: return decode_subfrm4(buff,alm,ion,utc,leaps);
        case 5: return decode_subfrm5(buff,alm,ion,utc,leaps);
    }
    return 0;
}