Changeset 1239 in ntrip for trunk/BNC/RTCM3/rtcm3torinex.c
- Timestamp:
- Nov 26, 2008, 1:18:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/rtcm3torinex.c
r1210 r1239 1 1 /* 2 2 Converter for RTCM3 data to RINEX. 3 $Id: rtcm3torinex.c,v 1. 18 2008/11/10 18:01:41 weber Exp $3 $Id: rtcm3torinex.c,v 1.34 2008/11/26 10:14:46 stoecker Exp $ 4 4 Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu> 5 5 … … 51 51 52 52 /* CVS revision and version */ 53 static char revisionstr[] = "$Revision: 1. 18$";53 static char revisionstr[] = "$Revision: 1.34 $"; 54 54 55 55 #ifndef COMPILEDATE … … 176 176 177 177 #define SKIPBITS(b) { LOADBITS(b) numbits -= (b); } 178 179 /* extract byte-aligned byte from data stream, 180 b = variable to store size, s = variable to store string pointer */ 181 #define GETSTRING(b, s) \ 182 { \ 183 b = *(data++); \ 184 s = (char *) data; \ 185 data += b; \ 186 size -= b+1; \ 187 } 178 188 179 189 struct leapseconds { /* specify the day of leap second */ … … 273 283 int ret=0; 274 284 285 #ifdef NO_RTCM3_MAIN 286 if(GetMessage(handle)) /* don't repeat */ 287 #else 275 288 while(!ret && GetMessage(handle)) 289 #endif /* NO_RTCM3_MAIN */ 276 290 { 277 291 /* using 64 bit integer types, as it is much easier than handling … … 284 298 GETBITS(type,12) 285 299 #ifdef NO_RTCM3_MAIN 286 handle->typeList[handle->typeSize] = type; /* RTCM message types */ 287 if(handle->typeSize < 100) {handle->typeSize += 1;} /* RTCM message types */ 300 handle->blocktype = type; 288 301 #endif /* NO_RTCM3_MAIN */ 289 302 switch(type) 290 303 { 291 304 #ifdef NO_RTCM3_MAIN 292 case 1005: 293 { 294 double antX, antY, antZ; /* Antenna XYZ */ 305 default: 306 ret = type; 307 break; 308 case 1005: case 1006: 309 { 295 310 SKIPBITS(22) 296 GETBITSSIGN( antX, 38)311 GETBITSSIGN(handle->antX, 38) 297 312 SKIPBITS(2) 298 GETBITSSIGN( antY, 38)313 GETBITSSIGN(handle->antY, 38) 299 314 SKIPBITS(2) 300 GETBITSSIGN(antZ, 38) 301 handle->antList5[handle->antSize5 + 0] = antX; 302 handle->antList5[handle->antSize5 + 1] = antY; 303 handle->antList5[handle->antSize5 + 2] = antZ; 304 if(handle->antSize5 < 100 - 5 ) {handle->antSize5 += 3;} 305 ret = 1005; 315 GETBITSSIGN(handle->antZ, 38) 316 if(type == 1006) 317 GETBITS(handle->antH, 16) 318 ret = type; 306 319 } 307 320 break; 308 case 1006: 309 { 310 double antX, antY, antZ, antH; /* Antenna XYZ-H */ 311 SKIPBITS(22) 312 GETBITSSIGN(antX, 38) 313 SKIPBITS(2) 314 GETBITSSIGN(antY, 38) 315 SKIPBITS(2) 316 GETBITSSIGN(antZ, 38) 317 GETBITS( antH, 16) 318 handle->antList6[handle->antSize6 + 0] = antX; 319 handle->antList6[handle->antSize6 + 1] = antY; 320 handle->antList6[handle->antSize6 + 2] = antZ; 321 handle->antList6[handle->antSize6 + 3] = antH; 322 if(handle->antSize6 < 100 - 6 ) {handle->antSize6 += 4;} 323 ret = 1006; 324 } 325 break; 326 case 1007: 327 { 328 char *antC = '\0'; /* Antenna Descriptor */ 329 char *antS = '\0'; 330 antC = (char*) malloc(32); 331 antS = (char*) malloc(32); 332 uint32_t antN; 333 uint32_t antD; 334 uint32_t jj; 321 case 1007: case 1008: case 1033: 322 { 323 char *antenna; 324 int antnum; 335 325 336 326 SKIPBITS(12) 337 GETBITS(antN, 8) 338 if ((antN>0) && (antN<32)) { 339 for (jj = 0; jj < antN; jj++) { 340 GETBITS(antD, 8) 341 sprintf(antS,"%c",antD); 342 if (jj<1) { 343 strcpy(antC,antS); 344 } else { 345 strcat(antC,antS); 346 } 347 } 348 handle->antType[handle->antSize] = antC; 349 if(handle->antSize < 100) {handle->antSize += 1;} 350 } 351 free(antC); 352 free(antS); 353 ret = 1007; 354 } 355 break; 356 case 1008: 357 { 358 char *antC = '\0'; /* Antenna Descriptor */ 359 char *antS = '\0'; 360 antC = (char*) malloc(32); 361 antS = (char*) malloc(32); 362 uint32_t antN; 363 uint32_t antD; 364 uint32_t jj; 365 366 SKIPBITS(12) 367 GETBITS(antN, 8) 368 if ((antN>0) && (antN<32)) { 369 for (jj = 0; jj < antN; jj++) { 370 GETBITS(antD, 8) 371 sprintf(antS,"%c",antD); 372 if (jj<1) { 373 strcpy(antC,antS); 374 } else { 375 strcat(antC,antS); 376 } 377 } 378 handle->antType[handle->antSize] = antC; 379 if(handle->antSize < 100) {handle->antSize += 1;} 380 } 381 free(antC); 382 free(antS); 383 ret = 1008; 327 GETSTRING(antnum,antenna) 328 memcpy(handle->antenna, antenna, antnum); 329 handle->antenna[antnum] = 0; 330 ret = type; 384 331 } 385 332 break; … … 1718 1665 1719 1666 #ifndef NO_RTCM3_MAIN 1720 static char datestr[] = "$Date: 2008/11/ 10 18:01:41$";1667 static char datestr[] = "$Date: 2008/11/26 10:14:46 $"; 1721 1668 1722 1669 /* The string, which is send as agent in HTTP request */
Note:
See TracChangeset
for help on using the changeset viewer.