Changeset 61 in ntrip for trunk/BNC/RTIGS


Ignore:
Timestamp:
Aug 24, 2006, 2:41:37 PM (18 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC/RTIGS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTIGS/cgps_transform.cpp

    r58 r61  
    1313}
    1414
     15#ifdef CGPS_TRANSFORM_MAIN
    1516int main() {
    1617
     
    9596  return 0;
    9697}
     98#endif
    9799
    98100// Constructor
  • trunk/BNC/RTIGS/rtigs.cpp

    r59 r61  
    3434void rtigs::Decode(char* buffer, int bufLen) {
    3535
    36   RTIGSS_T       rtigs_sta;
    37   RTIGSO_T       rtigs_obs;
    38   RTIGSM_T       rtigs_met;
    39   RTIGSE_T       rtigs_eph;
    40   short          PRN;
    41   short          retval;
    42   unsigned short statID;
    43   unsigned short messType;
     36  unsigned char* lBuffer = (unsigned char*) buffer;
    4437
    4538  // Find the beginning of the message
     
    4841  bool   found = false;
    4942  size_t ii;
    50   for (ii = 0; ii < nr - sz; ii += sz) {
     43  for (ii = 0; ii < bufLen - sz; ii += sz) {
    5144    unsigned short xx;
    52     memcpy( (void*) &xx, &buffer[ii], sz);
     45    memcpy( (void*) &xx, &lBuffer[ii], sz);
    5346    SwitchBytes( (char*) &xx, sz);
    5447    if (xx == 200) {
     
    6558  }
    6659
    67   messType = _GPSTrans.GetRTIGSHdrRecType(&buffer[ii]);
    68   numbytes = _GPSTrans.GetRTIGSHdrRecBytes(&buffer[ii]);
    69   statID   = _GPSTrans.GetRTIGSHdrStaID(&buffer[ii]);
     60  unsigned short messType = _GPSTrans.GetRTIGSHdrRecType(&lBuffer[ii]);
     61  unsigned short numbytes = _GPSTrans.GetRTIGSHdrRecBytes(&lBuffer[ii]);
     62  unsigned short statID   = _GPSTrans.GetRTIGSHdrStaID(&lBuffer[ii]);
    7063
    71   cout << "messType " << messType << endl;
    72   cout << "numbytes " << numbytes << endl;
    73   cout << "statID "   << statID   << endl;
    74 
    75   switch (messType) {
    76   case 100:
    77     _GPSTrans.Decode_RTIGS_Sta(&buffer[ii], numbytes , rtigs_sta);
    78     break;
    79   case 200:
    80     retval = _GPSTrans.Decode_RTIGS_Obs(&buffer[ii], numbytes , rtigs_obs);
     64  if (messType == 200) {
     65    RTIGSO_T       rtigs_obs;
     66    short retval = _GPSTrans.Decode_RTIGS_Obs(&lBuffer[ii], numbytes ,
     67                                              rtigs_obs);
    8168    if (retval >= 1) {
    8269      _GPSTrans.print_CMEAS();
    8370    }
    84     break;
    85   case 300:
    86     retval = _GPSTrans.Decode_RTIGS_Eph(&buffer[ii], numbytes , rtigs_eph, PRN);
    87     break;
    88   case 400:
    89     retval = _GPSTrans.Decode_RTIGS_Met(&buffer[ii], numbytes , &rtigs_met);
    90     break;
    9171  }
    9272}
Note: See TracChangeset for help on using the changeset viewer.