Changeset 6812 in ntrip for trunk/BNC/src/RTCM3/RTCM3Decoder.h


Ignore:
Timestamp:
May 5, 2015, 3:44:39 PM (9 years ago)
Author:
stoecker
Message:

integrate RTCM3 parsing into BNC and directly fill target structures, add doxygen documentation

Location:
trunk/BNC/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src

    • Property svn:ignore
      •  

        old new  
        55debug
        66release
         7html
  • trunk/BNC/src/RTCM3

    • Property svn:externals
      •  

        old new  
        11clock_and_orbit http://software.rtcm-ntrip.org/svn/trunk/clock_and_orbit/lib/
        2 rtcm3torinex    http://software.rtcm-ntrip.org/svn/trunk/rtcm3torinex/lib/
  • trunk/BNC/src/RTCM3/RTCM3Decoder.h

    r6598 r6812  
    2929#include <map>
    3030
     31#include <stdint.h>
    3132#include "GPSDecoder.h"
    3233#include "RTCM3coDecoder.h"
    3334#include "bncrawfile.h"
    3435#include "ephemeris.h"
    35 
    36 extern "C" {
    37 #include "rtcm3torinex.h"
    38 }
    3936
    4037class RTCM3Decoder : public QObject, public GPSDecoder {
     
    4542  virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg);
    4643  virtual int corrGPSEpochTime() const;
     44  /**
     45   * CRC24Q checksum calculation function (only full bytes supported).
     46   * @param size Size of the passed data
     47   * @param buf Data buffer containing the data to checksum
     48   * @return the CRC24Q checksum of the data
     49   */
     50  static uint32_t CRC24(long size, const unsigned char *buf);
    4751
    4852 signals:
     
    5559
    5660 private:
    57   enum t_mode{unknown = 0, observations, corrections};
     61  /**
     62   * Extract a RTCM3 message. Data is passed in the follow fields:<br>
     63   * {@link _Message}: contains the message bytes<br>
     64   * {@link _MessageSize}: contains to current amount of bytes in the buffer<br>
     65   * {@link _SkipBytes}: amount of bytes to skip at the beginning of the buffer
     66   *
     67   * The functions sets following variables:<br>
     68   * {@link _NeedBytes}: Minimum number of bytes needed on next call<br>
     69   * {@link _SkipBytes}: internal, Bytes to skip before next call (usually the amount of
     70   *   found bytes)<br>
     71   * {@link _MessageSize}: Updated size after processed bytes have been removed from buffer
     72   * @return message number when message found, 0 otherwise
     73   */
     74  int GetMessage(void);
     75  /**
     76   * Extract data from old 1001-1004 RTCM3 messages.
     77   * @param buffer the buffer containing an 1001-1004 RTCM block
     78   * @param bufLen the length of the buffer (the message length including header+crc)
     79   * @return <code>true</code> when data block is finished and transfered into
     80   * {@link GPSDecoder::_obsList} variable
     81   * @see DecodeRTCM3GLONASS()
     82   * @see DecodeRTCM3MSM()
     83   */
     84  bool DecodeRTCM3GPS(unsigned char* buffer, int bufLen);
     85  /**
     86   * Extract data from old 1009-1012 RTCM3 messages.
     87   * @param buffer the buffer containing an 1009-1012 RTCM block
     88   * @param bufLen the length of the buffer (the message length including header+crc)
     89   * @return <code>true</code> when data block is finished and transfered into
     90   * {@link GPSDecoder::_obsList} variable
     91   * @see DecodeRTCM3GPS()
     92   * @see DecodeRTCM3MSM()
     93   */
     94  bool DecodeRTCM3GLONASS(unsigned char* buffer, int bufLen);
     95  /**
     96   * Extract data from MSM 1070-1229 RTCM3 messages.
     97   * @param buffer the buffer containing an 1070-1229 RTCM block
     98   * @param bufLen the length of the buffer (the message length including header+crc)
     99   * @return <code>true</code> when data block is finished and transfered into
     100   * {@link GPSDecoder::_obsList} variable
     101   * @see DecodeRTCM3GPS()
     102   * @see DecodeRTCM3GLONASS()
     103   */
     104  bool DecodeRTCM3MSM(unsigned char* buffer, int bufLen);
     105  /**
     106   * Extract ephemeris data from 1019 RTCM3 messages.
     107   * @param buffer the buffer containing an 1019 RTCM block
     108   * @param bufLen the length of the buffer (the message length including header+crc)
     109   * @return <code>true</code> when data block was decodable
     110   */
     111  bool DecodeGPSEphemeris(unsigned char* buffer, int bufLen);
     112  /**
     113   * Extract ephemeris data from 1020 RTCM3 messages.
     114   * @param buffer the buffer containing an 1020 RTCM block
     115   * @param bufLen the length of the buffer (the message length including header+crc)
     116   * @return <code>true</code> when data block was decodable
     117   */
     118  bool DecodeGLONASSEphemeris(unsigned char* buffer, int bufLen);
     119  /**
     120   * Extract ephemeris data from 1043 RTCM3 messages.
     121   * @param buffer the buffer containing an 1043 RTCM block
     122   * @param bufLen the length of the buffer (the message length including header+crc)
     123   * @return <code>true</code> when data block was decodable
     124   */
     125  bool DecodeSBASEphemeris(unsigned char* buffer, int bufLen);
     126  /**
     127   * Extract ephemeris data from 1044 RTCM3 messages.
     128   * @param buffer the buffer containing an 1044 RTCM block
     129   * @param bufLen the length of the buffer (the message length including header+crc)
     130   * @return <code>true</code> when data block was decodable
     131   */
     132  bool DecodeQZSSEphemeris(unsigned char* buffer, int bufLen);
     133  /**
     134   * Extract ephemeris data from 1045 and 1046 RTCM3 messages.
     135   * @param buffer the buffer containing an 1045 and 1046 RTCM block
     136   * @param bufLen the length of the buffer (the message length including header+crc)
     137   * @return <code>true</code> when data block was decodable
     138   */
     139  bool DecodeGalileoEphemeris(unsigned char* buffer, int bufLen);
     140  /**
     141   * Extract ephemeris data from BDS RTCM3 messages.
     142   * @param buffer the buffer containing an BDS RTCM block
     143   * @param bufLen the length of the buffer (the message length including header+crc)
     144   * @return <code>true</code> when data block was decodable
     145   */
     146  bool DecodeBDSEphemeris(unsigned char* buffer, int bufLen);
     147  /**
     148   * Extract antenna type from 1007, 1008 or 1033 RTCM3 messages.
     149   * @param buffer the buffer containing an antenna RTCM block
     150   * @param bufLen the length of the buffer (the message length including header+crc)
     151   * @return <code>true</code> when data block was decodable
     152   */
     153  bool DecodeAntenna(unsigned char* buffer, int bufLen);
     154  /**
     155   * Extract antenna type from 1005 or 1006 RTCM3 messages.
     156   * @param buffer the buffer containing an antenna RTCM block
     157   * @param bufLen the length of the buffer (the message length including header+crc)
     158   * @return <code>true</code> when data block was decodable
     159   */
     160  bool DecodeAntennaPosition(unsigned char* buffer, int bufLen);
    58161
     162  /** Current station description, dynamic in case of raw input file handling */
    59163  QString                _staID;
    60   QString                _checkMountPoint;
    61   QMap<QByteArray, RTCM3ParserData> _parsers;
    62   QMap<QByteArray, RTCM3coDecoder*> _coDecoders;
    63   t_mode                 _mode;
    64 
    65   double                 _antXYZ[3];
     164  /** Raw input file for post processing, required to extract station ID */
    66165  bncRawFile*            _rawFile;
    67166
    68   QMap<QString, int>  _slip_cnt_L1;
    69   QMap<QString, int>  _slip_cnt_L2;
    70   QMap<QString, int>  _slip_cnt_L5;
     167  /** List of decoders for Clock and Orbit data */
     168  QMap<QByteArray, RTCM3coDecoder*> _coDecoders;
     169
     170  /** Message buffer for input parsing */
     171  unsigned char _Message[2048];
     172  /** Current size of the message buffer */
     173  size_t _MessageSize;
     174  /** Minimum bytes required to have success during next {@link GetMessage()} call */
     175  size_t _NeedBytes;
     176  /** Bytes to skip in next {@link GetMessage()} call, intrnal to that function */
     177  size_t _SkipBytes;
     178  /** Size of the current RTCM3 block beginning at buffer start after a successful
     179   *  {@link GetMessage()} call
     180   */
     181  size_t _BlockSize;
     182
     183  /**
     184   * Current observation epoch. Used to link together blocks in one epoch.
     185   */
     186  bncTime _CurrentTime;
     187  /** Current observation data block list, Filled by {@link DecodeRTCM3GPS()},
     188   * {@link DecodeRTCM3GLONASS()} and {@link DecodeRTCM3MSM()} functions.
     189   */
     190  QList<t_satObs> _CurrentObsList;
    71191};
    72192
Note: See TracChangeset for help on using the changeset viewer.