RXtoRINEX  V2.1
RXtoRINEX provides tools to collect data from GPS / GNSS receivers in mobile devices, convert them to RINEX or RTK formats, and process RINEX files.
Functions
OSPtoTXT.cpp File Reference
#include "ArgParser.h"
#include "Logger.h"
#include "OSPMessage.h"
#include "Utilities.h"

Functions

int extractMsgs (FILE *, Logger *)
 
int main (int argc, char *argv[])
 

Detailed Description

Contains the command line program to dump contents of an OSP binary data file to the standard output.

Usage:

OSPtoTXT.exe {options} [OSPfileName]

Options are:

Copyright 2015 Francisco Cancillo

This file is part of the RXtoRINEX tool.

RXtoRINEX 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 (at your option) any later version. RXtoRINEX 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. A copy of the GNU General Public License can be found at http://www.gnu.org/licenses/.

Ver. |Date |Reason for change ---—+----—+---------------— V1.0 |2/2015 |First release V1.1 |2/2016 |Minor changes to improve logging V1.2 |2/2018 |Reviewed to run on Linux

Function Documentation

int extractMsgs ( FILE *  inFile,
Logger plog 
)

extractMsgs extracts OSP messages contained in a OSP binary file and prints relevant data to stdout. The OSP binary file contain OSP messages (see SiRF IV ICD for details)

Parameters
inFilethe pointer to the OSP binary FILE to read
plogthe pointer to the Logger object
Returns
the number of messages read

For each input message, the following data are printed:

  • for all messages, MID and payload length
  • MID 2, solution data: X, Y, Z, vX, vY, vZ, week, TOW and satellites used
  • MID 6: SiRF and customer versions
  • MID 7, Clock Status Data: week, TOW, satellites used, drift, bias, and EsT
  • MID 8, 50 BPS Data: 10 words subframe in hexadecimal
  • MID 11, Command Acknowledgment
  • MID 12, Command Negative Acknowledgment
  • MID 15, Ephemeris Data with compact subframes 1, 2 & 3, in response to poll
  • MID 28, Navigation Library Measurement Data
  • MID 50, SBAS Parameters
  • MID 56: Extended Ephemeris Data-reserved use
  • MID 67, Multi-constellation Navigation Data (SiRFV)
  • MID 68, Measurement Engine. Wraps the content of another OSP message and outputs it to SiRFLive

-MID 70 GLONASS almanac/ephemeris response to MID 212

  • MID 75, ACK/NACK/ERROR Notification
  • MID 255, ASCII Development Data Output
int main ( int  argc,
char *  argv[] 
)

main gets the command line arguments, set parameters accordingly and performs the data acquisition for printing them. Input data are contained in a OSP binary file containing length and payload of receiver messages (see SiRF IV ICD for details). The output contains printed descriptive relevant data from each OSP message:

  • Message identification (MID, in decimal) and payload length for all messages
  • Payload parameter values for relevant messages used to generate RINEX or RTK files (MIDs 2, 6, 7, 8, 11, 12, 15, 28, 50, 56, 64, 68, 75)
  • Payload bytes in hexadecimal, for MID 255 Output data are sent to the standard output (stdout file), which could be redirected.
Parameters
argcthe number of arguments passed from the command line
argvthe array of arguments passed from the command line
Returns
the exit status according to the following values and meaning::
  • (0) no errors have been detected
  • (1) an error has been detected in arguments
  • (2) error when opening the input file

The main process sequence follows:

1- Defines and sets the error logger object

2- Setups the valid options in the command line. They will be used by the argument/option parser

3- Setups the default values for operators in the command line

4- Parses arguments in the command line extracting options and operators

5- Sets logging level stated in option

6- Opens the OSP binary file

7- Call extractMsgs to extract messages from the binary OSP file and print contents