source: ntrip/trunk/rtcm3torinex/lib/rtcm3torinexsupport.c@ 5329

Last change on this file since 5329 was 5329, checked in by mervart, 11 years ago
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1/*
2 Converter for RTCM3 data to RINEX.
3 $Id: rtcm3torinexsupport.c 5329 2013-07-18 15:54:08Z mervart $
4 Copyright (C) 2005-2012 by Dirk Stöcker <stoecker@alberding.eu>
5
6 This software is a complete NTRIP-RTCM3 to RINEX converter as well as
7 a module of the BNC tool for multiformat conversion. Contact Dirk
8 Stöcker for suggestions and bug reports related to the RTCM3 to RINEX
9 conversion problems and the author of BNC for all the other problems.
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 or read http://www.gnu.org/licenses/gpl.txt
25*/
26
27#include "rtcm3torinex.h"
28
29int rrinex3codetoentry(const char *code)
30{
31 int res = 0;
32 switch(code[0])
33 {
34 case 'C': res += GNSSENTRY_CODE; break;
35 case 'L': res += GNSSENTRY_PHASE; break;
36 case 'D': res += GNSSENTRY_DOPPLER; break;
37 case 'S': res += GNSSENTRY_SNR; break;
38 default:
39 return -1;
40 }
41 switch(code[1])
42 {
43 case '1':
44 switch(code[2])
45 {
46 default:
47 case 'C': res += GNSSENTRY_TYPEC1; break;
48 case 'P': case'W': case 'Y': res += GNSSENTRY_TYPEP1; break;
49 case 'A': case'B':
50 case 'S': case'L': case 'X': res += GNSSENTRY_TYPEC1; break;
51 case 'Z': res += GNSSENTRY_TYPECSAIF; break;
52 }
53 break;
54 case '2':
55 switch(code[2])
56 {
57 default:
58 case 'P': case 'W': case 'Y': res += GNSSENTRY_TYPEP2; break;
59 case 'C': case 'S': case 'L': case 'X': res += GNSSENTRY_TYPEC2; break;
60 case 'I': res += GNSSENTRY_TYPEC5B; break;
61 }
62 break;
63 case '5':
64 res += GNSSENTRY_TYPEC5;
65 break;
66 case '6':
67 res += GNSSENTRY_TYPEC6;
68 break;
69 case '7':
70 res += GNSSENTRY_TYPEC5B;
71 break;
72 case '8':
73 res += GNSSENTRY_TYPEC5AB;
74 break;
75 }
76 return res;
77}
Note: See TracBrowser for help on using the repository browser.