summaryrefslogtreecommitdiffstats
path: root/positioning_hal/src/GpsCommon/MDev_Gps_Mtrx.cpp
blob: b36a617caf669966dedfc901fbe0cb2f8e0b9e64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
* @file MDev_Gps_Mtrx.cpp
*/

/*---------------------------------------------------------------------------*/
// Include files
#include "MDev_Gps_Mtrx.h"
#include "positioning_def.h"

#include  "MDev_Gps_Main.h"
#include  "MDev_Gps_API.h"
#include  "MDev_GpsRecv.h"
#include  "MDev_Gps_Common.h"
#include  "MDev_Gps_Nmea.h"
#include  "MDev_Gps_TimerCtrl.h"

extern uint8_t g_gps_reset_cmd_sending;
/*---------------------------------------------------------------------------*/
// Functions

/********************************************************************************
 * MODULE      : DEV_Gps_Nop
 * ABSTRACT    : No processing
 * FUNCTION    : NOP processing of the matrix 
 * ARGUMENT    : None
 * NOTE        :
 * RETURN      : None
 ********************************************************************************/
void DevGpsNop(void) {
  return;
}

/********************************************************************************
 * MODULE      : DEV_Gps_InitStart_SendReq
 * ABSTRACT    : Startup confirmation - Transmit request reception matrix function
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsInitStartSendReq(void) {
  /** Send Request Receive Common Processing Call */
  SendReqGpsCommon();
  /* -- #GPF_60_040 */
  return;
}

/********************************************************************************
 * MODULE      : DEV_Gps_InitStart_GPSResetReq
 * ABSTRACT    : Startup confirmation - GPS reset request reception matrix function
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsInitStartGPSResetReq(void) {
  /** Reset request reception common processing call */
  GPSResetReqGpsCommon();
  return;
}

/********************************************************************************
 * MODULE      : DEV_Gps_InitStart_RcvCyclCmd
 * ABSTRACT    : Startup confirmation - Cyclic receive command receive matrix function
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsInitStartRcvCyclCmd(void) {
  BOOL* pb_rcverr = &(g_gps_mngr.rcv_err_flag); /* GSP receiver error detection status */

  /* Stop start confirmation monitoring timer */
  (void)DevGpsTimeStop(GPS_STARTUP_TIMER);    /* Ignore -> MISRA-C:2004 Rule 16.10 */ /* QAC 3200 */

  /* GPS receiver anomaly detection timer stopped */
  (void)DevGpsTimeStop(GPS_RECEIVERERR_TIMER);

  /* State transition processing(in operation)    */
  ChangeStatusGpsCommon(GPS_STS_NORMAL);

  // Send NAV-TIMEUTC sentence addition requests
  DevGpsNavTimeUTCAddReq();

  DevGpsWknRolloverGetReq();

  /* Receive command analysis(u-blox) */
  if (g_gps_reset_cmd_sending == FALSE) {
      DevGpsRcvCyclCmd();
  }

  /* If a GPS receiver error is detected, the diagnosis code (current) is deleted. */
  if (*pb_rcverr == TRUE) {
    *pb_rcverr = FALSE;
    DevSendGpsConnectError(FALSE);
  }
    // }
  /* Reset retry counter */
  RtyResetGpsCommon();

  /* Sending pending commands */
  SendSaveCmdGpsCommon();    /* State transition if pending commands exist( -> Sending) */

  /* Cyclic reception data monitoring timer setting    */
  (void)DevGpsTimeSet(GPS_CYCL_TIMER);    /* Ignore -> MISRA-C:2004 Rule 16.10 */ /* QAC 3200 */

  /* GPS receiver anomaly detection timer setting */
  (void)DevGpsTimeSet(GPS_RECEIVERERR_TIMER);

  /* -- #GPF_60_024 */
  return;
}

