Mercurial > public > ostc4
comparison Small_CPU/Src/GNSS.c @ 931:5a9bc2e6112d Evo_2_23
Added Sat Status Overview:
In addition to the navigation data now information regarding the satelliete and signal status are visualized. To enable the a new command has been added to the communication protocol and the position view has been extended.
author | Ideenmodellierer |
---|---|
date | Tue, 03 Dec 2024 20:32:51 +0100 |
parents | c0553dd70608 |
children | effadaa3a1f7 |
comparison
equal
deleted
inserted
replaced
930:25948e805406 | 931:5a9bc2e6112d |
---|---|
24 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | 24 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 *THE SOFTWARE. | 25 *THE SOFTWARE. |
26 ****************************************************************************** | 26 ****************************************************************************** |
27 */ | 27 */ |
28 | 28 |
29 #include <string.h> | |
29 #include "GNSS.h" | 30 #include "GNSS.h" |
30 | 31 |
31 union u_Short uShort; | 32 union u_Short uShort; |
32 union i_Short iShort; | 33 union i_Short iShort; |
33 union u_Long uLong; | 34 union u_Long uLong; |
239 /*! | 240 /*! |
240 * Parse data to UTC time solution standard. | 241 * Parse data to UTC time solution standard. |
241 * Look at: 32.17.30.1 u-blox 8 Receiver description. | 242 * Look at: 32.17.30.1 u-blox 8 Receiver description. |
242 * @param GNSS Pointer to main GNSS structure. | 243 * @param GNSS Pointer to main GNSS structure. |
243 */ | 244 */ |
245 void GNSS_ParseNavSatData(GNSS_StateHandle *GNSS) { | |
246 | |
247 uint8_t loop = 0; | |
248 uint8_t searchIndex = 0; | |
249 uint8_t statIndex = 0; /* only 4 state information will be forwarded */ | |
250 uint8_t signalQuality = 0; | |
251 GNSS->numSat = GNSS_Handle.uartWorkingBuffer[11]; | |
252 | |
253 memset(GNSS->statSat, 0, sizeof(GNSS->statSat)); | |
254 | |
255 if(GNSS->numSat > 0) | |
256 { | |
257 searchIndex = 0; | |
258 while((searchIndex < GNSS->numSat) && (statIndex < 4)) /* get good signal quality */ | |
259 { | |
260 signalQuality = (GNSS_Handle.uartWorkingBuffer[22 + searchIndex * 12] & 0x7); | |
261 if(signalQuality > 4) | |
262 { | |
263 GNSS->statSat[statIndex++] = signalQuality; | |
264 } | |
265 if(statIndex == 4) break; | |
266 searchIndex++; | |
267 } | |
268 searchIndex = 0; | |
269 while((searchIndex < GNSS->numSat) && (statIndex < 4)) /* get medium signal quality */ | |
270 { | |
271 signalQuality = (GNSS_Handle.uartWorkingBuffer[22 + searchIndex * 12] & 0x7); | |
272 if((signalQuality > 2) && (signalQuality <= 4)) | |
273 { | |
274 GNSS->statSat[statIndex++] = signalQuality; | |
275 } | |
276 if(statIndex == 4) break; | |
277 searchIndex++; | |
278 } | |
279 searchIndex = 0; | |
280 while((searchIndex < GNSS->numSat) && (statIndex < 4)) /* get poor signal quality */ | |
281 { | |
282 signalQuality = (GNSS_Handle.uartWorkingBuffer[22 + searchIndex * 12] & 0x7); | |
283 if(signalQuality <= 2) | |
284 { | |
285 GNSS->statSat[statIndex++] = signalQuality; | |
286 } | |
287 if(statIndex == 4) break; | |
288 searchIndex++; | |
289 } | |
290 loop++; | |
291 } | |
292 } | |
293 | |
244 void GNSS_ParseNavigatorData(GNSS_StateHandle *GNSS) { | 294 void GNSS_ParseNavigatorData(GNSS_StateHandle *GNSS) { |
245 uShort.bytes[0] = GNSS_Handle.uartWorkingBuffer[18]; | 295 uShort.bytes[0] = GNSS_Handle.uartWorkingBuffer[18]; |
246 uShort.bytes[1] = GNSS_Handle.uartWorkingBuffer[19]; | 296 uShort.bytes[1] = GNSS_Handle.uartWorkingBuffer[19]; |
247 GNSS->year = uShort.uShort; | 297 GNSS->year = uShort.uShort; |
248 GNSS->month = GNSS_Handle.uartWorkingBuffer[20]; | 298 GNSS->month = GNSS_Handle.uartWorkingBuffer[20]; |
249 GNSS->day = GNSS_Handle.uartWorkingBuffer[21]; | 299 GNSS->day = GNSS_Handle.uartWorkingBuffer[21]; |
250 GNSS->hour = GNSS_Handle.uartWorkingBuffer[22]; | 300 GNSS->hour = GNSS_Handle.uartWorkingBuffer[22]; |
251 GNSS->min = GNSS_Handle.uartWorkingBuffer[23]; | 301 GNSS->min = GNSS_Handle.uartWorkingBuffer[23]; |
252 GNSS->sec = GNSS_Handle.uartWorkingBuffer[24]; | 302 GNSS->sec = GNSS_Handle.uartWorkingBuffer[24]; |
253 } | 303 } |
304 | |
254 | 305 |
255 /*! | 306 /*! |
256 * Parse data to geodetic position solution standard. | 307 * Parse data to geodetic position solution standard. |
257 * Look at: 32.17.14.1 u-blox 8 Receiver description. | 308 * Look at: 32.17.14.1 u-blox 8 Receiver description. |
258 * @param GNSS Pointer to main GNSS structure. | 309 * @param GNSS Pointer to main GNSS structure. |