Init basesystem source codes.
[staging/basesystem.git] / vehicleservice / positioning / server / include / Sensor / VehicleSens_FromAccess.h
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 #ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_FROMACCESS_H_
18 #define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_FROMACCESS_H_
19 /******************************************************************************
20  * File name        :VehicleSens_FromAccess.h
21  * System name        :PastModel002
22  * Subsystem name    :
23  ******************************************************************************/
24
25 #include <stdio.h>
26 #include <stdint.h>
27 #include "Sensor_API.h"
28 #include "SensorLocation_API.h"
29
30 /************************************************************************
31 *            Macro definitions                                                    *
32 ************************************************************************/
33 #define NV_FILE_VEHICLESENS                "/fs/tmpfs/VehicleSens_nv_data.bin"
34 #define NV_FILE_VEHICLESENS_TEMP        "/fs/tmpfs/VehicleSens_nv_data_temp.bin"
35 #define NV_FILE_VEHICLESENS2            "/fs/tmpfs/VehicleSens_nv_data_2nd.bin"
36 #define NV_FILE_VEHICLESENS2_TEMP        "/fs/tmpfs/VehicleSens_nv_data_2nd_temp.bin"
37 #define NV_LOAD_WAIT_TIME_VEHICLESENS    100U
38 #define NV_UPDATE_CYCLE_LONLAT            100U
39 #define NV_UPDATE_CYCLE_LOCALTIME        10U
40
41 /************************************************************************
42 *            Typedef definitions                                                 *
43 ************************************************************************/
44
45 /************************************************************************
46 *            Struct definitions                                                  *
47 ************************************************************************/
48 typedef struct {
49     LOCALTIME    localtime;
50     LONLAT        lonlat;
51     int32        timediff;
52     u_int32        update_counter;
53     u_int8        reserve[2];
54     u_int8        cka;
55     u_int8        ckb;
56 } NV_DATA_VEHICLESENS;
57
58 /************************************************************************
59 *            Function prototype                                              *
60 ************************************************************************/
61 void VehicleSensFromAccessInitialize(void);
62 RET_API VehicleSensRegistNvTag(void);
63 RET_API VehicleSensReadNVLocalTime(LOCALTIME * local_time);
64 RET_API VehicleSensReadNVLonLat(LONLAT * lonlat);
65 RET_API VehicleSensReadNVTimeDiff(int32 * time_diff);
66 void VehicleSensStoreLonlat(LONLAT * plonlat);
67 RET_API VehicleSensWriteNVLocaltime(LOCALTIME * local_time, int32 * time_diff);
68
69 #endif  // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_FROMACCESS_H_