summaryrefslogtreecommitdiffstats
path: root/positioning/client/include/POS_sensor_private.h
blob: a324eae7d2b399f8b60d24ac1ba26d58760e8312 (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
/*
 * @copyright Copyright (c) 2016-2019 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.
 */

#ifndef POSITIONING_CLIENT_INCLUDE_POS_SENSOR_PRIVATE_H_
#define POSITIONING_CLIENT_INCLUDE_POS_SENSOR_PRIVATE_H_
/******************************************************************************
 * file name    :POS_sensor_private.h
 * system name    :Positioning
 * sub system name  :Positioning internal interface library
 ******************************************************************************/

#include <vehicle_service/POS_sensor_API.h>
#include <vehicle_service/pos_message_header.h>
#include <native_service/frameworkunified_types.h>
/************************************************************************
*                                  definition                           *
************************************************************************/
/*----------------------------------------------------------------------*
 *  for message                              *
 *----------------------------------------------------------------------*/
/* command ID */
#define CID_SENSOR_PKG_INFO           0x0700                        /* vehicle sensor package notification ID */

/*----------------------------------------------------------------------*
 *                     definition for GPS response                      *
 *----------------------------------------------------------------------*/
#define GPS_BUFFERFUL                 2                             /* transmit buffer full(rejection)    */
#define GPS_INITIAL                   3                             /* initialization state(rejection)    */
#define GPS_CONNECTNG                 4                             /* connection error(rejection)      */

/*----------------------------------------------------------------------*
 *                       definition clock status                        *
 *----------------------------------------------------------------------*/
#define CLOCK_VALID                   (1U)
#define CLOCK_INVALID                 (0U)

/*----------------------------------------------------------------------*
 *    Message Related Extensions                                                     *
 *----------------------------------------------------------------------*/
#define CID_SENSORIF_SET_GPSTIME      0x0701                        /* GPS time information setting CID */

/*----------------------------------------------------------------------*
 * GPS version-related definitions                                                 *
 *----------------------------------------------------------------------*/
#define GPS__CWORD82__VERSION_LEN           (7U)                          /* _CWORD82_ version data length */

/************************************************************************
*                               struct declaration                      *
************************************************************************/
/************************************************************************
* TAG       : SENSOR_MSG_DELIVERY_ENTRY
* ABSTRACT  : vehicle sensor delivery message (to vehicle sensor)
************************************************************************/
typedef struct {
    PNO                               pno;                          /* destination process number */
    u_int8                            pkg_num;                      /* number of package data (1 - 16) */
    u_int8                            delivery_timing;              /* delivery timing          */
    u_int8                            ctrl_flg;                     /* delivery control flag      */
    u_int8                            reserve[3];
    EventID                           event_id;                     /* event ID              */
    DID                               did[SENSOR_PKG_DELIVERY_MAX];    /* data ID array          */
} SENSOR_MSG_DELIVERY_ENTRY_DAT;

typedef struct {
    T_APIMSG_MSGBUF_HEADER            hdr;                          /* message header  */
    SENSOR_MSG_DELIVERY_ENTRY_DAT     data;                         /* message body    */
} SENSOR_MSG_DELIVERY_ENTRY;

/************************************************************************
* TAG       : SENSOR_MSG_GET_SENSOR_DATA
* ABSTRACT  : vehicle sensor getter message (to vehicle sensor)
************************************************************************/
typedef struct {
    PNO                               pno;                          /* destination process number    */
    u_int8                            pkg_num;                      /* number of package data (1 - 16)  */
    u_int8                            reserve;
    u_int16                           offset;                       /* share memory offset        */
    u_int16                           size;                         /* share memory allocation size    */
    EventID                           event_id;                     /* event ID              */
    DID                               did[SENSOR_PKG_DELIVERY_MAX];    /* data ID about vehicle sensor    */
} SENSOR_MSG_GET_SENSOR_DATA_DAT;

typedef struct {
    T_APIMSG_MSGBUF_HEADER            hdr;                          /* message header  */
    SENSOR_MSG_GET_SENSOR_DATA_DAT    data;                         /* message body    */
} SENSOR_MSG_GET_SENSOR_DATA;

/************************************************************************
* TAG       : SENSOR_INTERNAL_MSG_BUF
* ABSTRACT  : message buffer
************************************************************************/
typedef struct {
    T_APIMSG_MSGBUF_HEADER            hdr;                          /* message header  */
    u_int8                            data[SENSOR_MSGBUF_DSIZE];    /* message body    */
} SENSOR_INTERNAL_MSG_BUF;

/********************************************************************************
 * TAG      TG_GPS_RET_TIMESET_MSG
 * ABSTRACT :GPS Time Setting Response Message Structure
 ********************************************************************************/
typedef struct {
    T_APIMSG_MSGBUF_HEADER            header;                       /* Message header */
    uint64_t                          status;                       /* Response status */
} TG_GPS_RET_TIMESET_MSG;

/********************************************************************************
 * TAG      :TG_GPSTIME
 * ABSTRACT :GPS Absolute Time Structure
 * NOTE     :
 ********************************************************************************/
typedef struct {
    u_int16                           year;                         /* Year information(4-digit year)    */
    u_int8                            month;                        /* Month information          */
    u_int8                            day;                          /* Day information          */
    u_int8                            hour;                         /* Hour information          */
    u_int8                            minute;                       /* Minute information          */
    u_int8                            second;                       /* Second information          */
    u_int8                            reserve;                      /* reserve          */
} TG_GPSTIME;

/********************************************************************************
 * TAG      :TG_GPS_RTCBKUP_DATA
 * ABSTRACT :RTC backup-related data structures
 * NOTE     :RTC-backup-related data stored in the SRAM alternate DRAM
 ********************************************************************************/
typedef struct {
    u_int8                            time_status;                  /* Time Status */
    u_int8                            reserve1[3];                  /* Reserve 1 */
    TG_GPSTIME                        gps_time;                     /* GPS Absolute Time */
} TG_GPS_RTCBKUP_DATA;                      /*                                  */

/************************************************************************
 * TAG      : GPS_INTERRUPT
 * ABSTRACT : GPS interrupt status
 * NOTE     :
************************************************************************/
typedef struct {
    u_int8                            _CWORD102__interrupt;                 /* from GPS to _CWORD102_   interrupt status  */
    u_int8                            _CWORD56__interrupt;               /* from GPS to _CWORD56_ interrupt status  */
} GPS_INTERRUPT;

/********************************************************************************
 * TAG      :LOCALTIME
 * ABSTRACT :LocalTime data structure
 * NOTE     :
 ********************************************************************************/
typedef struct {
    u_int8                            status;                       /* status  : valid or invalid */
    u_int8                            reserve[3];    /* reserve                  */
    u_int16                           year;      /* year    : 2000..2099  (FFFFh:invalid)  */
    u_int8                            month;      /* month  : 1..12      (FFh:invalid)  */
    u_int8                            day;      /* date    : 1..31      (FFh:invalid)  */
    u_int8                            hour;      /* hour    : 0..23      (FFh:invalid)  */
    u_int8                            min;      /* minute  : 0..59      (FFh:invalid)  */
    u_int8                            sec;      /* second  : 0..59      (FFh:invalid)  */
    u_int8                            reserve2;    /* reserve                  */
} LOCALTIME;

#endif  // POSITIONING_CLIENT_INCLUDE_POS_SENSOR_PRIVATE_H_