- Timestamp:
- Mar 26, 2008, 11:33:11 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/rtcm3torinex.c
r689 r745 1 1 /* 2 2 Converter for RTCM3 data to RINEX. 3 $Id: rtcm3torinex.c,v 1. 8 2007/10/28 08:50:37 mervartExp $4 Copyright (C) 2005-200 6 by Dirk Stoecker <stoecker@alberding.eu>3 $Id: rtcm3torinex.c,v 1.27 2008/03/25 15:10:48 stoecker Exp $ 4 Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu> 5 5 6 6 This software is a complete NTRIP-RTCM3 to RINEX converter as well as … … 51 51 52 52 /* CVS revision and version */ 53 static char revisionstr[] = "$Revision: 1. 8$";53 static char revisionstr[] = "$Revision: 1.27 $"; 54 54 55 55 #ifndef COMPILEDATE … … 110 110 if(e-m < 3) 111 111 handle->NeedBytes = 3; 112 112 113 113 /* copy buffer to front */ 114 114 i = m - handle->Message; … … 182 182 int year; 183 183 int taicount; 184 }; 184 }; 185 185 static const int months[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; 186 186 static const struct leapseconds leap[] = { … … 459 459 } 460 460 GETBITS(l1range, 24); 461 if((l1range&((1<<24)-1)) != 0x80000)462 {463 gnss->dataflags[num] |= c;464 gnss->measdata[num][ce] = l1range*0.02;465 }466 461 GETBITSSIGN(i, 20); 467 462 if((i&((1<<20)-1)) != 0x80000) 468 463 { 469 gnss->dataflags[num] |= l; 464 gnss->dataflags[num] |= (c|l); 465 gnss->measdata[num][ce] = l1range*0.02; 470 466 gnss->measdata[num][le] = l1range*0.02+i*0.0005; 471 467 } … … 622 618 } 623 619 GETBITS(l1range, 25) 624 if((l1range&((1<<25)-1)) != 0x80000)625 {626 gnss->dataflags[num] |= c;627 gnss->measdata[num][ce] = l1range*0.02;628 }629 620 GETBITSSIGN(i, 20) 630 621 if((i&((1<<20)-1)) != 0x80000) 631 622 { 632 gnss->dataflags[num] |= l; 623 /* Handle this like GPS. Actually for GLONASS L1 range is always 624 valid. To be on the save side, we handle it as invalid like we 625 do for GPS and also remove range in case of 0x80000. */ 626 gnss->dataflags[num] |= (c|l); 627 gnss->measdata[num][ce] = l1range*0.02; 633 628 gnss->measdata[num][le] = l1range*0.02+i*0.0005; 634 629 } … … 814 809 } 815 810 816 int HandleRunBy(char *buffer, int buffersize, const char **u,811 static int HandleRunBy(char *buffer, int buffersize, const char **u, 817 812 int rinex3) 818 813 { … … 846 841 } 847 842 848 // Inserted parts for BNC Perlt849 #ifdef NO_RTCM3_MAIN850 #define NUMSTARTSKIP 1851 #else852 843 #define NUMSTARTSKIP 3 853 #endif854 855 844 void HandleHeader(struct RTCM3ParserData *Parser) 856 845 { 857 #ifdef NO_RTCM3_MAIN858 // Part of Handle Header for data request for BNC (independently on actually delivered data), original is commented out by ifndef NO_RTCM3_MAIN. Perlt859 int i;860 if(Parser->rinex3)861 {862 #define CHECKFLAGSNEW(a, b, c) \863 { \864 Parser->dataflag##a[Parser->numdatatypes##a] = GNSSDF_##b##DATA; \865 Parser->datapos##a[Parser->numdatatypes##a] = GNSSENTRY_##b##DATA; \866 ++Parser->numdatatypes##a; \867 }868 869 CHECKFLAGSNEW(GPS, C1, C1C)870 CHECKFLAGSNEW(GPS, L1C, L1C)871 CHECKFLAGSNEW(GPS, D1C, D1C)872 CHECKFLAGSNEW(GPS, S1C, S1C)873 CHECKFLAGSNEW(GPS, P1, C1P)874 CHECKFLAGSNEW(GPS, L1P, L1P)875 CHECKFLAGSNEW(GPS, D1P, D1P)876 CHECKFLAGSNEW(GPS, S1P, S1P)877 CHECKFLAGSNEW(GPS, P2, C2P)878 CHECKFLAGSNEW(GPS, L2P, L2P)879 CHECKFLAGSNEW(GPS, D2P, D2P)880 CHECKFLAGSNEW(GPS, S2P, S2P)881 CHECKFLAGSNEW(GPS, C2, C2X)882 CHECKFLAGSNEW(GPS, L2C, L2X)883 CHECKFLAGSNEW(GPS, D2C, D2X)884 CHECKFLAGSNEW(GPS, S2C, S2X)885 CHECKFLAGSNEW(GLO, C1, C1C)886 CHECKFLAGSNEW(GLO, L1C, L1C)887 CHECKFLAGSNEW(GLO, D1C, D1C)888 CHECKFLAGSNEW(GLO, S1C, S1C)889 CHECKFLAGSNEW(GLO, P1, C1P)890 CHECKFLAGSNEW(GLO, L1P, L1P)891 CHECKFLAGSNEW(GLO, D1P, D1P)892 CHECKFLAGSNEW(GLO, S1P, S1P)893 CHECKFLAGSNEW(GLO, P2, C2P)894 CHECKFLAGSNEW(GLO, L2P, L2P)895 CHECKFLAGSNEW(GLO, D2P, D2P)896 CHECKFLAGSNEW(GLO, S2P, S2P)897 CHECKFLAGSNEW(GLO, C2, C2C)898 CHECKFLAGSNEW(GLO, L2C, L2C)899 CHECKFLAGSNEW(GLO, D2C, D2C)900 CHECKFLAGSNEW(GLO, S2C, S2C)901 902 }903 else904 {905 #define CHECKFLAGS(a, b) \906 { \907 if(data[RINEXENTRY_##b##DATA]) \908 { \909 Parser->dataflagGPS[data[RINEXENTRY_##b##DATA]-1] = GNSSDF_##a##DATA; \910 Parser->dataposGPS[data[RINEXENTRY_##b##DATA]-1] = GNSSENTRY_##a##DATA; \911 } \912 else \913 { \914 Parser->dataflag[Parser->numdatatypesGPS] = GNSSDF_##a##DATA; \915 Parser->datapos[Parser->numdatatypesGPS] = GNSSENTRY_##a##DATA; \916 data[RINEXENTRY_##b##DATA] = ++Parser->numdatatypesGPS; \917 } \918 }919 920 int data[RINEXENTRY_NUMBER];921 for(i = 0; i < RINEXENTRY_NUMBER; ++i) data[i] = 0;922 923 CHECKFLAGS(C1,C1)924 CHECKFLAGS(C2,C2)925 CHECKFLAGS(P1,P1)926 CHECKFLAGS(P2,P2)927 CHECKFLAGS(L1C,L1)928 CHECKFLAGS(L1P,L1)929 CHECKFLAGS(L2C,L2)930 CHECKFLAGS(L2P,L2)931 CHECKFLAGS(D1C,D1)932 CHECKFLAGS(D1P,D1)933 CHECKFLAGS(D2C,D2)934 CHECKFLAGS(D2P,D2)935 CHECKFLAGS(S1C,S1)936 CHECKFLAGS(S1P,S1)937 CHECKFLAGS(S2C,S2)938 CHECKFLAGS(S2P,S2)939 }940 // End Part of Handle Header for BNC Perlt941 #endif942 943 #ifndef NO_RTCM3_MAIN944 846 struct HeaderData hdata; 945 847 char thebuffer[MAXHEADERBUFFERSIZE]; … … 991 893 " .0000 .0000 .0000 " 992 894 "ANTENNA: DELTA H/E/N"; 993 895 994 896 hdata.data.named.wavelength = Parser->rinex3 ? 0 : 995 897 " 1 1 " … … 1232 1134 } 1233 1135 1136 #ifndef NO_RTCM3_MAIN 1234 1137 for(i = 0; i < hdata.numheaders; ++i) 1235 1138 { … … 1628 1531 1629 1532 #ifndef NO_RTCM3_MAIN 1630 static char datestr[] = "$Date: 200 7/10/28 08:50:37$";1533 static char datestr[] = "$Date: 2008/03/25 15:10:48 $"; 1631 1534 1632 1535 /* The string, which is send as agent in HTTP request */ … … 2189 2092 { 2190 2093 if(numbytes >= 17 && !strncmp(buf, "RTSP/1.0 200 OK\r\n", 17)) 2191 2094 { 2192 2095 int serverport = 0, session = 0; 2193 2096 const char *portcheck = "server_port="; … … 2357 2260 "Host: %s\r\n%s" 2358 2261 "User-Agent: %s/%s\r\n" 2262 "Connection: close\r\n" 2359 2263 "\r\n" 2360 2264 , proxyserver ? "http://" : "", proxyserver ? proxyserver : "", … … 2369 2273 "Host: %s\r\n%s" 2370 2274 "User-Agent: %s/%s\r\n" 2275 "Connection: close\r\n" 2371 2276 "Authorization: Basic " 2372 2277 , proxyserver ? "http://" : "", proxyserver ? proxyserver : "", … … 2423 2328 if(numbytes > 17 && (!strncmp(buf, "HTTP/1.1 200 OK\r\n", 17) 2424 2329 || !strncmp(buf, "HTTP/1.0 200 OK\r\n", 17))) 2425 2330 { 2426 2331 const char *datacheck = "Content-Type: gnss/data\r\n"; 2427 2332 const char *chunkycheck = "Transfer-Encoding: chunked\r\n"; … … 2489 2394 else if(i >= 'A' && i <= 'F') chunksize = chunksize*16+i-'A'+10; 2490 2395 else if(i == '\r') ++chunkymode; 2396 else if(i == ';') chunkymode = 5; 2491 2397 else stop = 1; 2492 2398 break; … … 2509 2415 chunkymode = 1; 2510 2416 break; 2417 case 5: 2418 if(i == '\r') chunkymode = 3; 2419 break; 2511 2420 } 2512 2421 }
Note:
See TracChangeset
for help on using the changeset viewer.