/********************************************************************************
 * MODULE      : DEV_Gps_InitStart_CyclDataTimeOut
 * ABSTRACT    : Startup confirmation - Reception cycle data monitoring timeout matrix function
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsInitStartCyclDataTimeOut(void) {
    uint8_t ret = RETRY_OFF;

    POSITIONING_LOG("DEV_Gps_InitStart_CyclDataTimeOut");

    g_wcnct_err++;             /* Count number of connection errors       */

    /* Stop all timers         */
    DevGpsTimeStop(GPS_STARTUP_TIMER);

    DevGpsTimeStop(GPS_CYCL_TIMER);

    DevGpsTimeStop(GPS_RECV_ACK_TIMER);

    /* Hard reset judgment processing    */
    ret = HardResetChkGpsCommon();
    if (RETRY_ON == ret) {
      DevGpsResetReq(PNO_NONE, 0);

      SendSaveCmdGpsCommon();   /* State transition if pending commands exist( -> Sending) */
    } else if (RETRY_OFF == ret) {
        /* Fixed number of hard resets completed */
    } else {
        /* Retrying(with hard reset) */
    }
    /* Clear cyclic receive data up to now */
    DevGpsCycleDataClear();
    /* Start confirmation monitoring timer setting */
    DevGpsTimeSet(GPS_STARTUP_TIMER);
    return;
}

/******************************************************************************
@brief      DEV_Gps_InitStart_NaviDataTimeOut<BR>
            Startup confirmation - Navigation providing data monitoring timeout matrix function
@outline    Navigation providing data monitoring timeout matrix processing during startup confirmation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsInitStartNaviDataTimeOut(void) {
}

/******************************************************************************
@brief      DEV_Gps_InitStart_DiagClkGuardTimeOut<BR>
            Startup confirmation - Time guard monitoring timeout matrix functions provided by diagnosis
@outline    Diagnosis provision time guard monitoring timeout matrix process during startup checking
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsInitStartDiagClkGuardTimeOut(void) {
}

/********************************************************************************
 * MODULE      : DEV_Gps_InitStart_AccOffStart
 * ABSTRACT    : Startup confirmation - Feature ACC-OFF instruction matrix functions
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsInitStartAccOffStart(void) {
}

/******************************************************************************
@brief      DEV_Gps_InitStart_NaviInfoDeliver<BR>
            Startup confirmation - Navigation information provision matrix processing
@outline    Navigation information provision matrix processing during startup confirmation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsInitStartNaviInfoDeliver(void) {
}

/******************************************************************************
@brief      DEV_Gps_InitStart_NaviSpeedDeliver<BR>
            Startup confirmation - Navigation vehicle speed information provision matrix processing
@outline    Navigation speed information provision matrix processing during startup confirmation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsInitStartNaviSpeedDeliver(void) {
}

/******************************************************************************
@brief      DEV_Gps_InitStart_SettingTime<BR>
            Startup confirmation - GPS time setting matrix processing
@outline    GPS time setting matrix process during startup confirmation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsInitStartSettingTime(void) {
  POSITIONING_LOG("DEV_Gps_InitStart_SettingTime\n");
  DevGpsCommSettingTime();
  return;
}

/* start #GPF_60_109 */
/******************************************************************************
@brief      DEV_Gps_InitStart_NmeaDataGuardTimeOut<BR>
            Startup confirmation - NMEA monitoring timeout matrix processing
@outline    NMEA data-providing guard monitoring timeout process during startup checking
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsInitStartNmeaDataGuardTimeOut(void) {
}

/**
 * @brief
 *   Startup confirmation - Backup memory read request matrix processing
 */
void DevGpsInitStartBackupDataLoadReq(void) {
  POS_DATETIME st_date_time;
  memset(&st_date_time, 0x00, sizeof(st_date_time));
  /* Import GPS date and time settings */
  DevGpsReadGpsTime(&st_date_time);
  // Todo For Test don't need gstGpsFixCnt??
  // DEV_Gps_ReadGpsFixCnt();     /* Read GPS fix count */
  if (g_is_gpstime_sts == TRUE) {
    DevGpsSettingTime(&st_date_time);  /* Time setting  */
  }
  return;
}

/**
 * @brief
 *   Startup confirmation - Thread stop request matrix processing
 */
void DevGpsInitStartStopReq(void) {
  /* Thread stop processing */
  StopThreadGpsCommon();

  return;
}

/**
 * @brief
 *   Startup confirmation - GPS week adjustment counter notification process
 */
void DevGpsInitStartGpsweekcorcntNtf(void) {
  DevGpsSetGpsweekcorcnt();
  return;
}

/**
 * @brief
 *   Startup confirmation - GPS recovery timeout process
 */
void DevGpsInitStartRecoveryTimeOut(void) {
  return;
}

/**
 * @brief
 *   Startup confirmation - GPS receiver anomaly detection timeout processing
 */
