Changeset 61 in ntrip for trunk/BNC/RTIGS
- Timestamp:
- Aug 24, 2006, 2:41:37 PM (19 years ago)
- Location:
- trunk/BNC/RTIGS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTIGS/cgps_transform.cpp
r58 r61 13 13 } 14 14 15 #ifdef CGPS_TRANSFORM_MAIN 15 16 int main() { 16 17 … … 95 96 return 0; 96 97 } 98 #endif 97 99 98 100 // Constructor -
trunk/BNC/RTIGS/rtigs.cpp
r59 r61 34 34 void rtigs::Decode(char* buffer, int bufLen) { 35 35 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; 44 37 45 38 // Find the beginning of the message … … 48 41 bool found = false; 49 42 size_t ii; 50 for (ii = 0; ii < nr- sz; ii += sz) {43 for (ii = 0; ii < bufLen - sz; ii += sz) { 51 44 unsigned short xx; 52 memcpy( (void*) &xx, & buffer[ii], sz);45 memcpy( (void*) &xx, &lBuffer[ii], sz); 53 46 SwitchBytes( (char*) &xx, sz); 54 47 if (xx == 200) { … … 65 58 } 66 59 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]); 70 63 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); 81 68 if (retval >= 1) { 82 69 _GPSTrans.print_CMEAS(); 83 70 } 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;91 71 } 92 72 }
Note:
See TracChangeset
for help on using the changeset viewer.