INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
receiverstatusdecoder.h
1/*
2 * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
3 * http://gearbox.sf.net/
4 * Copyright (c) 2004-2010 Michael Moser
5 *
6 * This distribution is licensed to you under the terms described in
7 * the LICENSE file included in this distribution.
8 *
9 */
10#ifndef GBX_NOVATEL_RECEIVER_STATUS_DECODER_H
11#define GBX_NOVATEL_RECEIVER_STATUS_DECODER_H
12
13#include <stdint.h>
14#include <string>
15#include <sstream>
16namespace gbxnovatelutilacfr{
17bool receiverStatusIsGood(uint32_t receiverStatus){
18 return 0 == (receiverStatus & 0xe1fe8fef); // quick cross-check: this magic value needs to be the sum of the magic values in the next three functions
19}
20bool receiverStatusIsWarning(uint32_t receiverStatus){
21 return 0 != (receiverStatus & 0xe1fc000e);
22}
23bool receiverStatusIsError(uint32_t receiverStatus){
24 return 0 != (receiverStatus & 0x00028fe0);
25}
26bool receiverStatusIsFatal(uint32_t receiverStatus){
27 return 0 != (receiverStatus & 0x00000001);
28}
29bool receiverStatusIsReservedValue(uint32_t receiverStatus){
30 return 0 != (receiverStatus & 0x1e017010); // quick cross-check: this magic value, summed with the one from receiverStatusIsGood() should yield 0xffffffff
31}
32std::string receiverStatusToString(uint32_t receiverStatus){
33 std::stringstream ss;
34 ss << "Error flag: "
35 << ((0 == (receiverStatus & 0x00000001)) ? "No error" : "Error") << "; "; // unrecoverable --> exception
36 ss << "Temperature status: "
37 << ((0 == (receiverStatus & 0x00000002)) ? "Within specifications" : "Warning") << "; ";// warning (error?)
38 ss << "Voltage supply status: "
39 << ((0 == (receiverStatus & 0x00000004)) ? "OK" : "Warning") << "; "; // warning (error?)
40 ss << "Antenna power status: "
41 << ((0 == (receiverStatus & 0x00000008)) ? "Powered" : "Not powered") << "; "; // warning (are there unpowered antennas??)
42 ss << "Antenna open flag: "
43 << ((0 == (receiverStatus & 0x00000020)) ? "OK" : "Open") << "; "; // error
44 ss << "Antenna shorted flag: "
45 << ((0 == (receiverStatus & 0x00000040)) ? "OK" : "Shorted") << "; "; // error
46 ss << "CPU overload flag: "
47 << ((0 == (receiverStatus & 0x00000080)) ? "No overload" : "Overload") << "; "; // error (recoverable? warning?)
48 ss << "COM1 buffer overrun flag: "
49 << ((0 == (receiverStatus & 0x00000100)) ? "No overrun" : "Overrun") << "; "; // error (recoverable? warning?)
50 ss << "COM2 buffer overrun flag: "
51 << ((0 == (receiverStatus & 0x00000200)) ? "No overrun" : "Overrun") << "; "; // error (recoverable? warning?)
52 ss << "COM3 buffer overrun flag: "
53 << ((0 == (receiverStatus & 0x00000400)) ? "No overrun" : "Overrun") << "; "; // error (recoverable? warning?)
54 ss << "USB buffer overrun flag: "
55 << ((0 == (receiverStatus & 0x00000800)) ? "No overrun" : "Overrun") << "; "; // error (recoverable? warning?)
56 ss << "RF1 AGC status: "
57 << ((0 == (receiverStatus & 0x00008000)) ? "OK" : "Bad") << "; "; // error
58 ss << "RF2 AGC status: "
59 << ((0 == (receiverStatus & 0x00020000)) ? "OK" : "Bad") << "; "; // error
60 ss << "Almanac flag/UTC known: "
61 << ((0 == (receiverStatus & 0x00040000)) ? "Valid" : "Invalid") << "; "; //warning
62 ss << "Position solution flag: "
63 << ((0 == (receiverStatus & 0x00080000)) ? "Valid" : "Invalid") << "; "; //warning
64 ss << "Position fixed flag: "
65 << ((0 == (receiverStatus & 0x00100000)) ? "Not" : "fixed Fixed") << "; "; //warning
66 ss << "Clock steering status: "
67 << ((0 == (receiverStatus & 0x00200000)) ? "Enabled" : "Disabled") << "; "; //warning
68 ss << "Clock model flag: "
69 << ((0 == (receiverStatus & 0x00400000)) ? "Valid" : "Invalid") << "; "; //warning
70 ss << "OEMV card external oscillator flag: "
71 << ((0 == (receiverStatus & 0x00800000)) ? "Disabled" : "Enabled") << "; "; //warning (is this really a warning??)
72 ss << "Software resource: "
73 << ((0 == (receiverStatus & 0x01000000)) ? "OK" : "Warning") << "; "; //warning (error?)
74 ss << "Auxiliary 3 status event flag: "
75 << ((0 == (receiverStatus & 0x20000000)) ? "No event" : "Event") << "; "; //warning
76 ss << "Auxiliary 2 status event flag: "
77 << ((0 == (receiverStatus & 0x40000000)) ? "No event" : "Event") << "; "; //warning
78 ss << "Auxiliary 1 status event flag: "
79 << ((0 == (receiverStatus & 0x80000000)) ? "No event" : "Event"); //warning
80 return ss.str();
81}
82}//namespace
83
84#endif
 

Generated for GearBox by  doxygen 1.4.5