void DevGpsInitStartGpsReceiverErrTimeOut(void) {
  BOOL* pb_rcverr = &(g_gps_mngr.rcv_err_flag); /* GSP receiver error detection status */

  *pb_rcverr = TRUE;
  DevSendGpsConnectError(TRUE);
  return;
}

/********************************************************************************
 * MODULE      : DEV_Gps_Normal_SendReq
 * ABSTRACT    : In operation - Transmit request reception matrix function
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsNormalSendReq(void) {
  /** Store in a pending buffer #GPF_60_040 */
  SendReqGpsCommon();

  /** Send the command #GPF_60_040 */
  SendSaveCmdGpsCommon();
  return;
}

/********************************************************************************
 * MODULE      : DEV_Gps_Normal_GPSResetReq
 * ABSTRACT    : In operation - GPS reset request reception matrix function
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsNormalGPSResetReq(void) {
  /** Store in a pending buffer #GPF_60_040 */
  GPSResetReqGpsCommon();

  /** Send the command #GPF_60_040 */
  SendSaveCmdGpsCommon();
  return;
}

/********************************************************************************
 * MODULE      : DEV_Gps_Normal_RcvCyclCmd_Nmea
 * ABSTRACT    : In operation - Cyclic receive command receive matrix function
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsNormalRcvCyclCmd(void) {
  /* Cyclic reception data monitoring timer stopped */
  (void)DevGpsTimeStop(GPS_CYCL_TIMER);
  /* GPS receiver anomaly detection timer stopped */
  (void)DevGpsTimeStop(GPS_RECEIVERERR_TIMER);

  /* Notify Vehicle Sensor */
  if (g_gps_reset_cmd_sending == FALSE) {
    DevGpsRcvCyclCmd();
  }

  /* Reset retry counter */
  RtyResetGpsCommon();

  /* Cyclic reception data monitoring timer setting */
  (void)DevGpsTimeSet(GPS_CYCL_TIMER);  /* Ignore -> MISRA-C:2004 Rule 16.10 */ /* QAC 3200 */

  /* GPS receiver anomaly detection timer setting */
  (void)DevGpsTimeSet(GPS_RECEIVERERR_TIMER);

  return;
}

/********************************************************************************
 * MODULE      : DEV_Gps_Normal_CyclDataTimeOut
 * ABSTRACT    : In operation - Reception cycle data monitoring timeout matrix function
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsNormalCyclDataTimeOut(void) {
  /* Cyclic reception timeout common processing call */
  CyclDataTimeOutGpsCommon();
}

/******************************************************************************
@brief      DEV_Gps_Normal_NaviDataTimeOut<BR>
            In operation - Navigation providing data monitoring timeout matrix function
@outline    Navigation providing data monitoring timeout matrix processing during operation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsNormalNaviDataTimeOut(void) {
}

/******************************************************************************
@brief      DEV_Gps_Normal_DiagClkGuardTimeOut<BR>
            In operation - Time guard monitoring timeout matrix functions provided by diagnosis
@outline    Diagnosis provision time guard monitoring timeout matrix process during operation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsNormalDiagClkGuardTimeOut(void) {
}

/********************************************************************************
 * MODULE      : DEV_Gps_Normal_AccOffStart
 * ABSTRACT    : Startup confirmation - Feature ACC-OFF instruction matrix functions
 * FUNCTION    :
 * ARGUMENT    :
 * NOTE        :
 * RETURN      :
 ********************************************************************************/
void DevGpsNormalAccOffStart(void) {
}

/******************************************************************************
@brief      DEV_Gps_Normal_NaviInfoDeliver<BR>
            In operation - Navigation information provision matrix processing
@outline    Navigation information provision matrix processing during operation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsNormalNaviInfoDeliver(void) {
}

/******************************************************************************
@brief      DEV_Gps_Normal_NaviSpeedDeliver<BR>
            In operation - Navigation vehicle speed information provision matrix processing
@outline    Navigation vehicle speed information provision matrix processing during operation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsNormalNaviSpeedDeliver(void) {
}

/******************************************************************************
@brief      DEV_Gps_Normal_SettingTime<BR>
            In operation - GPS time setting matrix processing
@outline    GPS time setting matrix processing during operation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsNormalSettingTime(void) {
  POSITIONING_LOG("DEV_Gps_Normal_SettingTime");
  DevGpsCommSettingTime();
  /** Send the command */
  SendSaveCmdGpsCommon();

  return;
}

