2014-03-23 09:43:16 +00:00
/*!
* \ file rtcm_printer . h
* \ brief Interface of a RTCM 3.2 printer for GNSS - SDR
* This class provides a implementation of a subset of the RTCM Standard 10403.2
* for Differential GNSS Services
*
* \ author Carles Fernandez - Prades , 2014. cfernandez ( at ) cttc . es
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
2015-01-08 18:49:59 +00:00
* Copyright ( C ) 2010 - 2015 ( see AUTHORS file for a list of contributors )
2014-03-23 09:43:16 +00:00
*
* GNSS - SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS - SDR .
*
* GNSS - SDR is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
2015-01-08 18:49:59 +00:00
* ( at your option ) any later version .
2014-03-23 09:43:16 +00:00
*
* GNSS - SDR is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with GNSS - SDR . If not , see < http : //www.gnu.org/licenses/>.
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
# ifndef GNSS_SDR_RTCM_PRINTER_H_
# define GNSS_SDR_RTCM_PRINTER_H_
# include <fstream> // std::ofstream
# include <iostream> // std::cout
2015-11-22 08:44:58 +00:00
# include <memory> // std::shared_ptr
2015-11-21 12:01:50 +00:00
# include "rtcm.h"
2014-03-23 09:43:16 +00:00
/*!
* \ brief This class provides a implementation of a subset of the RTCM Standard 10403.2 messages
*/
class Rtcm_Printer
{
public :
/*!
* \ brief Default constructor .
*/
2015-12-24 19:56:41 +00:00
Rtcm_Printer ( std : : string filename , bool flag_rtcm_server , bool flag_rtcm_tty_port , std : : string rtcm_dump_filename , bool time_tag_name = true ) ;
2014-03-23 09:43:16 +00:00
/*!
* \ brief Default destructor .
*/
~ Rtcm_Printer ( ) ;
2015-11-23 23:32:52 +00:00
bool Print_Rtcm_MT1001 ( const Gps_Ephemeris & gps_eph , double obs_time , const std : : map < int , Gnss_Synchro > & pseudoranges ) ;
2015-12-24 19:56:41 +00:00
bool Print_Rtcm_MT1002 ( const Gps_Ephemeris & gps_eph , double obs_time , const std : : map < int , Gnss_Synchro > & pseudoranges ) ;
2015-11-23 23:32:52 +00:00
bool Print_Rtcm_MT1019 ( const Gps_Ephemeris & gps_eph ) ; //<! GPS Ephemeris, should be broadcast in the event that the IODC does not match the IODE, and every 2 minutes.
bool Print_Rtcm_MT1045 ( const Galileo_Ephemeris & gal_eph ) ; //<! Galileo Ephemeris, should be broadcast every 2 minutes
2015-11-21 12:01:50 +00:00
2015-12-25 11:29:35 +00:00
bool Print_Rtcm_MSM ( unsigned int msm_number , const Gps_Ephemeris & gps_eph ,
2015-12-25 09:25:22 +00:00
const Gps_CNAV_Ephemeris & gps_cnav_eph ,
const Galileo_Ephemeris & gal_eph ,
double obs_time ,
const std : : map < int , Gnss_Synchro > & pseudoranges ,
unsigned int ref_id ,
unsigned int clock_steering_indicator ,
unsigned int external_clock_indicator ,
int smooth_int ,
bool divergence_free ,
bool more_messages ) ;
2015-11-23 23:32:52 +00:00
std : : string print_MT1005_test ( ) ; //<! For testing purposes
2016-02-09 18:43:07 +00:00
unsigned int lock_time ( const Gps_Ephemeris & gps_eph , double obs_time , const Gnss_Synchro & gnss_synchro ) ;
2015-11-21 12:01:50 +00:00
2014-03-23 09:43:16 +00:00
private :
std : : string rtcm_filename ; // String with the RTCM log filename
std : : ofstream rtcm_file_descriptor ; // Output file stream for RTCM log file
std : : string rtcm_devname ;
int rtcm_dev_descriptor ; // RTCM serial device descriptor (i.e. COM port)
int init_serial ( std : : string serial_device ) ; //serial port control
void close_serial ( ) ;
2015-11-21 12:01:50 +00:00
std : : shared_ptr < Rtcm > rtcm ;
2015-12-24 19:56:41 +00:00
bool Print_Message ( const std : : string & message ) ;
2014-03-23 09:43:16 +00:00
} ;
# endif