removed wrong contact points & added two authors
[platform/core/location/lbs-server.git] / lbs-server / include / gps_plugin_data_types.h
1 /*
2  * lbs-server
3  *
4  * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef _GPS_PLUGIN_DATA_TYPES_H_
20 #define _GPS_PLUGIN_DATA_TYPES_H_
21
22 #include <stdint.h>
23 #include <time.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29
30 /** Maximum number of satellite which is in used */
31 #define MAX_GPS_NUM_SAT_USED            (12)
32
33 /** Maximum number of satellite which is in view */
34 #define MAX_GPS_NUM_SAT_IN_VIEW         (32)
35
36 /**
37  * This enumeration has error type.
38  */
39 typedef enum {
40         GPS_ERR_NONE                    = 0,            /**< Error None */
41         GPS_ERR_TIMEOUT                 = -100,         /**< pos_cb error GPS Timeout */
42         GPS_ERR_OUT_OF_SERVICE  = -101,         /**< pos_cb error GPS out of service */
43         GPS_ERR_COMMUNICATION   = -200,         /**< Plugin event callback error */
44 } gps_error_t;
45
46 /**
47  * This enumeration has geofence service status.
48  */
49 typedef enum {
50         GEOFENCE_STATUS_UNAVAILABLE     = 0,
51         GEOFENCE_STATUS_AVAILABLE       = 1,
52 } geofence_status_t;
53
54 /**
55  * This enumeration has geofence service error type.
56  */
57 typedef enum {
58         GEOFENCE_ERR_NONE                               = 0,
59         GEOFENCE_ERR_TOO_MANY_GEOFENCE  = -100,
60         GEOFENCE_ERR_ID_EXISTS                  = -101,
61         GEOFENCE_ERR_ID_UNKNOWN                 = -200,
62         GEOFENCE_ERR_INVALID_TRANSITION = -300,
63         GEOFENCE_ERR_UNKNOWN                    = -400,
64 } geofence_error_t;
65
66 /**
67  * This enumeration has XTRA request error type (wearable profile use only).
68  */
69 typedef enum {
70         XTRA_REQUEST_ERR_NONE   = 0,
71         XTRA_REQUEST_ERR_UNKNOWN  = -100,
72 } xtra_request_error_t;
73
74 /**
75  * This structure defines the GPS position data.
76  */
77 typedef struct {
78         time_t  timestamp;              /**< Timestamp */
79         double  latitude;               /**< Latitude data (in degree) */
80         double  longitude;              /**< Longitude data (in degree) */
81         double  altitude;               /**< Altitude data (in meter) */
82         double  speed;                  /**< Speed (in m/s) */
83         double  bearing;                /**< Direction from true north(in degree) */
84         double  hor_accuracy;   /**< Horizontal position error(in meter) */
85         double  ver_accuracy;   /**< Vertical position error(in meter) */
86 } pos_data_t;
87
88 /**
89  * This structure defines the GPS batch data.
90  */
91 typedef struct {
92         int     num_of_location;        /**< Number of batch data */
93 } batch_data_t;
94
95 /**
96  * This structure defines the satellite data.
97  */
98 typedef struct {
99         int prn;                        /**< Pseudo Random Noise code of satellite */
100         int snr;                        /**< Signal to Noise Ratio */
101         int elevation;          /**< Elevation */
102         int azimuth;            /**< Degrees from true north */
103         int used;                       /**< Satellite was used for position fix */
104 } sv_info_t;
105
106 /**
107  * This structure defines the GPS satellite in view data.
108  */
109 typedef struct {
110         time_t timestamp;                                               /**< Timestamp */
111         unsigned char pos_valid;                                /**< TRUE, if position is valid */
112         int num_of_sat;                                                 /**< Number of satellites in view */
113         sv_info_t sat[MAX_GPS_NUM_SAT_IN_VIEW]; /**< Satellite information */
114 } sv_data_t;
115
116 /**
117  * This structure defines the NMEA data.
118  */
119 typedef struct {
120         time_t timestamp;       /**< Timestamp */
121         int     len;                    /**< NMEA data length */
122         char *data;                     /**< Raw NMEA data */
123 } nmea_data_t;
124
125 /**
126  * This structure defines the geofence data.
127  */
128 typedef struct {
129         int     geofence_id;    /**< Geofence ID */
130         double latitude;        /**< Latitude data (in degree) */
131         double longitude;       /**< Longitude data (in degree) */
132         int     radius;                 /**< Radius data (in meters) */
133 } geofence_data_t;
134
135 typedef struct {
136         char imsi[16];  /**< IMSI */
137         int mcc;                /**< MCC */
138         int mnc;                /**< MNC */
139         int lac;                /**< Location area code */
140         int psc;                /**< Primary Srambling code */
141         int cid;                /**< Cell id */
142 } mobile_info_t;
143
144 #ifdef __cplusplus
145 }
146 #endif
147 #endif /* _GPS_PLUGIN_DATA_TYPES_H_ */