common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / positioning_hal / src / GpsCommon / MDev_Gps_Mtrx.cpp
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 /**
17 * @file MDev_Gps_Mtrx.cpp
18 */
19
20 /*---------------------------------------------------------------------------*/
21 // Include files
22 #include "MDev_Gps_Mtrx.h"
23 #include "positioning_def.h"
24
25 #include  "MDev_Gps_Main.h"
26 #include  "MDev_Gps_API.h"
27 #include  "MDev_GpsRecv.h"
28 #include  "MDev_Gps_Common.h"
29 #include  "MDev_Gps_Nmea.h"
30 #include  "MDev_Gps_TimerCtrl.h"
31
32 extern uint8_t g_gps_reset_cmd_sending;
33 /*---------------------------------------------------------------------------*/
34 // Functions
35
36 /********************************************************************************
37  * MODULE      : DEV_Gps_Nop
38  * ABSTRACT    : No processing
39  * FUNCTION    : NOP processing of the matrix 
40  * ARGUMENT    : None
41  * NOTE        :
42  * RETURN      : None
43  ********************************************************************************/
44 void DevGpsNop(void) {
45   return;
46 }
47
48 /********************************************************************************
49  * MODULE      : DEV_Gps_InitStart_SendReq
50  * ABSTRACT    : Startup confirmation - Transmit request reception matrix function
51  * FUNCTION    :
52  * ARGUMENT    :
53  * NOTE        :
54  * RETURN      :
55  ********************************************************************************/
56 void DevGpsInitStartSendReq(void) {
57   /** Send Request Receive Common Processing Call */
58   SendReqGpsCommon();
59   /* -- #GPF_60_040 */
60   return;
61 }
62
63 /********************************************************************************
64  * MODULE      : DEV_Gps_InitStart_GPSResetReq
65  * ABSTRACT    : Startup confirmation - GPS reset request reception matrix function
66  * FUNCTION    :
67  * ARGUMENT    :
68  * NOTE        :
69  * RETURN      :
70  ********************************************************************************/
71 void DevGpsInitStartGPSResetReq(void) {
72   /** Reset request reception common processing call */
73   GPSResetReqGpsCommon();
74   return;
75 }
76
77 /********************************************************************************
78  * MODULE      : DEV_Gps_InitStart_RcvCyclCmd
79  * ABSTRACT    : Startup confirmation - Cyclic receive command receive matrix function
80  * FUNCTION    :
81  * ARGUMENT    :
82  * NOTE        :
83  * RETURN      :
84  ********************************************************************************/
85 void DevGpsInitStartRcvCyclCmd(void) {
86   BOOL* pb_rcverr = &(g_gps_mngr.rcv_err_flag); /* GSP receiver error detection status */
87
88   /* Stop start confirmation monitoring timer */
89   (void)DevGpsTimeStop(GPS_STARTUP_TIMER);    /* Ignore -> MISRA-C:2004 Rule 16.10 */ /* QAC 3200 */
90
91   /* GPS receiver anomaly detection timer stopped */
92   (void)DevGpsTimeStop(GPS_RECEIVERERR_TIMER);
93
94   /* State transition processing(in operation)    */
95   ChangeStatusGpsCommon(GPS_STS_NORMAL);
96
97   // Send NAV-TIMEUTC sentence addition requests
98   DevGpsNavTimeUTCAddReq();
99
100   DevGpsWknRolloverGetReq();
101
102   /* Receive command analysis(u-blox) */
103   if (g_gps_reset_cmd_sending == FALSE) {
104       DevGpsRcvCyclCmd();
105   }
106
107   /* If a GPS receiver error is detected, the diagnosis code (current) is deleted. */
108   if (*pb_rcverr == TRUE) {
109     *pb_rcverr = FALSE;
110     DevSendGpsConnectError(FALSE);
111   }
112     // }
113   /* Reset retry counter */
114   RtyResetGpsCommon();
115
116   /* Sending pending commands */
117   SendSaveCmdGpsCommon();    /* State transition if pending commands exist( -> Sending) */
118
119   /* Cyclic reception data monitoring timer setting    */
120   (void)DevGpsTimeSet(GPS_CYCL_TIMER);    /* Ignore -> MISRA-C:2004 Rule 16.10 */ /* QAC 3200 */
121
122   /* GPS receiver anomaly detection timer setting */
123   (void)DevGpsTimeSet(GPS_RECEIVERERR_TIMER);
124
125   /* -- #GPF_60_024 */
126   return;
127 }
128
129 /********************************************************************************
130  * MODULE      : DEV_Gps_InitStart_CyclDataTimeOut
131  * ABSTRACT    : Startup confirmation - Reception cycle data monitoring timeout matrix function
132  * FUNCTION    :
133  * ARGUMENT    :
134  * NOTE        :
135  * RETURN      :
136  ********************************************************************************/
137 void DevGpsInitStartCyclDataTimeOut(void) {
138     uint8_t ret = RETRY_OFF;
139
140     POSITIONING_LOG("DEV_Gps_InitStart_CyclDataTimeOut");
141
142     g_wcnct_err++;             /* Count number of connection errors       */
143
144     /* Stop all timers         */
145     DevGpsTimeStop(GPS_STARTUP_TIMER);
146
147     DevGpsTimeStop(GPS_CYCL_TIMER);
148
149     DevGpsTimeStop(GPS_RECV_ACK_TIMER);
150
151     /* Hard reset judgment processing    */
152     ret = HardResetChkGpsCommon();
153     if (RETRY_ON == ret) {
154       DevGpsResetReq(PNO_NONE, 0);
155
156       SendSaveCmdGpsCommon();   /* State transition if pending commands exist( -> Sending) */
157     } else if (RETRY_OFF == ret) {
158         /* Fixed number of hard resets completed */
159     } else {
160         /* Retrying(with hard reset) */
161     }
162     /* Clear cyclic receive data up to now */
163     DevGpsCycleDataClear();
164     /* Start confirmation monitoring timer setting */
165     DevGpsTimeSet(GPS_STARTUP_TIMER);
166     return;
167 }
168
169 /******************************************************************************
170 @brief      DEV_Gps_InitStart_NaviDataTimeOut<BR>
171             Startup confirmation - Navigation providing data monitoring timeout matrix function
172 @outline    Navigation providing data monitoring timeout matrix processing during startup confirmation
173 @param[in]  none
174 @param[out] none
175 @return     none
176 @retval     none
177 *******************************************************************************/
178 void DevGpsInitStartNaviDataTimeOut(void) {
179 }
180
181 /******************************************************************************
182 @brief      DEV_Gps_InitStart_DiagClkGuardTimeOut<BR>
183             Startup confirmation - Time guard monitoring timeout matrix functions provided by diagnosis
184 @outline    Diagnosis provision time guard monitoring timeout matrix process during startup checking
185 @param[in]  none
186 @param[out] none
187 @return     none
188 @retval     none
189 *******************************************************************************/
190 void DevGpsInitStartDiagClkGuardTimeOut(void) {
191 }
192
193 /********************************************************************************
194  * MODULE      : DEV_Gps_InitStart_AccOffStart
195  * ABSTRACT    : Startup confirmation - Feature ACC-OFF instruction matrix functions
196  * FUNCTION    :
197  * ARGUMENT    :
198  * NOTE        :
199  * RETURN      :
200  ********************************************************************************/
201 void DevGpsInitStartAccOffStart(void) {
202 }
203
204 /******************************************************************************
205 @brief      DEV_Gps_InitStart_NaviInfoDeliver<BR>
206             Startup confirmation - Navigation information provision matrix processing
207 @outline    Navigation information provision matrix processing during startup confirmation
208 @param[in]  none
209 @param[out] none
210 @return     none
211 @retval     none
212 *******************************************************************************/
213 void DevGpsInitStartNaviInfoDeliver(void) {
214 }
215
216 /******************************************************************************
217 @brief      DEV_Gps_InitStart_NaviSpeedDeliver<BR>
218             Startup confirmation - Navigation vehicle speed information provision matrix processing
219 @outline    Navigation speed information provision matrix processing during startup confirmation
220 @param[in]  none
221 @param[out] none
222 @return     none
223 @retval     none
224 *******************************************************************************/
225 void DevGpsInitStartNaviSpeedDeliver(void) {
226 }
227
228 /******************************************************************************
229 @brief      DEV_Gps_InitStart_SettingTime<BR>
230             Startup confirmation - GPS time setting matrix processing
231 @outline    GPS time setting matrix process during startup confirmation
232 @param[in]  none
233 @param[out] none
234 @return     none
235 @retval     none
236 *******************************************************************************/
237 void DevGpsInitStartSettingTime(void) {
238   POSITIONING_LOG("DEV_Gps_InitStart_SettingTime\n");
239   DevGpsCommSettingTime();
240   return;
241 }
242
243 /* start #GPF_60_109 */
244 /******************************************************************************
245 @brief      DEV_Gps_InitStart_NmeaDataGuardTimeOut<BR>
246             Startup confirmation - NMEA monitoring timeout matrix processing
247 @outline    NMEA data-providing guard monitoring timeout process during startup checking
248 @param[in]  none
249 @param[out] none
250 @return     none
251 @retval     none
252 *******************************************************************************/
253 void DevGpsInitStartNmeaDataGuardTimeOut(void) {
254 }
255
256 /**
257  * @brief
258  *   Startup confirmation - Backup memory read request matrix processing
259  */
260 void DevGpsInitStartBackupDataLoadReq(void) {
261   POS_DATETIME st_date_time;
262   memset(&st_date_time, 0x00, sizeof(st_date_time));
263   /* Import GPS date and time settings */
264   DevGpsReadGpsTime(&st_date_time);
265   // Todo For Test don't need gstGpsFixCnt??
266   // DEV_Gps_ReadGpsFixCnt();     /* Read GPS fix count */
267   if (g_is_gpstime_sts == TRUE) {
268     DevGpsSettingTime(&st_date_time);  /* Time setting  */
269   }
270   return;
271 }
272
273 /**
274  * @brief
275  *   Startup confirmation - Thread stop request matrix processing
276  */
277 void DevGpsInitStartStopReq(void) {
278   /* Thread stop processing */
279   StopThreadGpsCommon();
280
281   return;
282 }
283
284 /**
285  * @brief
286  *   Startup confirmation - GPS week adjustment counter notification process
287  */
288 void DevGpsInitStartGpsweekcorcntNtf(void) {
289   DevGpsSetGpsweekcorcnt();
290   return;
291 }
292
293 /**
294  * @brief
295  *   Startup confirmation - GPS recovery timeout process
296  */
297 void DevGpsInitStartRecoveryTimeOut(void) {
298   return;
299 }
300
301 /**
302  * @brief
303  *   Startup confirmation - GPS receiver anomaly detection timeout processing
304  */
305 void DevGpsInitStartGpsReceiverErrTimeOut(void) {
306   BOOL* pb_rcverr = &(g_gps_mngr.rcv_err_flag); /* GSP receiver error detection status */
307
308   *pb_rcverr = TRUE;
309   DevSendGpsConnectError(TRUE);
310   return;
311 }
312
313 /********************************************************************************
314  * MODULE      : DEV_Gps_Normal_SendReq
315  * ABSTRACT    : In operation - Transmit request reception matrix function
316  * FUNCTION    :
317  * ARGUMENT    :
318  * NOTE        :
319  * RETURN      :
320  ********************************************************************************/
321 void DevGpsNormalSendReq(void) {
322   /** Store in a pending buffer #GPF_60_040 */
323   SendReqGpsCommon();
324
325   /** Send the command #GPF_60_040 */
326   SendSaveCmdGpsCommon();
327   return;
328 }
329
330 /********************************************************************************
331  * MODULE      : DEV_Gps_Normal_GPSResetReq
332  * ABSTRACT    : In operation - GPS reset request reception matrix function
333  * FUNCTION    :
334  * ARGUMENT    :
335  * NOTE        :
336  * RETURN      :
337  ********************************************************************************/
338 void DevGpsNormalGPSResetReq(void) {
339   /** Store in a pending buffer #GPF_60_040 */
340   GPSResetReqGpsCommon();
341
342   /** Send the command #GPF_60_040 */
343   SendSaveCmdGpsCommon();
344   return;
345 }
346
347 /********************************************************************************
348  * MODULE      : DEV_Gps_Normal_RcvCyclCmd_Nmea
349  * ABSTRACT    : In operation - Cyclic receive command receive matrix function
350  * FUNCTION    :
351  * ARGUMENT    :
352  * NOTE        :
353  * RETURN      :
354  ********************************************************************************/
355 void DevGpsNormalRcvCyclCmd(void) {
356   /* Cyclic reception data monitoring timer stopped */
357   (void)DevGpsTimeStop(GPS_CYCL_TIMER);
358   /* GPS receiver anomaly detection timer stopped */
359   (void)DevGpsTimeStop(GPS_RECEIVERERR_TIMER);
360
361   /* Notify Vehicle Sensor */
362   if (g_gps_reset_cmd_sending == FALSE) {
363     DevGpsRcvCyclCmd();
364   }
365
366   /* Reset retry counter */
367   RtyResetGpsCommon();
368
369   /* Cyclic reception data monitoring timer setting */
370   (void)DevGpsTimeSet(GPS_CYCL_TIMER);  /* Ignore -> MISRA-C:2004 Rule 16.10 */ /* QAC 3200 */
371
372   /* GPS receiver anomaly detection timer setting */
373   (void)DevGpsTimeSet(GPS_RECEIVERERR_TIMER);
374
375   return;
376 }
377
378 /********************************************************************************
379  * MODULE      : DEV_Gps_Normal_CyclDataTimeOut
380  * ABSTRACT    : In operation - Reception cycle data monitoring timeout matrix function
381  * FUNCTION    :
382  * ARGUMENT    :
383  * NOTE        :
384  * RETURN      :
385  ********************************************************************************/
386 void DevGpsNormalCyclDataTimeOut(void) {
387   /* Cyclic reception timeout common processing call */
388   CyclDataTimeOutGpsCommon();
389 }
390
391 /******************************************************************************
392 @brief      DEV_Gps_Normal_NaviDataTimeOut<BR>
393             In operation - Navigation providing data monitoring timeout matrix function
394 @outline    Navigation providing data monitoring timeout matrix processing during operation
395 @param[in]  none
396 @param[out] none
397 @return     none
398 @retval     none
399 *******************************************************************************/
400 void DevGpsNormalNaviDataTimeOut(void) {
401 }
402
403 /******************************************************************************
404 @brief      DEV_Gps_Normal_DiagClkGuardTimeOut<BR>
405             In operation - Time guard monitoring timeout matrix functions provided by diagnosis
406 @outline    Diagnosis provision time guard monitoring timeout matrix process during operation
407 @param[in]  none
408 @param[out] none
409 @return     none
410 @retval     none
411 *******************************************************************************/
412 void DevGpsNormalDiagClkGuardTimeOut(void) {
413 }
414
415 /********************************************************************************
416  * MODULE      : DEV_Gps_Normal_AccOffStart
417  * ABSTRACT    : Startup confirmation - Feature ACC-OFF instruction matrix functions
418  * FUNCTION    :
419  * ARGUMENT    :
420  * NOTE        :
421  * RETURN      :
422  ********************************************************************************/
423 void DevGpsNormalAccOffStart(void) {
424 }
425
426 /******************************************************************************
427 @brief      DEV_Gps_Normal_NaviInfoDeliver<BR>
428             In operation - Navigation information provision matrix processing
429 @outline    Navigation information provision matrix processing during operation
430 @param[in]  none
431 @param[out] none
432 @return     none
433 @retval     none
434 *******************************************************************************/
435 void DevGpsNormalNaviInfoDeliver(void) {
436 }
437
438 /******************************************************************************
439 @brief      DEV_Gps_Normal_NaviSpeedDeliver<BR>
440             In operation - Navigation vehicle speed information provision matrix processing
441 @outline    Navigation vehicle speed information provision matrix processing during operation
442 @param[in]  none
443 @param[out] none
444 @return     none
445 @retval     none
446 *******************************************************************************/
447 void DevGpsNormalNaviSpeedDeliver(void) {
448 }
449
450 /******************************************************************************
451 @brief      DEV_Gps_Normal_SettingTime<BR>
452             In operation - GPS time setting matrix processing
453 @outline    GPS time setting matrix processing during operation
454 @param[in]  none
455 @param[out] none
456 @return     none
457 @retval     none
458 *******************************************************************************/
459 void DevGpsNormalSettingTime(void) {
460   POSITIONING_LOG("DEV_Gps_Normal_SettingTime");
461   DevGpsCommSettingTime();
462   /** Send the command */
463   SendSaveCmdGpsCommon();
464
465   return;
466 }
467
468 /* start #GPF_60_109 */
469 /******************************************************************************
470 @brief      DEV_Gps_Normal_NmeaDataGuardTimeOut<BR>
471             In operation - NMEA monitoring timeout matrix processing
472 @outline    NMEA data-providing guard monitoring timeout process during operation
473 @param[in]  none
474 @param[out] none
475 @return     none
476 @retval     none
477 *******************************************************************************/
478 void DevGpsNormalNmeaDataGuardTimeOut(void) {
479 }
480
481 /**
482  * @brief
483  *   In operation - Backup memory read request matrix processing
484  */
485 void DevGpsNormalBackupDataLoadReq(void) {
486   POS_DATETIME st_date_time;
487   memset(&st_date_time, 0x00, sizeof(st_date_time));
488   /* Import GPS date and time settings */
489   DevGpsReadGpsTime(&st_date_time);
490   // Todo For test don't need gstGpsFixCnt??
491   // DEV_Gps_ReadGpsFixCnt();     /* Read GPS fix count */
492   if (g_is_gpstime_sts == TRUE) {
493        DevGpsSettingTime(&st_date_time); /* Time setting  */
494   }
495   return;
496 }
497
498 /**
499  * @brief
500  *   In operation - Thread stop request matrix processing
501  */
502 void DevGpsNormalStopReq(void) {
503   /* Thread stop processing */
504   StopThreadGpsCommon();
505
506   return;
507 }
508
509 /**
510  * @brief
511  *   In operation - GPS week adjustment counter notification process
512  */
513 void DevGpsNormalGpsweekcorcntNtf(void) {
514   DevGpsSetGpsweekcorcnt();
515   return;
516 }
517
518 /**
519  * @brief
520  *   In operation - GPS recovery timeout processing
521  */
522 void DevGpsNormalRecoveryTimeOut(void) {
523 }
524
525 /**
526  * @brief
527  *   In operation - GPS receiver anomaly detection timeout processing
528  */
529 void DevGpsNormalGpsReceiverErrTimeOut(void) {
530   BOOL* pb_rcverr = &(g_gps_mngr.rcv_err_flag); /* GSP receiver error detection status */
531
532   *pb_rcverr = TRUE;
533   DevSendGpsConnectError(TRUE);
534   return;
535 }
536
537 /* ++ #GPF_60_040 */
538 /******************************************************************************
539 @brief      DEV_Gps_Send_SendReq<BR>
540             Sending - Transmit request reception matrix function
541 @outline    Processing for receiving a transmission request during transmission
542 @param[in]  none
543 @param[out] none
544 @return     none
545 @retval     none
546 *******************************************************************************/
547 void DevGpsSendSendReq(void) {
548   SendReqGpsCommon();
549   return;
550 }
551
552 /******************************************************************************
553 @brief      DEV_Gps_Send_GPSResetReq<BR>
554             Sending - GPS reset request reception matrix function
555 @outline    Processing when receiving a GPS reset request during transmission
556 @param[in]  none
557 @param[out] none
558 @return     none
559 @retval     none
560 *******************************************************************************/
561 void DevGpsSendGPSResetReq(void) {
562   GPSResetReqGpsCommon();
563   return;
564 }
565
566 /******************************************************************************
567 @brief      DEV_Gps_Send_RcvCyclCmd<BR>
568             Sending - Cyclic receive command receive matrix function
569 @outline    Processing at the reception of cyclic reception command during transmission
570 @param[in]  none
571 @param[out] none
572 @return     none
573 @retval     none
574 *******************************************************************************/
575 void DevGpsSendRcvCyclCmd(void) {
576     /* Cyclic reception data monitoring timer stopped */
577     DevGpsTimeStop(GPS_CYCL_TIMER);
578
579     /* GPS receiver anomaly detection timer stopped */
580     DevGpsTimeStop(GPS_RECEIVERERR_TIMER);
581
582     /* Notify Vehicle Sensor */
583     if (g_gps_reset_cmd_sending == FALSE) {
584         DevGpsRcvCyclCmd();
585     }
586
587     /* Reset retry counter */
588     RtyResetGpsCommon();
589
590     /* Cyclic reception data monitoring timer setting */
591     (void)DevGpsTimeSet(GPS_CYCL_TIMER);
592
593     (void)DevGpsTimeSet(GPS_RECEIVERERR_TIMER);
594
595     return;
596 }
597
598 /******************************************************************************
599 @brief      DEV_Gps_Send_RcvRspCmd<BR>
600             Sending - Response command reception matrix function
601 @outline    Processing when receiving a response command during transmission
602 @param[in]  none
603 @param[out] none
604 @return     none
605 @retval     none
606 *******************************************************************************/
607 void DevGpsSendRcvRspCmd(void) {
608     TG_GPS_OUTPUT_FORMAT  rcv_cmd = g_gps_mngr.rcv_cmd;
609     BOOL b_snd_flag = TRUE;
610
611     /** Check whether the command matches the command being monitored. */
612     if (rcv_cmd == g_gps_mngr.resp_cmd) {
613         /** When the command being monitored is a cold start request */
614         if (g_gps_mngr.resp_rst_flag == GPS_CMD_RESET) {
615             POSITIONING_LOG("GPS_CMD_RESET\n");
616             b_snd_flag = DevGpsRcvProcGpsResetResp(reinterpret_cast<TG_GPS_RCV_DATA*>
617                                                     (reinterpret_cast<void*>(g_gps_msg_rcvr.msgdat)));
618         } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_TIMESET) {
619             POSITIONING_LOG("GPS_CMD_TIMESET\n");
620             DevGpsRcvProcTimeSetResp(reinterpret_cast<TG_GPS_RCV_DATA*>
621                                                     (reinterpret_cast<void*>(g_gps_msg_rcvr.msgdat)));
622         } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_SENTENCEADD_NAVTIMEUTC) {
623           POSITIONING_LOG("GPS_CMD_SENTENCEADD_NAVTIMEUTC\n");
624           DevGpsRcvProcNavSvinfoAddResp(reinterpret_cast<TG_GPS_RCV_DATA*>
625                                                     (reinterpret_cast<void*>(g_gps_msg_rcvr.msgdat)));
626         } else if ( g_gps_mngr.resp_rst_flag == GPS_CMD_WKNROLLOVER ) {
627           POSITIONING_LOG("GPS_CMD_WKNROLLOVER\n");
628           DevGpsRcvProcWknRolloverGetResp(reinterpret_cast<TG_GPS_RCV_DATA*>
629                                                     (reinterpret_cast<void*>(g_gps_msg_rcvr.msgdat)));
630         } else {
631           POSITIONING_LOG("g_gps_mngr.resp_rst_flag INVALID!! [resp_rst_flag = %d]", g_gps_mngr.resp_rst_flag);
632         }
633
634         if (b_snd_flag == TRUE) {
635           /** Stop ACK monitoring timer */
636           DevGpsTimeStop(GPS_RECV_ACK_TIMER);
637           /* State transition processing(in operation)  */
638           ChangeStatusGpsCommon(GPS_STS_NORMAL);
639           /** Reset retry counter */
640           SendRtyResetGpsCommon();
641           /** Delete command from pending buffer */
642           DeleteSaveCmdGpsCommon();
643           /* Sending pending commands */
644           SendSaveCmdGpsCommon();
645         }
646     } else {
647     }
648
649     return;
650 }
651
652 /******************************************************************************
653 @brief      DEV_Gps_Send_RspDataTimeOut<BR>
654             Sending - Response monitoring timeout reception matrix function
655 @outline    Processing at reception of response monitoring timeout during transmission
656 @param[in]  none
657 @param[out] none
658 @return     none
659 @retval     none
660 *******************************************************************************/
661 void DevGpsSendRspDataTimeOut(void) {
662     DevGpsTimeStop(GPS_RECV_ACK_TIMER);
663     /** Send retry count */
664     g_gps_mngr.sndcnt++;
665
666     /** Retry judgment */
667     if (g_gps_mngr.sndcnt == SNDNG_MAX) {
668         /** At the time of retry */
669         POSITIONING_LOG("GPS Hw Reset : sndcnt[%d]", g_gps_mngr.sndcnt);
670
671         /** When the command being monitored is a cold start request */
672         if (g_gps_mngr.resp_rst_flag == GPS_CMD_RESET) {
673           POSITIONING_LOG("g_gps_mngr.sndcnt == SNDNG_MAX (GPS_CMD_RESET)");
674           /** Send Reset ResponseCommunication error */
675           DevGpsRstAnsSend(g_gps_mngr.resp_pno, g_gps_mngr.resp_rid, GPS_SENDNG);
676           g_gps_reset_cmd_sending = FALSE;
677
678         } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_TIMESET) {
679             POSITIONING_LOG("g_gps_mngr.sndcnt == SNDNG_MAX (GPS_CMD_TIMESET)");
680             DevGpsTimesetAnsSend(g_gps_mngr.resp_pno, g_gps_mngr.resp_rid, GPS_SENDNG);
681         } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_SENTENCEADD_NAVTIMEUTC) {
682             POSITIONING_LOG("g_gps_mngr.sndcnt == SNDNG_MAX (GPS_CMD_SENTENCEADD_NAVTIMEUTC)");
683             DevGpsNavTimeUTCAddReq(); /* Retransmission of requests to add NAV-SVINFO commands */
684         } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_WKNROLLOVER) {  /* GPS rollover reference date acquisition response */
685             POSITIONING_LOG("g_gps_mngr.sndcnt == SNDNG_MAX (GPS_CMD_WKNROLLOVER)");
686             DevGpsWknRolloverGetReq(); /* GPS rollover standard week number acquisition request retransmission */
687         } else {
688             POSITIONING_LOG("g_gps_mngr.resp_rst_flag INVALID!! [resp_rst_flag = %d]", g_gps_mngr.resp_rst_flag);
689         }
690
691         DeleteSaveCmdGpsCommon();
692
693         ChangeStatusGpsCommon(GPS_STS_NORMAL);
694
695         SendSaveCmdGpsCommon();
696         /** Reset retry counter */
697         SendRtyResetGpsCommon();
698     } else {
699         POSITIONING_LOG("GPS Send Retry : sndcnt[%d]", g_gps_mngr.sndcnt);
700         /** Retransmission of pending command */
701         SendSaveCmdGpsCommon();
702     }
703
704     return;
705 }
706
707 /******************************************************************************
708 @brief      DEV_Gps_Send_CyclDataTimeOut<BR>
709             Sending - Reception cycle data monitoring timeout matrix function
710 @outline    Processing when receiving periodic reception data monitoring timeout during transmission
711 @param[in]  none
712 @param[out] none
713 @return     none
714 @retval     none
715 *******************************************************************************/
716 void DevGpsSendCyclDataTimeOut(void) {
717   CyclDataTimeOutGpsCommon();
718 }
719
720 /******************************************************************************
721 @brief      DEV_Gps_Send_NaviDataTimeOut<BR>
722             Sending - Navigation providing data monitoring timeout matrix function
723 @outline    Navigation providing data monitoring timeout matrix processing during transmission
724 @param[in]  none
725 @param[out] none
726 @return     none
727 @retval     none
728 *******************************************************************************/
729 void DevGpsSendNaviDataTimeOut(void) {
730 }
731
732 /******************************************************************************
733 @brief      DEV_Gps_Send_DiagClkGuardTimeOut<BR>
734             Sending - Time guard monitoring timeout matrix functions provided by diagnosis
735 @outline    Diagnosis providing time guard monitoring timeout matrix process during sending
736 @param[in]  none
737 @param[out] none
738 @return     none
739 @retval     none
740 *******************************************************************************/
741 void DevGpsSendDiagClkGuardTimeOut(void) {
742 }
743
744 /******************************************************************************
745 @brief      DEV_Gps_Send_AccOffStart<BR>
746             Sending - Feature ACC-OFF instruction reception matrix functions
747 @outline    Processing when receiving ACC-OFF instruction in function being transmitted
748 @param[in]  none
749 @param[out] none
750 @return     none
751 @retval     none
752 *******************************************************************************/
753 void DevGpsSendAccOffStart(void) {
754 }
755
756 /******************************************************************************
757 @brief      DEV_Gps_Send_NaviInfoDeliver<BR>
758             Sending - Navigation information provision matrix processing
759 @outline    Navigation information provision matrix processing during transmission
760 @param[in]  none
761 @param[out] none
762 @return     none
763 @retval     none
764 *******************************************************************************/
765 void DevGpsSendNaviInfoDeliver(void) {
766 }
767
768 /******************************************************************************
769 @brief      DEV_Gps_Send_NaviSpeedDeliver<BR>
770             Sending - Navigation vehicle speed information provision matrix processing
771 @outline    Navigation vehicle speed information provision matrix processing during transmission
772 @param[in]  none
773 @param[out] none
774 @return     none
775 @retval     none
776 *******************************************************************************/
777 void DevGpsSendNaviSpeedDeliver(void) {
778 }
779
780 /******************************************************************************
781 @brief      DEV_Gps_Send_SettingTime<BR>
782             Sending - GPS time setting matrix processing
783 @outline    GPS time setting matrix processing during transmission
784 @param[in]  none
785 @param[out] none
786 @return     none
787 @retval     none
788 *******************************************************************************/
789 void DevGpsSendSettingTime(void) {
790   DevGpsCommSettingTime();
791   return;
792 }
793
794 /* start #GPF_60_109 */
795 /******************************************************************************
796 @brief      DEV_Gps_Send_NmeaDataGuardTimeOut<BR>
797             Sending - NMEA monitoring timeout matrix processing
798 @outline    Sending NMEA monitoring timeouts
799 @param[in]  none
800 @param[out] none
801 @return     none
802 @retval     none
803 *******************************************************************************/
804 void DevGpsSendNmeaDataGuardTimeOut(void) {
805 }
806
807 /**
808  * @brief
809  *   Sending - Backup memory read request matrix processing
810  */
811 void DevGpsSendBackupDataLoadReq(void) {
812   POS_DATETIME st_date_time;
813
814   memset(&st_date_time, 0x00, sizeof(st_date_time));
815   /* Import GPS date and time settings */
816   DevGpsReadGpsTime(&st_date_time);
817   // Todo For test don't need gstGpsFixCnt??
818   // DEV_Gps_ReadGpsFixCnt();     /* Read GPS fix count */
819   if (g_is_gpstime_sts == TRUE) {
820        DevGpsSettingTime(&st_date_time); /* Time setting  */
821   }
822
823   return;
824 }
825
826 /**
827  * @brief
828  *   Sending - Thread stop request matrix processing
829  */
830 void DevGpsSendStopReq(void) {
831   /* Thread stop processing */
832   StopThreadGpsCommon();
833   return;
834 }
835
836 /**
837  * @brief
838  *   Sending - GPS week adjustment counter notification process
839  */
840 void DevGpsSendGpsweekcorcntNtf(void) {
841   DevGpsSetGpsweekcorcnt();
842   return;
843 }
844
845 /**
846  * @brief
847  *   Sending - GPS recovery timeout processing
848  */
849 void DevGpsSendRecoveryTimeOut(void) {
850   return;
851 }
852
853 /**
854  * @brief
855  *   Sending - GPS receiver anomaly detection timeout processing
856  */
857 void DevGpsSendGpsReceiverErrTimeOut(void) {
858   BOOL* pb_rcverr = &(g_gps_mngr.rcv_err_flag); /* GSP receiver error detection status */
859
860   *pb_rcverr = TRUE;
861   DevSendGpsConnectError(TRUE);
862   return;
863 }
864
865 /*---------------------------------------------------------------------------*/
866 /*EOF*/