This class provides an API to communicate with a u-blox GNSS chip. The files here were originally part of the C027_Support library (https://developer.mbed.org/teams/ublox/code/C027_Support/ at revision 138:dafbbf31bf76) but have been separated out, primarily for use on the u-blox C030 board where the cellular interace portion of the C027_Support library will instead be provided through the new mbed Cellular API.
Dependents: example-ublox-at-cellular-interface-ext example-low-power-sleep example-C030-out-of-box-demo example-C030-out-of-box-demo ... more
gnss_operations.h
00001 00002 #include "gnss.h" 00003 00004 #define UBX_FRAME_SIZE 8 00005 #ifdef __cplusplus 00006 extern "C" { 00007 #endif 00008 00009 /** Enums 00010 */ 00011 enum Command { 00012 POWER_ON, 00013 POWER_OFF, 00014 MON_VER, 00015 ENABLE_UBX, 00016 RESTART, // mbed conflict with RESET 00017 CUSTOMER, 00018 AVAILABLE_CONFIG 00019 }; 00020 /** The reset modes 00021 */ 00022 enum Start { 00023 HOT, 00024 COLD, 00025 WARM, 00026 MAX_MODE 00027 }; 00028 00029 /** The operation modes 00030 */ 00031 enum Powermodes { 00032 00033 CONSERVATIVE_CONTINOUS, 00034 AGGRESSIVE_CONTINUOS, 00035 SEMI_CONTINOUS, 00036 FULL_POWER, 00037 FULL_POWER_BLOCK_LEVEL, 00038 FULL_POWER_BUILDING_LEVEL, 00039 AVAILABLE_OPERATION 00040 }; 00041 00042 00043 class GnssOperations : public GnssSerial { 00044 00045 //GnssSerial constructor can be called here to configure different baud rate 00046 //Constructor not required at the moment 00047 //GnssOperations(); 00048 00049 public: 00050 00051 /** Enable GNSS receiver UBX-NAV-PVT messages 00052 * Navigation Position Velocity Time Solution 00053 * @param void 00054 * @return int 1: Successful 00055 * 0: Failure 00056 */ 00057 int enable_ubx_nav_pvt(); 00058 00059 /** Enable GNSS receiver UBX-STATUS messages 00060 * Receiver Navigation Status 00061 * @param void 00062 * @return int 1: Successful 00063 * 0: Failure 00064 */ 00065 int enable_ubx_nav_status(); 00066 00067 /** Enable GNSS receiver UBX-NAV-SAT messages 00068 * Satellite Information 00069 * @param void 00070 * @return int 1: Successful 00071 * 0: Failure 00072 */ 00073 int enable_ubx_nav_sat(); 00074 00075 /** Enable GNSS receiver UBX-NAV-SOL messages 00076 * Navigation Solution Information 00077 * @param void 00078 * @return int 1: Successful 00079 * 0: Failure 00080 */ 00081 int enable_ubx_nav_sol(); 00082 00083 /** Disable GNSS receiver UBX-NAV-PVT messages 00084 * @param void 00085 * @return int 1: Successful 00086 * 0: Failure 00087 */ 00088 int disable_ubx_nav_pvt(); 00089 00090 /** Enable GNSS receiver UBX-NAV5 messages 00091 * Navigation Engine Settings 00092 * @param uint acc Defines positioning accuracy 00093 * @return int 1: Successful 00094 * 0: Failure 00095 */ 00096 int enable_ubx_nav5(unsigned int acc); 00097 00098 /** Enable GNSS receiver UBX-NAVX5 messages 00099 * Navigation Engine Settings 00100 * @return int 1: Successful 00101 * 0: Failure 00102 */ 00103 int enable_ubx_navx5(); 00104 00105 /** Enable GNSS receiver UBX-CFG-ODO messages 00106 * Odometer, Low-speed COG Engine Settings 00107 * @param void 00108 * @return int 1: Successful 00109 * 0: Failure 00110 */ 00111 int enable_ubx_odo(); 00112 00113 /** Disable GNSS receiver UBX-CFG-ODO messages 00114 * @param void 00115 * @return int 1: Successful 00116 * 0: Failure 00117 */ 00118 int disable_ubx_odo(); 00119 00120 /** Enable GNSS receiver UBX-NAV-ODO messages 00121 * Odometer, Low-speed COG Engine Settings 00122 * @param void 00123 * @return int 1: Successful 00124 * 0: Failure 00125 */ 00126 int enable_ubx_nav_odo(); 00127 00128 /** Disable GNSS receiver UBX-NAV-ODO messages 00129 * Odometer, Low-speed COG Engine Settings 00130 * @param void 00131 * @return int 1: Successful 00132 * 0: Failure 00133 */ 00134 int disable_ubx_nav_odo(); 00135 00136 /** Enable GNSS receiver UBX-LOG-BATCH messages 00137 * Batched data 00138 * @param void 00139 * @return int 1: Successful 00140 * 0: Failure 00141 */ 00142 int enable_ubx_batch_feature(); 00143 00144 /** Disable GNSS receiver UBX-LOG-BATCH messages 00145 * Batched data 00146 * @param void 00147 * @return int 1: Successful 00148 * 0: Failure 00149 */ 00150 int disable_ubx_batch_feature(); 00151 00152 /** Configure GNSS receiver batching feature 00153 * Get/Set data batching configuration 00154 * @param tUBX_CFG_BATCH 00155 * @return int 1: Successful 00156 * 0: Failure 00157 */ 00158 int cfg_batch_feature(tUBX_CFG_BATCH *obj); 00159 00160 /** Configure GNSS receiver power mode 00161 * Power mode setup 00162 * @param Powermodes SEMI_CONTINOUS 00163 * AGGRESSIVE_CONTINUOS 00164 * CONSERVATIVE_CONTINOUS 00165 * FULL_POWER 00166 * FULL_POWER_BLOCK_LEVEL 00167 * minimumAcqTime boolean 00168 * 00169 * @return int 1: Successful 00170 * 0: Failure 00171 */ 00172 int cfg_power_mode(Powermodes power_mode, bool minimumAcqTime); 00173 00174 /** Method to poll the GNSS configuration 00175 * @param void 00176 * @return bool true: Successful 00177 * false: Failure 00178 */ 00179 bool verify_gnss_mode(); 00180 00181 /** Configure GNSS startup mode 00182 * Power mode setup 00183 * @param start_mode 0: Hot Start 00184 * 1: Warm Start 00185 * 2: Cold Start 00186 * 00187 * @return int 1: Successful 00188 * 0: Failure 00189 */ 00190 int start_mode(int start_mode); 00191 00192 /** Send char to GNSS receiver 00193 * @param char 00194 * @return void 00195 */ 00196 void send_to_gnss(char); 00197 00198 /** Power On GNSS receiver 00199 * 00200 * @return void 00201 */ 00202 void power_on_gnss(); 00203 00204 }; 00205 #ifdef __cplusplus 00206 } 00207 #endif
Generated on Tue Jul 12 2022 14:18:20 by 1.7.2