2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DELIVERYCTRL_H_
18 #define POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DELIVERYCTRL_H_
19 /******************************************************************************
20 * File name :DeadReckoning_DeliveryCtrl.h
21 * System name :PastModel002
23 ******************************************************************************/
25 #include "DeadReckoning_DataMaster.h"
26 #include "Dead_Reckoning_Local_Api.h"
28 /************************************************************************
30 ************************************************************************/
31 #define DEADRECKONING_SIGNAL 6 /* Number of vehicle signals */
32 #define DEADRECKONING_DELIVERY 10 /* Number of delivery destinations */
33 /* Vehicle sensor information */
34 #define DEADRECKONING_DELIVERY_INFO (DEADRECKONING_SIGNAL)
35 /* Maximum number of vehicle sensor information */
36 #define DEADRECKONING_DELIVERY_INFO_MAX (DEADRECKONING_DELIVERY_INFO * DEADRECKONING_DELIVERY)
37 /* Vehicle Sensor Information Valid Number */
38 #define DEADRECKONING_DID_EFFECTIVE (DEADRECKONING_SIGNAL)
39 #define DEADRECKONING_ACTION_TYPE_ADD 0 /* Vehicle sensor addition processing */
40 #define DEADRECKONING_ACTION_TYPE_UPDATE 1 /* Vehicle sensor update processing */
42 #define DEADRECKONING_LINK_INDEX_END 0xFFFF /* End of the link index */
44 #define DEADRECKONING_DELIVERY_METHOD_NORMAL 0 /* Delivery system normal delivery */
46 /************************************************************************
47 * Struct definitions *
48 ************************************************************************/
50 /*********************************************************************
51 * TAG :DEADRECKONING_DELIVERY_CTRL_TBL_DATA
52 * ABSTRACT : Structure of each data of the vehicle sensor delivery destination management table
53 ***********************************************************************/
55 DID ul_did; /* Data ID */
56 PNO us_pno; /* Shipping PID */
57 u_int8 uc_chg_type; /* Delivery timing */
58 u_int8 uc_ctrl_flg; /* Delivery operation */
59 u_int16 us_link_idx; /* Link index */
60 u_int8 uc_method; /* Delivery system */
61 u_int8 uc_reserve; /* reserve */
62 } DEADRECKONING_DELIVERY_CTRL_TBL_DATA;
64 /*********************************************************************
65 * TAG : DEADRECKONING_DELIVERY_CTRL_TBL
66 * ABSTRACT : Vehicle Sensor Delivery Destination Management Table Structure
67 ***********************************************************************/
69 u_int16 us_num; /* Number of delivery destination management data items */
70 u_int8 uc_reserve[2]; /* Reserved */
71 /* Array of each data */
72 DEADRECKONING_DELIVERY_CTRL_TBL_DATA st_ctrl_data[DEADRECKONING_DELIVERY_INFO_MAX];
73 } DEADRECKONING_DELIVERY_CTRL_TBL;
75 /*********************************************************************
76 * TAG : DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA
77 * ABSTRACT : Structure of each data of Vehicle Sensor Destination Management Table Management
78 ***********************************************************************/
80 DID ul_did; /* Data ID */
81 u_int16 us_start_idx; /* Start index */
82 u_int16 us_end_idx; /* End index */
83 u_int16 us_dlvry_entry_num; /* Number of registered shipping addresses */
84 u_int8 uc_reserve[2]; /* Reserved */
85 } DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA;
87 /*********************************************************************
88 * TAG : DEADRECKONING_DELIVERY_CTRL_TBL_MNG
89 * ABSTRACT : Structure of Vehicle Sensor Delivery Destination Management Table Management
90 ***********************************************************************/
92 u_int16 us_num; /* Number of data items */
93 u_int8 uc_reserve[2]; /* Reserved */
94 /* Array of each data */
95 DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA st_ctrl_tbl_mng_data[DEADRECKONING_DELIVERY_INFO];
96 } DEADRECKONING_DELIVERY_CTRL_TBL_MNG;
98 /*********************************************************************
99 * TAG : DEADRECKONING_DELIVERY_PNO_TBL
100 * ABSTRACT : Vehicle Sensor Destination PNO Table
101 ***********************************************************************/
103 PNO us_pno; /* Thread ID */
104 u_int16 us_index; /* Appropriate INDEX in the delivery control table */
105 u_int8 uc_method; /* Delivery system */
106 u_int8 uc_reserve[3]; /* reserve */
107 } DEADRECKONING_DELIVERY_PNO_TBL_DAT;
110 u_int16 us_num; /* Number of data items */
111 u_int8 uc_reserve[2]; /* reserve */
112 DEADRECKONING_DELIVERY_PNO_TBL_DAT st_pno_data[DEADRECKONING_DELIVERY_INFO_MAX];
113 } DEADRECKONING_DELIVERY_PNO_TBL;
115 /************************************************************************
116 * Function prototype *
117 ************************************************************************/
119 DEADRECKONING_DELIVERY_PNO_TBL* DeadReckoningMakeDeliveryPnoTbl(DID ul_did, u_int8 change_type);
121 DEAD_RECKONING_RET_API DeadReckoningEntryDeliveryCtrl(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
123 void DeadReckoningInitDeliveryCtrlTbl(void);
124 void DeadReckoningInitDeliveryCtrlTblMng(void);
126 void DeadReckoningAddDeliveryCtrlTbl(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
127 void DeadReckoningUpdateDeliveryCtrlTbl(DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *);
128 void DeadReckoningAddDeliveryCtrlTblMng(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
129 void DeadReckoningUpdateDeliveryCtrlTblMng(DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *);
131 void DeadReckoningAddPnoTbl(u_int16);
132 void DeadReckoningDeliveryProc(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method);
133 void DeadReckoningFirstDelivery(PNO us_pno, DID ul_did);
135 RET_API DRManagerSndMsg(PNO us_pno_src, PNO us_pno_dest, CID us_cid, u_int16 us_msg_len, const void *p_msg_data);
137 #endif // POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DELIVERYCTRL_H_