/* start #GPF_60_109 */
/******************************************************************************
@brief      DEV_Gps_Normal_NmeaDataGuardTimeOut<BR>
            In operation - NMEA monitoring timeout matrix processing
@outline    NMEA data-providing guard monitoring timeout process during operation
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsNormalNmeaDataGuardTimeOut(void) {
}

/**
 * @brief
 *   In operation - Backup memory read request matrix processing
 */
void DevGpsNormalBackupDataLoadReq(void) {
  POS_DATETIME st_date_time;
  memset(&st_date_time, 0x00, sizeof(st_date_time));
  /* Import GPS date and time settings */
  DevGpsReadGpsTime(&st_date_time);
  // Todo For test don't need gstGpsFixCnt??
  // DEV_Gps_ReadGpsFixCnt();     /* Read GPS fix count */
  if (g_is_gpstime_sts == TRUE) {
       DevGpsSettingTime(&st_date_time); /* Time setting  */
  }
  return;
}

/**
 * @brief
 *   In operation - Thread stop request matrix processing
 */
void DevGpsNormalStopReq(void) {
  /* Thread stop processing */
  StopThreadGpsCommon();

  return;
}

/**
 * @brief
 *   In operation - GPS week adjustment counter notification process
 */
void DevGpsNormalGpsweekcorcntNtf(void) {
  DevGpsSetGpsweekcorcnt();
  return;
}

/**
 * @brief
 *   In operation - GPS recovery timeout processing
 */
void DevGpsNormalRecoveryTimeOut(void) {
}

/**
 * @brief
 *   In operation - GPS receiver anomaly detection timeout processing
 */
void DevGpsNormalGpsReceiverErrTimeOut(void) {
  BOOL* pb_rcverr = &(g_gps_mngr.rcv_err_flag); /* GSP receiver error detection status */

  *pb_rcverr = TRUE;
  DevSendGpsConnectError(TRUE);
  return;
}

/* ++ #GPF_60_040 */
/******************************************************************************
@brief      DEV_Gps_Send_SendReq<BR>
            Sending - Transmit request reception matrix function
@outline    Processing for receiving a transmission request during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendSendReq(void) {
  SendReqGpsCommon();
  return;
}

/******************************************************************************
@brief      DEV_Gps_Send_GPSResetReq<BR>
            Sending - GPS reset request reception matrix function
@outline    Processing when receiving a GPS reset request during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendGPSResetReq(void) {
  GPSResetReqGpsCommon();
  return;
}

/******************************************************************************
@brief      DEV_Gps_Send_RcvCyclCmd<BR>
            Sending - Cyclic receive command receive matrix function
@outline    Processing at the reception of cyclic reception command during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendRcvCyclCmd(void) {
    /* Cyclic reception data monitoring timer stopped */
    DevGpsTimeStop(GPS_CYCL_TIMER);

    /* GPS receiver anomaly detection timer stopped */
    DevGpsTimeStop(GPS_RECEIVERERR_TIMER);

    /* Notify Vehicle Sensor */
    if (g_gps_reset_cmd_sending == FALSE) {
        DevGpsRcvCyclCmd();
    }

    /* Reset retry counter */
    RtyResetGpsCommon();

    /* Cyclic reception data monitoring timer setting */
    (void)DevGpsTimeSet(GPS_CYCL_TIMER);

    (void)DevGpsTimeSet(GPS_RECEIVERERR_TIMER);

    return;
}

