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.
|
#include "ArgParser.h"
#include "Logger.h"
#include "Utilities.h"
#include "SerialTxRx.h"
#include <stdio.h>
Functions | |
int | acquireBin (SerialTxRx, FILE *, int, int, int, Logger *) |
int | main (int argc, char **argv) |
Contains the command line program to capture OSP message data from a SiRF IV receiver and stores them in a OSP binary file.
Usage:
OSPDataLogger.exe {options}
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 V2.0 |2/2016 |Improve logging |Add commands for SiRFV V2.1 |2/2018 |Reviewed to run on Linux
int acquireBin | ( | SerialTxRx | port, |
FILE * | outFile, | ||
int | maxMsgs, | ||
int | maxEpochs, | ||
int | patience, | ||
Logger * | plog | ||
) |
acquireBin acquires binary OSP messages from the receiver and record them in the binary OSP file. Data are read from the receiver and written to the OSP file until:
port | the SerialTxRx object used to communicate with the receiver |
outFile | the binary output file to record the messages received from receiver |
maxMsgs | the maximum number of messages to be recorded |
maxEpochs | the maximum number of epochs to be recorded |
patience | the maximum number of erroneous contiguous bytes to read before returning a read error |
plog | the pinter to the Logger |
The acquireBin process sequence follows:
1- Sets counters
2- Reads messages from the input stream until counts exhausted or unrecoverable error happen
int main | ( | int | argc, |
char ** | argv | ||
) |
main gets the command line arguments, set parameters accordingly and triggers the data acquisition from the receiver. The SiRFIV GPS receiver shall be connected to a serial port and ready to receive and send messages. To be ready for this command, the receiver and computer shall be synchronized at the same baud rate, and the receiver sending / accepting OSP messages.
This command sends messages to the receiver to state the data flow with the messages and rates needed to generate OSP files that could be used for the further extraction of data used in RINEX and RTK files.
From the input receiver data stream, the command extracts the messages requested, verifies then, and writes the correct ones to the OSP binary file. See SiRF IV ICD for details on receiver messages.
The binary OSP output files contain messages where head, check and tail have been removed, that is, the data for each message consists of the two bytes of the payload length and the payload bytes.
The SynchroRX command line provided in this project can be used to check and set the receiver state: baud rate, accept/send OSP or NMEA messages, etc. Other utilities provided by receiver manufacturers exist that could perform this synchro task.
argc | the number of arguments passed from the command line |
argv | the array of arguments passed from the command line |
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- Parses arguments in the command line extracting options and operators
4- Sets logging level stated in option
5- Computes observation interval and number of epochs to read from data given in options
6- Defines and sets up the SerialTxRx object to be used for communication with the receiver
7- Verifies that receiver mode is OSP
8- Sends OSP commands to the communication port to perform receiver setup
8- Creates the output binary file
9- Calls acquireBin to acquire and record data form receiver