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 <OSPMessage.h>
Public Member Functions | |
OSPMessage (void) | |
~OSPMessage (void) | |
bool | fill (FILE *) |
int | get () |
int | getInt () |
unsigned int | getUInt () |
short int | getShort () |
short unsigned int | getUShort () |
float | getFloat () |
double | getDouble () |
int | getInt3 () |
bool | skipBytes (int n) |
unsigned int | payloadLen () |
OSPMessage class provides resources to perform data acquisition from OSP message payload. Note that a payload is a part of the OSP message described in the SiRF ICD.
The class allows a cursor based, buffered acquisition process from the OSP file and include methods to get values for basic data types at the current position of the cursor from the byte stream in the payload.
Methods are defined to:
OSPMessage::OSPMessage | ( | void | ) |
Constructs and empty OSPMessage object.
OSPMessage::~OSPMessage | ( | void | ) |
Destructs OSPmessage objects.
bool OSPMessage::fill | ( | FILE * | file | ) |
fill fills a OSPMessage object buffer with data extracted from next message in the OSP binary file. First the length of next payload message is read, and then the payload bytes are read into the buffer. The buffer cursor for further extractions from the buffer is set to 0.
For a message to be correctly read:
file | the pointer to the OSP binary FILE containing messages |
int OSPMessage::get | ( | ) |
get gets the byte value in the payload at current cursor position. The cursor is incremented by one after getting the byte.
the | integer value 1 when it is intended to get data after the end of payload |
double OSPMessage::getDouble | ( | ) |
getDouble gets eight bytes starting at cursor which are interpreted as a 64 bits floating number. Double numbers are stored in the payload with bytes in the following order: 3, 2, 1, 0, 4, 5, 6, 7. The cursor is incremented by eight
the | integer value 7 when it is intended to get data after the end of payload |
float OSPMessage::getFloat | ( | ) |
getFloat gets four bytes starting at cursor which are interpreted as a 32 bits floating number. Floating numbers are stored in the payload with bytes in reverse order. The cursor is incremented by four
the | integer value 6 when it is intended to get data after the end of payload |
int OSPMessage::getInt | ( | ) |
getInt gets four bytes starting at cursor which are interpreted as a 32 bits integer. Integers are stored in the payload with the most significant byte first. The cursor is incremented by four
the | integer value 2 when it is intended to get data after the end of payload |
int OSPMessage::getInt3 | ( | ) |
getInt3 gets three bytes starting at cursor which are interpreted as a 24 bits signed integer. Integers are stored in the payload with the most significant byte first. The cursor is incremented by three
the | integer value 8 when it is intended to get data after the end of payload |
short OSPMessage::getShort | ( | ) |
getShort gets two bytes starting at cursor which are interpreted as a 16 bits integer. Integers are stored in the payload with the most significant byte first. The cursor is incremented by four
the | integer value 4 when it is intended to get data after the end of payload |
unsigned int OSPMessage::getUInt | ( | ) |
getUInt method gets four bytes starting at cursor which are interpreted as a 32 bits unsigned integer. Integers are stored in the payload with the most significant byte first. The cursor is incremented by four
the | integer value 3 when it is intended to get data after the end of payload |
unsigned short OSPMessage::getUShort | ( | ) |
getUShort gets from payload two bytes starting at cursor which are interpreted as a 16 bits unsigned integer. Integers are stored in the payload with the most significant byte first. The cursor is incremented by four
the | integer value 5 when it is intended to get data after the end of payload |
unsigned int OSPMessage::payloadLen | ( | ) |
payloadLen provides the length of the current payload
bool OSPMessage::skipBytes | ( | int | n | ) |
skipBytes skips the number of bytes stated in the argument from the payload buffer. It increments the payload cursor to allow next data extraction of values after bytes skipped.
n | the number of bytes to skip, or increment to apply to the buffer cursor |