/******************************************************************************
@brief      DEV_Gps_Send_RcvRspCmd<BR>
            Sending - Response command reception matrix function
@outline    Processing when receiving a response command during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendRcvRspCmd(void) {
    TG_GPS_OUTPUT_FORMAT  rcv_cmd = g_gps_mngr.rcv_cmd;
    BOOL b_snd_flag = TRUE;

    /** Check whether the command matches the command being monitored. */
    if (rcv_cmd == g_gps_mngr.resp_cmd) {
        /** When the command being monitored is a cold start request */
        if (g_gps_mngr.resp_rst_flag == GPS_CMD_RESET) {
            POSITIONING_LOG("GPS_CMD_RESET\n");
            b_snd_flag = DevGpsRcvProcGpsResetResp(reinterpret_cast<TG_GPS_RCV_DATA*>
                                                    (reinterpret_cast<void*>(g_gps_msg_rcvr.msgdat)));
        } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_TIMESET) {
            POSITIONING_LOG("GPS_CMD_TIMESET\n");
            DevGpsRcvProcTimeSetResp(reinterpret_cast<TG_GPS_RCV_DATA*>
                                                    (reinterpret_cast<void*>(g_gps_msg_rcvr.msgdat)));
        } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_SENTENCEADD_NAVTIMEUTC) {
          POSITIONING_LOG("GPS_CMD_SENTENCEADD_NAVTIMEUTC\n");
          DevGpsRcvProcNavSvinfoAddResp(reinterpret_cast<TG_GPS_RCV_DATA*>
                                                    (reinterpret_cast<void*>(g_gps_msg_rcvr.msgdat)));
        } else if ( g_gps_mngr.resp_rst_flag == GPS_CMD_WKNROLLOVER ) {
          POSITIONING_LOG("GPS_CMD_WKNROLLOVER\n");
          DevGpsRcvProcWknRolloverGetResp(reinterpret_cast<TG_GPS_RCV_DATA*>
                                                    (reinterpret_cast<void*>(g_gps_msg_rcvr.msgdat)));
        } else {
          POSITIONING_LOG("g_gps_mngr.resp_rst_flag INVALID!! [resp_rst_flag = %d]", g_gps_mngr.resp_rst_flag);
        }

        if (b_snd_flag == TRUE) {
          /** Stop ACK monitoring timer */
          DevGpsTimeStop(GPS_RECV_ACK_TIMER);
          /* State transition processing(in operation)  */
          ChangeStatusGpsCommon(GPS_STS_NORMAL);
          /** Reset retry counter */
          SendRtyResetGpsCommon();
          /** Delete command from pending buffer */
          DeleteSaveCmdGpsCommon();
          /* Sending pending commands */
          SendSaveCmdGpsCommon();
        }
    } else {
    }

    return;
}

/******************************************************************************
@brief      DEV_Gps_Send_RspDataTimeOut<BR>
            Sending - Response monitoring timeout reception matrix function
@outline    Processing at reception of response monitoring timeout during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendRspDataTimeOut(void) {
    DevGpsTimeStop(GPS_RECV_ACK_TIMER);
    /** Send retry count */
    g_gps_mngr.sndcnt++;

    /** Retry judgment */
    if (g_gps_mngr.sndcnt == SNDNG_MAX) {
        /** At the time of retry */
        POSITIONING_LOG("GPS Hw Reset : sndcnt[%d]", g_gps_mngr.sndcnt);

        /** When the command being monitored is a cold start request */
        if (g_gps_mngr.resp_rst_flag == GPS_CMD_RESET) {
          POSITIONING_LOG("g_gps_mngr.sndcnt == SNDNG_MAX (GPS_CMD_RESET)");
          /** Send Reset ResponseCommunication error */
          DevGpsRstAnsSend(g_gps_mngr.resp_pno, g_gps_mngr.resp_rid, GPS_SENDNG);
          g_gps_reset_cmd_sending = FALSE;

        } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_TIMESET) {
            POSITIONING_LOG("g_gps_mngr.sndcnt == SNDNG_MAX (GPS_CMD_TIMESET)");
            DevGpsTimesetAnsSend(g_gps_mngr.resp_pno, g_gps_mngr.resp_rid, GPS_SENDNG);
        } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_SENTENCEADD_NAVTIMEUTC) {
            POSITIONING_LOG("g_gps_mngr.sndcnt == SNDNG_MAX (GPS_CMD_SENTENCEADD_NAVTIMEUTC)");
            DevGpsNavTimeUTCAddReq(); /* Retransmission of requests to add NAV-SVINFO commands */
        } else if (g_gps_mngr.resp_rst_flag == GPS_CMD_WKNROLLOVER) {  /* GPS rollover reference date acquisition response */
            POSITIONING_LOG("g_gps_mngr.sndcnt == SNDNG_MAX (GPS_CMD_WKNROLLOVER)");
            DevGpsWknRolloverGetReq(); /* GPS rollover standard week number acquisition request retransmission */
        } else {
            POSITIONING_LOG("g_gps_mngr.resp_rst_flag INVALID!! [resp_rst_flag = %d]", g_gps_mngr.resp_rst_flag);
        }

        DeleteSaveCmdGpsCommon();

        ChangeStatusGpsCommon(GPS_STS_NORMAL);

        SendSaveCmdGpsCommon();
        /** Reset retry counter */
        SendRtyResetGpsCommon();
    } else {
        POSITIONING_LOG("GPS Send Retry : sndcnt[%d]", g_gps_mngr.sndcnt);
        /** Retransmission of pending command */
        SendSaveCmdGpsCommon();
    }

    return;
}

