Changeset 1809 in ntrip


Ignore:
Timestamp:
Apr 24, 2009, 11:19:10 AM (13 years ago)
Author:
weber
Message:

* empty log message *

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/clock_orbit_rtcm.c

    r1664 r1809  
    33        Name:           clock_orbit_rtcm.c
    44        Project:        RTCM3
    5         Version:        $Id: clock_orbit_rtcm.c,v 1.3 2009/02/12 11:56:16 stoecker Exp $
     5        Version:        $Id: clock_orbit_rtcm.c,v 1.4 2009/04/24 08:36:34 stoecker Exp $
    66        Authors:        Dirk Stöcker
    77        Description:    state space approach for RTCM3
     
    9393
    9494/* defined values */
    95 #define T_DELTA_RADIAL(a)                SCALEADDBITS(22, 10000.0, a)
    96 #define T_DELTA_ALONG_TRACK(a)           SCALEADDBITS(22, 10000.0, a)
    97 #define T_DELTA_CROSS_TRACK(a)           SCALEADDBITS(22, 10000.0, a)
    98 #define T_DELTA_DOT_RADIAL(a)            SCALEADDBITS(21, 1000000.0, a)
    99 #define T_DELTA_DOT_ALONG_TRACK(a)       SCALEADDBITS(21, 1000000.0, a)
    100 #define T_DELTA_DOT_CROSS_TRACK(a)       SCALEADDBITS(21, 1000000.0, a)
     95#define T_DELTA_RADIAL(a)                SCALEADDBITS(22,    10000.0, a)
     96#define T_DELTA_ALONG_TRACK(a)           SCALEADDBITS(20,     2500.0, a)
     97#define T_DELTA_CROSS_TRACK(a)           SCALEADDBITS(20,     2500.0, a)
     98#define T_DELTA_DOT_RADIAL(a)            SCALEADDBITS(21,  1000000.0, a)
     99#define T_DELTA_DOT_ALONG_TRACK(a)       SCALEADDBITS(19,   250000.0, a)
     100#define T_DELTA_DOT_CROSS_TRACK(a)       SCALEADDBITS(19,   250000.0, a)
    101101#define T_DELTA_DOT_DOT_RADIAL(a)        SCALEADDBITS(27, 50000000.0, a)
    102 #define T_DELTA_DOT_DOT_ALONG_TRACK(a)   SCALEADDBITS(27, 50000000.0, a)
    103 #define T_DELTA_DOT_DOT_CROSS_TRACK(a)   SCALEADDBITS(27, 50000000.0, a)
     102#define T_DELTA_DOT_DOT_ALONG_TRACK(a)   SCALEADDBITS(25, 12500000.0, a)
     103#define T_DELTA_DOT_DOT_CROSS_TRACK(a)   SCALEADDBITS(25, 12500000.0, a)
    104104#define T_SATELLITE_REFERENCE_POINT(a)   ADDBITS(1, a)
    105105
    106106#define T_SATELLITE_REFERENCE_DATUM(a)   ADDBITS(1, a)
    107 #define T_DELTA_CLOCK_C0(a)              SCALEADDBITS(22, 10000.0, a)
    108 #define T_DELTA_CLOCK_C1(a)              SCALEADDBITS(21, 1000000.0, a)
     107#define T_DELTA_CLOCK_C0(a)              SCALEADDBITS(22,    10000.0, a)
     108#define T_DELTA_CLOCK_C1(a)              SCALEADDBITS(21,  1000000.0, a)
    109109#define T_DELTA_CLOCK_C2(a)              SCALEADDBITS(27, 50000000.0, a)
    110110#define T_NO_OF_CODE_BIASES(a)           ADDBITS(5, a)
     
    112112#define T_GLONASS_SIGNAL_IDENTIFIER(a)   ADDBITS(5, a)
    113113#define T_GALILEO_SIGNAL_IDENTIFIER(a)   ADDBITS(5, a)
    114 #define T_CODE_BIAS(a)                   SCALEADDBITS(14, 100.0, a)
     114#define T_CODE_BIAS(a)                   SCALEADDBITS(14,      100.0, a)
    115115#define T_GLONASS_SATELLITE_ID(a)        ADDBITS(5, a)
    116116
     
    120120#define T_MULTIPLE_MESSAGE_INDICATOR(a)  ADDBITS(1, a)
    121121#define T_SSR_URA(a)                     ADDBITS(4, a)
    122 #define T_HR_CLOCK_CORRECTION(a)         SCALEADDBITS(22, 10000.0, a)
     122#define T_HR_CLOCK_CORRECTION(a)         SCALEADDBITS(22,    10000.0, a)
    123123#define T_SSR_UPDATE_INTERVAL(a)         ADDBITS(4, a)
    124124
     
    475475  while((a) > numbits) \
    476476  { \
    477     if(!size--) return GCOBR_SHORTBUFFER; \
     477    if(!size--) return GCOBR_SHORTMESSAGE; \
    478478    bitbuffer = (bitbuffer<<8)|((unsigned char)*(buffer++)); \
    479479    numbits += 8; \
     
    514514/* defined values */
    515515#define G_DELTA_RADIAL(a)                GETFLOATSIGN(a, 22, 1/10000.0)
    516 #define G_DELTA_ALONG_TRACK(a)           GETFLOATSIGN(a, 22, 1/10000.0)
    517 #define G_DELTA_CROSS_TRACK(a)           GETFLOATSIGN(a, 22, 1/10000.0)
     516#define G_DELTA_ALONG_TRACK(a)           GETFLOATSIGN(a, 20, 1/2500.0)
     517#define G_DELTA_CROSS_TRACK(a)           GETFLOATSIGN(a, 20, 1/2500.0)
    518518#define G_DELTA_DOT_RADIAL(a)            GETFLOATSIGN(a, 21, 1/1000000.0)
    519 #define G_DELTA_DOT_ALONG_TRACK(a)       GETFLOATSIGN(a, 21, 1/1000000.0)
    520 #define G_DELTA_DOT_CROSS_TRACK(a)       GETFLOATSIGN(a, 21, 1/1000000.0)
     519#define G_DELTA_DOT_ALONG_TRACK(a)       GETFLOATSIGN(a, 19, 1/250000.0)
     520#define G_DELTA_DOT_CROSS_TRACK(a)       GETFLOATSIGN(a, 19, 1/250000.0)
    521521#define G_DELTA_DOT_DOT_RADIAL(a)        GETFLOATSIGN(a, 27, 1/50000000.0)
    522 #define G_DELTA_DOT_DOT_ALONG_TRACK(a)   GETFLOATSIGN(a, 27, 1/50000000.0)
    523 #define G_DELTA_DOT_DOT_CROSS_TRACK(a)   GETFLOATSIGN(a, 27, 1/50000000.0)
     522#define G_DELTA_DOT_DOT_ALONG_TRACK(a)   GETFLOATSIGN(a, 25, 1/12500000.0)
     523#define G_DELTA_DOT_DOT_CROSS_TRACK(a)   GETFLOATSIGN(a, 25, 1/12500000.0)
    524524#define G_SATELLITE_REFERENCE_POINT(a)   GETBITS(a, 1)
    525525
     
    595595   (((unsigned char)buffer[sizeofrtcmblock+2]))))
    596596    return GCOBR_CRCMISMATCH;
     597  size = sizeofrtcmblock; /* reduce size, so overflows are detected */
    597598
    598599  G_MESSAGE_NUMBER(type)
     600#ifdef DEBUG
     601fprintf(stderr, "type %d size %d\n",type,sizeofrtcmblock);
     602#endif
    599603  switch(type)
    600604  {
     
    611615      return GCOBR_DATAMISMATCH;
    612616    co->OrbitDataSupplied = 1;
     617#ifdef DEBUG
     618fprintf(stderr, "epochtime %d ui %d mmi %d sats %d\n",co->GPSEpochTime,co->UpdateInterval,mmi,co->NumberOfGPSSat);
     619#endif
    613620    for(i = 0; i < co->NumberOfGPSSat; ++i)
    614621    {
     
    626633      G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    627634      G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
     635#ifdef DEBUG
     636fprintf(stderr, "id %2d iod %3d dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f rp %d rd %d\n",
     637co->Sat[i].ID,co->Sat[i].IOD,co->Sat[i].Orbit.DeltaRadial,
     638co->Sat[i].Orbit.DeltaAlongTrack,co->Sat[i].Orbit.DeltaCrossTrack,
     639co->Sat[i].Orbit.DotDeltaRadial,
     640co->Sat[i].Orbit.DotDeltaAlongTrack,
     641co->Sat[i].Orbit.DotDeltaCrossTrack,
     642co->Sat[i].Orbit.DotDotDeltaRadial,
     643co->Sat[i].Orbit.DotDotDeltaAlongTrack,
     644co->Sat[i].Orbit.DotDotDeltaCrossTrack,
     645co->SatRefPoint,
     646co->SatRefDatum);
     647#endif
    628648    }
    629649    break;
     
    10621082    return GCOBR_UNKNOWNTYPE;
    10631083  }
     1084#ifdef DEBUG
     1085for(type = 0; type < size && (unsigned char)buffer[type] != 0xD3; ++type)
     1086  numbits += 8;
     1087fprintf(stderr, "numbits left %d\n",numbits);
     1088#endif
    10641089  if(bytesused)
    10651090    *bytesused = sizeofrtcmblock+6;
  • trunk/BNC/RTCM3/clock_orbit_rtcm.h

    r1741 r1809  
    66        Name:           clock_orbit_rtcm.h
    77        Project:        RTCM3
    8         Version:        $Id: clock_orbit_rtcm.h,v 1.7 2009/02/27 08:59:55 weber Exp $
     8        Version:        $Id: clock_orbit_rtcm.h,v 1.4 2009/04/24 08:36:34 stoecker Exp $
    99        Authors:        Dirk Stöcker
    1010        Description:    state space approach for RTCM3
     
    131131  GCOBR_SHORTBUFFER = -30,
    132132  GCOBR_MISSINGBITS = -31,
    133   GCOBR_MESSAGEEXCEEDSBUFFER = -32
     133  GCOBR_MESSAGEEXCEEDSBUFFER = -32,
     134  GCOBR_SHORTMESSAGE = -33
    134135};
    135136
  • trunk/BNS/RTCM/clock_orbit_rtcm.c

    r1697 r1809  
    33        Name:           clock_orbit_rtcm.c
    44        Project:        RTCM3
    5         Version:        $Id: clock_orbit_rtcm.c,v 1.9 2009/02/27 08:59:49 weber Exp $
     5        Version:        $Id: clock_orbit_rtcm.c,v 1.4 2009/04/24 08:36:34 stoecker Exp $
    66        Authors:        Dirk Stöcker
    77        Description:    state space approach for RTCM3
     
    9393
    9494/* defined values */
    95 #define T_DELTA_RADIAL(a)                SCALEADDBITS(22, 10000.0, a)
    96 #define T_DELTA_ALONG_TRACK(a)           SCALEADDBITS(22, 10000.0, a)
    97 #define T_DELTA_CROSS_TRACK(a)           SCALEADDBITS(22, 10000.0, a)
    98 #define T_DELTA_DOT_RADIAL(a)            SCALEADDBITS(21, 1000000.0, a)
    99 #define T_DELTA_DOT_ALONG_TRACK(a)       SCALEADDBITS(21, 1000000.0, a)
    100 #define T_DELTA_DOT_CROSS_TRACK(a)       SCALEADDBITS(21, 1000000.0, a)
     95#define T_DELTA_RADIAL(a)                SCALEADDBITS(22,    10000.0, a)
     96#define T_DELTA_ALONG_TRACK(a)           SCALEADDBITS(20,     2500.0, a)
     97#define T_DELTA_CROSS_TRACK(a)           SCALEADDBITS(20,     2500.0, a)
     98#define T_DELTA_DOT_RADIAL(a)            SCALEADDBITS(21,  1000000.0, a)
     99#define T_DELTA_DOT_ALONG_TRACK(a)       SCALEADDBITS(19,   250000.0, a)
     100#define T_DELTA_DOT_CROSS_TRACK(a)       SCALEADDBITS(19,   250000.0, a)
    101101#define T_DELTA_DOT_DOT_RADIAL(a)        SCALEADDBITS(27, 50000000.0, a)
    102 #define T_DELTA_DOT_DOT_ALONG_TRACK(a)   SCALEADDBITS(27, 50000000.0, a)
    103 #define T_DELTA_DOT_DOT_CROSS_TRACK(a)   SCALEADDBITS(27, 50000000.0, a)
     102#define T_DELTA_DOT_DOT_ALONG_TRACK(a)   SCALEADDBITS(25, 12500000.0, a)
     103#define T_DELTA_DOT_DOT_CROSS_TRACK(a)   SCALEADDBITS(25, 12500000.0, a)
    104104#define T_SATELLITE_REFERENCE_POINT(a)   ADDBITS(1, a)
    105105
    106106#define T_SATELLITE_REFERENCE_DATUM(a)   ADDBITS(1, a)
    107 #define T_DELTA_CLOCK_C0(a)              SCALEADDBITS(22, 10000.0, a)
    108 #define T_DELTA_CLOCK_C1(a)              SCALEADDBITS(21, 1000000.0, a)
     107#define T_DELTA_CLOCK_C0(a)              SCALEADDBITS(22,    10000.0, a)
     108#define T_DELTA_CLOCK_C1(a)              SCALEADDBITS(21,  1000000.0, a)
    109109#define T_DELTA_CLOCK_C2(a)              SCALEADDBITS(27, 50000000.0, a)
    110110#define T_NO_OF_CODE_BIASES(a)           ADDBITS(5, a)
     
    112112#define T_GLONASS_SIGNAL_IDENTIFIER(a)   ADDBITS(5, a)
    113113#define T_GALILEO_SIGNAL_IDENTIFIER(a)   ADDBITS(5, a)
    114 #define T_CODE_BIAS(a)                   SCALEADDBITS(14, 100.0, a)
     114#define T_CODE_BIAS(a)                   SCALEADDBITS(14,      100.0, a)
    115115#define T_GLONASS_SATELLITE_ID(a)        ADDBITS(5, a)
    116116
     
    120120#define T_MULTIPLE_MESSAGE_INDICATOR(a)  ADDBITS(1, a)
    121121#define T_SSR_URA(a)                     ADDBITS(4, a)
    122 #define T_HR_CLOCK_CORRECTION(a)         SCALEADDBITS(22, 10000.0, a)
     122#define T_HR_CLOCK_CORRECTION(a)         SCALEADDBITS(22,    10000.0, a)
    123123#define T_SSR_UPDATE_INTERVAL(a)         ADDBITS(4, a)
    124124
     
    475475  while((a) > numbits) \
    476476  { \
    477     if(!size--) return GCOBR_SHORTBUFFER; \
     477    if(!size--) return GCOBR_SHORTMESSAGE; \
    478478    bitbuffer = (bitbuffer<<8)|((unsigned char)*(buffer++)); \
    479479    numbits += 8; \
     
    514514/* defined values */
    515515#define G_DELTA_RADIAL(a)                GETFLOATSIGN(a, 22, 1/10000.0)
    516 #define G_DELTA_ALONG_TRACK(a)           GETFLOATSIGN(a, 22, 1/10000.0)
    517 #define G_DELTA_CROSS_TRACK(a)           GETFLOATSIGN(a, 22, 1/10000.0)
     516#define G_DELTA_ALONG_TRACK(a)           GETFLOATSIGN(a, 20, 1/2500.0)
     517#define G_DELTA_CROSS_TRACK(a)           GETFLOATSIGN(a, 20, 1/2500.0)
    518518#define G_DELTA_DOT_RADIAL(a)            GETFLOATSIGN(a, 21, 1/1000000.0)
    519 #define G_DELTA_DOT_ALONG_TRACK(a)       GETFLOATSIGN(a, 21, 1/1000000.0)
    520 #define G_DELTA_DOT_CROSS_TRACK(a)       GETFLOATSIGN(a, 21, 1/1000000.0)
     519#define G_DELTA_DOT_ALONG_TRACK(a)       GETFLOATSIGN(a, 19, 1/250000.0)
     520#define G_DELTA_DOT_CROSS_TRACK(a)       GETFLOATSIGN(a, 19, 1/250000.0)
    521521#define G_DELTA_DOT_DOT_RADIAL(a)        GETFLOATSIGN(a, 27, 1/50000000.0)
    522 #define G_DELTA_DOT_DOT_ALONG_TRACK(a)   GETFLOATSIGN(a, 27, 1/50000000.0)
    523 #define G_DELTA_DOT_DOT_CROSS_TRACK(a)   GETFLOATSIGN(a, 27, 1/50000000.0)
     522#define G_DELTA_DOT_DOT_ALONG_TRACK(a)   GETFLOATSIGN(a, 25, 1/12500000.0)
     523#define G_DELTA_DOT_DOT_CROSS_TRACK(a)   GETFLOATSIGN(a, 25, 1/12500000.0)
    524524#define G_SATELLITE_REFERENCE_POINT(a)   GETBITS(a, 1)
    525525
     
    595595   (((unsigned char)buffer[sizeofrtcmblock+2]))))
    596596    return GCOBR_CRCMISMATCH;
     597  size = sizeofrtcmblock; /* reduce size, so overflows are detected */
    597598
    598599  G_MESSAGE_NUMBER(type)
     600#ifdef DEBUG
     601fprintf(stderr, "type %d size %d\n",type,sizeofrtcmblock);
     602#endif
    599603  switch(type)
    600604  {
     
    611615      return GCOBR_DATAMISMATCH;
    612616    co->OrbitDataSupplied = 1;
     617#ifdef DEBUG
     618fprintf(stderr, "epochtime %d ui %d mmi %d sats %d\n",co->GPSEpochTime,co->UpdateInterval,mmi,co->NumberOfGPSSat);
     619#endif
    613620    for(i = 0; i < co->NumberOfGPSSat; ++i)
    614621    {
     
    626633      G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    627634      G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
     635#ifdef DEBUG
     636fprintf(stderr, "id %2d iod %3d dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f rp %d rd %d\n",
     637co->Sat[i].ID,co->Sat[i].IOD,co->Sat[i].Orbit.DeltaRadial,
     638co->Sat[i].Orbit.DeltaAlongTrack,co->Sat[i].Orbit.DeltaCrossTrack,
     639co->Sat[i].Orbit.DotDeltaRadial,
     640co->Sat[i].Orbit.DotDeltaAlongTrack,
     641co->Sat[i].Orbit.DotDeltaCrossTrack,
     642co->Sat[i].Orbit.DotDotDeltaRadial,
     643co->Sat[i].Orbit.DotDotDeltaAlongTrack,
     644co->Sat[i].Orbit.DotDotDeltaCrossTrack,
     645co->SatRefPoint,
     646co->SatRefDatum);
     647#endif
    628648    }
    629649    break;
     
    10621082    return GCOBR_UNKNOWNTYPE;
    10631083  }
     1084#ifdef DEBUG
     1085for(type = 0; type < size && (unsigned char)buffer[type] != 0xD3; ++type)
     1086  numbits += 8;
     1087fprintf(stderr, "numbits left %d\n",numbits);
     1088#endif
    10641089  if(bytesused)
    10651090    *bytesused = sizeofrtcmblock+6;
  • trunk/BNS/RTCM/clock_orbit_rtcm.h

    r1741 r1809  
    66        Name:           clock_orbit_rtcm.h
    77        Project:        RTCM3
    8         Version:        $Id: clock_orbit_rtcm.h,v 1.8 2009/03/06 15:59:53 weber Exp $
     8        Version:        $Id: clock_orbit_rtcm.h,v 1.4 2009/04/24 08:36:34 stoecker Exp $
    99        Authors:        Dirk Stöcker
    1010        Description:    state space approach for RTCM3
     
    131131  GCOBR_SHORTBUFFER = -30,
    132132  GCOBR_MISSINGBITS = -31,
    133   GCOBR_MESSAGEEXCEEDSBUFFER = -32
     133  GCOBR_MESSAGEEXCEEDSBUFFER = -32,
     134  GCOBR_SHORTMESSAGE = -33
    134135};
    135136
Note: See TracChangeset for help on using the changeset viewer.