/******************************************************************************
@brief      DEV_Gps_Send_CyclDataTimeOut<BR>
            Sending - Reception cycle data monitoring timeout matrix function
@outline    Processing when receiving periodic reception data monitoring timeout during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendCyclDataTimeOut(void) {
  CyclDataTimeOutGpsCommon();
}

/******************************************************************************
@brief      DEV_Gps_Send_NaviDataTimeOut<BR>
            Sending - Navigation providing data monitoring timeout matrix function
@outline    Navigation providing data monitoring timeout matrix processing during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendNaviDataTimeOut(void) {
}

/******************************************************************************
@brief      DEV_Gps_Send_DiagClkGuardTimeOut<BR>
            Sending - Time guard monitoring timeout matrix functions provided by diagnosis
@outline    Diagnosis providing time guard monitoring timeout matrix process during sending
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendDiagClkGuardTimeOut(void) {
}

/******************************************************************************
@brief      DEV_Gps_Send_AccOffStart<BR>
            Sending - Feature ACC-OFF instruction reception matrix functions
@outline    Processing when receiving ACC-OFF instruction in function being transmitted
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendAccOffStart(void) {
}

/******************************************************************************
@brief      DEV_Gps_Send_NaviInfoDeliver<BR>
            Sending - Navigation information provision matrix processing
@outline    Navigation information provision matrix processing during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendNaviInfoDeliver(void) {
}

/******************************************************************************
@brief      DEV_Gps_Send_NaviSpeedDeliver<BR>
            Sending - Navigation vehicle speed information provision matrix processing
@outline    Navigation vehicle speed information provision matrix processing during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendNaviSpeedDeliver(void) {
}

/******************************************************************************
@brief      DEV_Gps_Send_SettingTime<BR>
            Sending - GPS time setting matrix processing
@outline    GPS time setting matrix processing during transmission
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendSettingTime(void) {
  DevGpsCommSettingTime();
  return;
}

/* start #GPF_60_109 */
/******************************************************************************
@brief      DEV_Gps_Send_NmeaDataGuardTimeOut<BR>
            Sending - NMEA monitoring timeout matrix processing
@outline    Sending NMEA monitoring timeouts
@param[in]  none
@param[out] none
@return     none
@retval     none
*******************************************************************************/
void DevGpsSendNmeaDataGuardTimeOut(void) {
}

/**
 * @brief
 *   Sending - Backup memory read request matrix processing
 */
void DevGpsSendBackupDataLoadReq(void) {
  POS_DATETIME st_date_time;

  memset(&st_date_time, 0x00, sizeof(st_date_time));
  /* Import GPS date and time settings */
  DevGpsReadGpsTime(&st_date_time);
  // Todo For test don't need gstGpsFixCnt??
  // DEV_Gps_ReadGpsFixCnt();     /* Read GPS fix count */
  if (g_is_gpstime_sts == TRUE) {
       DevGpsSettingTime(&st_date_time); /* Time setting  */
  }

  return;
}

/**
 * @brief
 *   Sending - Thread stop request matrix processing
 */
void DevGpsSendStopReq(void) {
  /* Thread stop processing */
  StopThreadGpsCommon();
  return;
}

/**
 * @brief
 *   Sending - GPS week adjustment counter notification process
 */
void DevGpsSendGpsweekcorcntNtf(void) {
  DevGpsSetGpsweekcorcnt();
  return;
}

/**
 * @brief
 *   Sending - GPS recovery timeout processing
 */
void DevGpsSendRecoveryTimeOut(void) {
  return;
}

/**
 * @brief
 *   Sending - GPS receiver anomaly detection timeout processing
 */
void DevGpsSendGpsReceiverErrTimeOut(void) {
  BOOL* pb_rcverr = &(g_gps_mngr.rcv_err_flag); /* GSP receiver error detection status */

  *pb_rcverr = TRUE;
  DevSendGpsConnectError(TRUE);
  return;
}

/*---------------------------------------------------------------------------*/
/*EOF*/