gps_plugin_handler_t gps_plugin;
- pos_data_t *pos_data;
- batch_data_t *batch_data;
- sv_data_t *sv_data;
- nmea_data_t *nmea_data;
+ hal_location_pos_data_s *pos_data;
+ hal_location_batch_data_s *batch_data;
+ hal_location_sv_data_s *sv_data;
+ hal_location_nmea_data_s *nmea_data;
} gps_server_t;
gps_server_t *g_gps_server = NULL;
g_nps_plugin.handle = NULL;
}
-static int _gps_server_gps_event_cb(gps_event_info_t *gps_event_info, void *user_data);
+static int _gps_server_gps_event_cb(gps_event_info_s *gps_event_info, void *user_data);
static void _gps_nmea_changed_cb(keynode_t *key, void *data)
{
static void reload_plugin_module(gps_server_t *server)
{
- gps_failure_reason_t ReasonCode = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e ReasonCode = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
LOG_GPS(DBG_LOW, "reload_plugin_module : replay enabled: %d", server->replay_enabled);
int ret = hal_location_get_backend();
static void display_mode_changed_cb(keynode_t *key, void *data)
{
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
int lcd_mode = 0;
setting_get_int(VCONFKEY_PM_STATE, &lcd_mode);
- gboolean status = hal_location_request(GPS_ACTION_SEND_PARAMS, &lcd_mode, &reason_code);
+ gboolean status = hal_location_request(HAL_LOCATION_GPS_ACTION_SEND_PARAMS, &lcd_mode, &reason_code);
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_FACTTEST Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_ACTION_START_FACTTEST Fail !");
return;
}
- status = hal_location_request(GPS_INDI_SUPL_VERIFICATION, NULL, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_INDI_SUPL_VERIFICATION, NULL, &reason_code);
if (status == FALSE)
{
- LOG_GPS(DBG_ERR, "Main: sending GPS_INDI_SUPL_VERIFICATION Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_INDI_SUPL_VERIFICATION Fail !");
return;
}
}
static void replay_mode_changed_cb(keynode_t *key, void *data)
{
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
int replay_mode = 0;
setting_get_int(VCONFKEY_LOCATION_REPLAY_MODE, &replay_mode);
- gboolean status = hal_location_request(GPS_ACTION_START_FACTTEST, &replay_mode, &reason_code);
+ gboolean status = hal_location_request(HAL_LOCATION_GPS_ACTION_START_FACTTEST, &replay_mode, &reason_code);
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_FACTTEST Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_ACTION_START_FACTTEST Fail !");
return;
}
- status = hal_location_request(GPS_ACTION_STOP_FACTTEST, NULL, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_STOP_FACTTEST, NULL, &reason_code);
if (status == FALSE)
{
- LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_STOP_FACTTEST Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_ACTION_STOP_FACTTEST Fail !");
return;
}
}
int request_change_pos_update_interval_standalone_gps(unsigned int interval)
{
- LOG_GPS(DBG_INFO, "-->> request to plugin GPS_ACTION_CHANGE_INTERVAL [%u]", interval);
+ LOG_GPS(DBG_INFO, "-->> request to plugin HAL_LOCATION_GPS_ACTION_CHANGE_INTERVAL [%u]", interval);
gboolean status = TRUE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
gps_server_t *server = g_gps_server;
if (server->session_state == GPS_SESSION_STARTING || server->session_state == GPS_SESSION_STARTED) {
- gps_action_change_interval_data_t gps_change_interval_data;
+ hal_location_gps_action_change_interval_data_s gps_change_interval_data;
gps_change_interval_data.interval = (int)interval;
int ret = hal_location_get_backend();
if( ret < 0){
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return FALSE;
}
- status = hal_location_request(GPS_ACTION_CHANGE_INTERVAL, &gps_change_interval_data, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_CHANGE_INTERVAL, &gps_change_interval_data, &reason_code);
LOG_GPS(DBG_INFO, "requested go GPS module done. gps_change_interval_data.interval [%d]", gps_change_interval_data.interval);
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_CHANGE_INTERVAL Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_ACTION_CHANGE_INTERVAL Fail !");
return FALSE;
}
- LOG_GPS(DBG_INFO, "Main: sending GPS_ACTION_CHANGE_INTERVAL OK !");
+ LOG_GPS(DBG_INFO, "Main: sending HAL_LOCATION_GPS_ACTION_CHANGE_INTERVAL OK !");
return TRUE;
}
return FALSE;
LOG_GPS(DBG_INFO, "GPS start with interval [%d]", interval);
gboolean status = TRUE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
gps_server_t *server = g_gps_server;
- gps_action_start_data_t gps_start_data;
+ hal_location_gps_action_start_data_s gps_start_data;
if (server->session_state != GPS_SESSION_STOPPED && server->session_state != GPS_SESSION_STOPPING) {
LOG_GPS(DBG_WARN, "Main: GPS Session Already Started!");
return FALSE;
}
- status = hal_location_request(GPS_INDI_SUPL_DNSQUERY, &str, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_INDI_SUPL_DNSQUERY, &str, &reason_code);
if(str)
{
}
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Main: sending GPS_INDI_SUPL_DNSQUERY Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_INDI_SUPL_DNSQUERY Fail !");
return FALSE;
}
int replay_mode = 0;
setting_get_int(VCONFKEY_LOCATION_REPLAY_MODE, &replay_mode);
- status = hal_location_request(GPS_ACTION_START_FACTTEST, &replay_mode, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_START_FACTTEST, &replay_mode, &reason_code);
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_FACTTEST Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_ACTION_START_FACTTEST Fail !");
return FALSE;
}
int lcd_mode = 0;
setting_get_int(VCONFKEY_PM_STATE, &lcd_mode);
- status = hal_location_request(GPS_ACTION_SEND_PARAMS, &lcd_mode, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_SEND_PARAMS, &lcd_mode, &reason_code);
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_FACTTEST Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_ACTION_START_FACTTEST Fail !");
return FALSE;
}
display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
LOG_GPS(LOG_DEBUG, "display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);");
- status = hal_location_request(GPS_ACTION_START_SESSION, &gps_start_data, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_START_SESSION, &gps_start_data, &reason_code);
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_SESSION Fail !");
+ LOG_GPS(DBG_ERR, "Main: sending HAL_LOCATION_GPS_ACTION_START_SESSION Fail !");
return FALSE;
}
- LOG_GPS(DBG_INFO, "Main: sending GPS_ACTION_START_SESSION OK !");
+ LOG_GPS(DBG_INFO, "Main: sending HAL_LOCATION_GPS_ACTION_START_SESSION OK !");
setting_ignore_key_changed(VCONFKEY_LOCATION_REPLAY_ENABLED, _gps_replay_changed_cb);
{
gboolean status = TRUE;
gboolean is_replay_enabled = FALSE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
gps_server_t *server = g_gps_server;
LOG_GPS(DBG_LOW, "Main: Stop GPS Session, ==GPSSessionState[%d]", server->session_state);
display_unlock_state(LCD_OFF, PM_RESET_TIMER);
LOG_GPS(DBG_LOW, "display_unlock_state(LCD_OFF, PM_RESET_TIMER);");
- status = hal_location_request(GPS_ACTION_STOP_SESSION, NULL, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_STOP_SESSION, NULL, &reason_code);
if (status) {
server->session_state = GPS_SESSION_STOPPING;
LOG_GPS(DBG_INFO, "Batch: GPS start with interval[%d]", batch_interval);
gboolean status = TRUE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
gps_server_t *server = g_gps_server;
- gps_action_start_data_t gps_start_data;
+ hal_location_gps_action_start_data_s gps_start_data;
if (server->session_state == GPS_SESSION_STARTING || server->session_state == GPS_SESSION_STARTED)
gps_start_data.session_status = 1; /* 1:Already running, 0:need to start*/
status = hal_location_request(GPS_ACTION_START_BATCH, &gps_start_data, &reason_code);
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Batch: sending GPS_ACTION_START_SESSION Fail !");
+ LOG_GPS(DBG_ERR, "Batch: sending HAL_LOCATION_GPS_ACTION_START_SESSION Fail !");
return FALSE;
}
- LOG_GPS(DBG_INFO, "Batch: sending GPS_ACTION_START_SESSION OK !");
+ LOG_GPS(DBG_INFO, "Batch: sending HAL_LOCATION_GPS_ACTION_START_SESSION OK !");
setting_ignore_key_changed(VCONFKEY_LOCATION_REPLAY_ENABLED, _gps_replay_changed_cb);
{
gboolean status = TRUE;
gboolean is_replay_enabled = FALSE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
gps_server_t *server = g_gps_server;
- gps_action_start_data_t gps_start_data;
+ hal_location_gps_action_start_data_s gps_start_data;
gps_start_data.interval = batch_interval;
gps_start_data.period = batch_period;
gps_start_data.session_status = session_status; /* 0:need to stop, 1:keep status */
int request_add_geofence(int fence_id, double latitude, double longitude, int radius, int last_state, int monitor_states, int notification_responsiveness, int unknown_timer)
{
gboolean status = FALSE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
- geofence_action_data_t action_data;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
+ hal_location_geofence_action_data_s action_data;
action_data.geofence.geofence_id = fence_id;
action_data.geofence.latitude = latitude;
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return 0;
}
- status = hal_location_request(GPS_ACTION_ADD_GEOFENCE, &action_data, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_ADD_GEOFENCE, &action_data, &reason_code);
return status;
}
int request_delete_geofence(int fence_id)
{
gboolean status = FALSE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
LOG_GPS(DBG_LOW, "request_delete_geofence with geofence_id [%d]", fence_id);
int ret = hal_location_get_backend();
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return 0;
}
- status = hal_location_request(GPS_ACTION_DELETE_GEOFENCE, &fence_id, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_DELETE_GEOFENCE, &fence_id, &reason_code);
return status;
}
int request_pause_geofence(int fence_id)
{
gboolean status = FALSE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
LOG_GPS(DBG_LOW, "request_pause_geofence with geofence_id [%d]", fence_id);
int ret = hal_location_get_backend();
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return 0;
}
- status = hal_location_request(GPS_ACTION_PAUSE_GEOFENCE, &fence_id, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_PAUSE_GEOFENCE, &fence_id, &reason_code);
return status;
}
int request_resume_geofence(int fence_id, int monitor_states)
{
gboolean status = FALSE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
- geofence_action_data_t action_data;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
+ hal_location_geofence_action_data_s action_data;
action_data.geofence.geofence_id = fence_id;
action_data.monitor_states = monitor_states;
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return 0;
}
- status = hal_location_request(GPS_ACTION_RESUME_GEOFENCE, &action_data, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_RESUME_GEOFENCE, &action_data, &reason_code);
return status;
}
int request_delete_gps_data()
{
gboolean status = TRUE;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
int ret = hal_location_get_backend();
if( ret < 0){
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return FALSE;
}
- status = hal_location_request(GPS_ACTION_DELETE_GPS_DATA, NULL, &reason_code);
+ status = hal_location_request(HAL_LOCATION_GPS_ACTION_DELETE_GPS_DATA, NULL, &reason_code);
if (status == FALSE) {
- LOG_GPS(DBG_ERR, "Fail : GPS_ACTION_DELETE_GPS_DATA [%d]", reason_code);
+ LOG_GPS(DBG_ERR, "Fail : HAL_LOCATION_GPS_ACTION_DELETE_GPS_DATA [%d]", reason_code);
return FALSE;
}
- LOG_GPS(DBG_LOW, "Success to GPS_ACTION_DELETE_GPS_DATA");
+ LOG_GPS(DBG_LOW, "Success to HAL_LOCATION_GPS_ACTION_DELETE_GPS_DATA");
return TRUE;
}
}
if (server->pos_data == NULL) {
- server->pos_data = (pos_data_t *) malloc(sizeof(pos_data_t));
+ server->pos_data = (hal_location_pos_data_s *) malloc(sizeof(hal_location_pos_data_s));
if (server->pos_data == NULL)
LOG_GPS(DBG_WARN, "//callback: server->pos_data re-malloc Failed!!");
else
- memset(server->pos_data, 0x00, sizeof(pos_data_t));
+ memset(server->pos_data, 0x00, sizeof(hal_location_pos_data_s));
}
if (server->batch_data == NULL) {
- server->batch_data = (batch_data_t *) malloc(sizeof(batch_data_t));
+ server->batch_data = (hal_location_batch_data_s *) malloc(sizeof(hal_location_batch_data_s));
if (server->batch_data == NULL)
LOG_GPS(DBG_WARN, "//callback: server->batch_data re-malloc Failed!!");
else
- memset(server->batch_data, 0x00, sizeof(batch_data_t));
+ memset(server->batch_data, 0x00, sizeof(hal_location_batch_data_s));
}
if (server->sv_data == NULL) {
- server->sv_data = (sv_data_t *) malloc(sizeof(sv_data_t));
+ server->sv_data = (hal_location_sv_data_s *) malloc(sizeof(hal_location_sv_data_s));
if (server->sv_data == NULL)
LOG_GPS(DBG_WARN, "//callback: server->sv_data re-malloc Failed!!");
else
- memset(server->sv_data, 0x00, sizeof(sv_data_t));
+ memset(server->sv_data, 0x00, sizeof(hal_location_sv_data_s));
}
if (server->nmea_data == NULL) {
- server->nmea_data = (nmea_data_t *) malloc(sizeof(nmea_data_t));
+ server->nmea_data = (hal_location_nmea_data_s *) malloc(sizeof(hal_location_nmea_data_s));
if (server->nmea_data == NULL)
LOG_GPS(DBG_WARN, "//callback: server->nmea_data re-malloc Failed!!");
else
- memset(server->nmea_data, 0x00, sizeof(nmea_data_t));
+ memset(server->nmea_data, 0x00, sizeof(hal_location_nmea_data_s));
}
_gps_server_set_gps_state(POSITION_SEARCHING);
}
}
-static void _report_pos_event(gps_server_t *server, gps_event_info_t *gps_event)
+static void _report_pos_event(gps_server_t *server, gps_event_info_s *gps_event)
{
if (server->pos_data != NULL) {
- memset(server->pos_data, 0x00, sizeof(pos_data_t)); /* Moved: the address of server->pos_data sometimes returns 0 when stopping GPS */
- memcpy(server->pos_data, &(gps_event->event_data.pos_ind.pos), sizeof(pos_data_t));
+ memset(server->pos_data, 0x00, sizeof(hal_location_pos_data_s)); /* Moved: the address of server->pos_data sometimes returns 0 when stopping GPS */
+ memcpy(server->pos_data, &(gps_event->event_data.pos_ind.pos), sizeof(hal_location_pos_data_s));
/* change m/s to km/h */
server->pos_data->speed = server->pos_data->speed * MPS_TO_KMPH;
g_update_cb.pos_cb(server->pos_data, gps_event->event_data.pos_ind.error, g_user_data);
}
}
-static void _report_batch_event(gps_server_t *server, gps_event_info_t *gps_event)
+static void _report_batch_event(gps_server_t *server, gps_event_info_s *gps_event)
{
if (server->batch_data != NULL) {
- memset(server->batch_data, 0x00, sizeof(batch_data_t));
- memcpy(server->batch_data, &(gps_event->event_data.batch_ind.batch), sizeof(batch_data_t));
+ memset(server->batch_data, 0x00, sizeof(hal_location_batch_data_s));
+ memcpy(server->batch_data, &(gps_event->event_data.batch_ind.batch), sizeof(hal_location_batch_data_s));
g_update_cb.batch_cb(server->batch_data, g_user_data);
} else {
LOG_GPS(DBG_ERR, "server->batch_data is NULL");
}
}
-static void _report_sv_event(gps_server_t *server, gps_event_info_t *gps_event)
+static void _report_sv_event(gps_server_t *server, gps_event_info_s *gps_event)
{
if (server->sv_data != NULL) {
- memset(server->sv_data, 0x00, sizeof(sv_data_t));
- memcpy(server->sv_data, &(gps_event->event_data.sv_ind.sv), sizeof(sv_data_t));
+ memset(server->sv_data, 0x00, sizeof(hal_location_sv_data_s));
+ memcpy(server->sv_data, &(gps_event->event_data.sv_ind.sv), sizeof(hal_location_sv_data_s));
g_update_cb.sv_cb(server->sv_data, g_user_data);
} else {
LOG_GPS(DBG_ERR, "server->sv_data is NULL");
}
}
-static void _report_nmea_event(gps_server_t *server, gps_event_info_t *gps_event)
+static void _report_nmea_event(gps_server_t *server, gps_event_info_s *gps_event)
{
if (server->nmea_data == NULL) {
LOG_GPS(DBG_ERR, "server->nmea_data is NULL");
LOG_GPS(DBG_LOW, "Enter _gps_server_resolve_dns");
unsigned char result;
- gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e reason_code = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
unsigned int ipaddr;
int port;
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return FALSE;
}
- hal_location_request(GPS_INDI_SUPL_DNSQUERY, (void *)(&ipaddr), &reason_code);
+ hal_location_request(HAL_LOCATION_GPS_INDI_SUPL_DNSQUERY, (void *)(&ipaddr), &reason_code);
} else {
ipaddr = 0;
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", retrn);
return FALSE;
}
- hal_location_request(GPS_INDI_SUPL_DNSQUERY, (void *)(&ipaddr), &reason_code);
+ hal_location_request(HAL_LOCATION_GPS_INDI_SUPL_DNSQUERY, (void *)(&ipaddr), &reason_code);
return FALSE;
}
{
}
-static void _report_geofence_transition(int geofence_id, geofence_zone_state_t transition, double latitude, double longitude, double altitude, double speed, double bearing, double hor_accuracy)
+static void _report_geofence_transition(int geofence_id, hal_location_geofence_zone_state_e transition, double latitude, double longitude, double altitude, double speed, double bearing, double hor_accuracy)
{
gps_update_geofence_transition(geofence_id, transition, latitude, longitude, altitude, speed, bearing, hor_accuracy, (void *)g_user_data);
}
}
}
-static int _gps_server_gps_event_cb(gps_event_info_t *gps_event_info, void *user_data)
+static int _gps_server_gps_event_cb(gps_event_info_s *gps_event_info, void *user_data)
{
/*LOG_FUNC; */
gps_server_t *server = (gps_server_t *)user_data;
}
switch (gps_event_info->event_id) {
- case GPS_EVENT_START_SESSION:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_START_SESSION :::::::::::::::");
- if (gps_event_info->event_data.start_session_rsp.error == GPS_ERR_NONE)
+ case HAL_LOCATION_GPS_EVENT_START_SESSION:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_START_SESSION :::::::::::::::");
+ if (gps_event_info->event_data.start_session_rsp.error == HAL_LOCATION_GPS_ERR_NONE)
_gps_server_start_event(server);
else
LOG_GPS(DBG_ERR, "//Start Session Failed, error : %d", gps_event_info->event_data.start_session_rsp.error);
break;
- case GPS_EVENT_SET_OPTION:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_SET_OPTION :::::::::::::::");
- if (gps_event_info->event_data.set_option_rsp.error != GPS_ERR_NONE)
+ case HAL_LOCATION_GPS_EVENT_SET_OPTION:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_SET_OPTION :::::::::::::::");
+ if (gps_event_info->event_data.set_option_rsp.error != HAL_LOCATION_GPS_ERR_NONE)
LOG_GPS(DBG_ERR, "//Set Option Failed, error : %d", gps_event_info->event_data.set_option_rsp.error);
break;
- case GPS_EVENT_STOP_SESSION:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_STOP_SESSION :::::::::::::::");
- if (gps_event_info->event_data.stop_session_rsp.error == GPS_ERR_NONE) {
+ case HAL_LOCATION_GPS_EVENT_STOP_SESSION:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_STOP_SESSION :::::::::::::::");
+ if (gps_event_info->event_data.stop_session_rsp.error == HAL_LOCATION_GPS_ERR_NONE) {
_gps_server_close_data_connection(server);
_gps_server_stop_event(server);
} else {
}
break;
- case GPS_EVENT_CHANGE_INTERVAL:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_CHANGE_INTERVAL :::::::::::::::");
- if (gps_event_info->event_data.change_interval_rsp.error == GPS_ERR_NONE)
+ case HAL_LOCATION_GPS_EVENT_CHANGE_INTERVAL:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_CHANGE_INTERVAL :::::::::::::::");
+ if (gps_event_info->event_data.change_interval_rsp.error == HAL_LOCATION_GPS_ERR_NONE)
LOG_GPS(DBG_LOW, "Change interval success.");
else
LOG_GPS(DBG_ERR, "//Change interval Failed, error : %d", gps_event_info->event_data.change_interval_rsp.error);
break;
- case GPS_EVENT_REPORT_POSITION:
+ case HAL_LOCATION_GPS_EVENT_REPORT_POSITION:
LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_POSITION :::::::::::::::");
- if (gps_event_info->event_data.pos_ind.error == GPS_ERR_NONE)
+ if (gps_event_info->event_data.pos_ind.error == HAL_LOCATION_GPS_ERR_NONE)
_report_pos_event(server, gps_event_info);
else
LOG_GPS(DBG_ERR, "GPS_EVENT_POSITION Failed, error : %d", gps_event_info->event_data.pos_ind.error);
break;
- case GPS_EVENT_REPORT_BATCH:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_BATCH :::::::::::::::");
- if (gps_event_info->event_data.batch_ind.error == GPS_ERR_NONE)
+ case HAL_LOCATION_GPS_EVENT_REPORT_BATCH:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_REPORT_BATCH :::::::::::::::");
+ if (gps_event_info->event_data.batch_ind.error == HAL_LOCATION_GPS_ERR_NONE)
_report_batch_event(server, gps_event_info);
else
LOG_GPS(DBG_ERR, "GPS_EVENT_BATCH Failed, error : %d", gps_event_info->event_data.batch_ind.error);
break;
- case GPS_EVENT_REPORT_SATELLITE:
- if (gps_event_info->event_data.sv_ind.error == GPS_ERR_NONE) {
+ case HAL_LOCATION_GPS_EVENT_REPORT_SATELLITE:
+ if (gps_event_info->event_data.sv_ind.error == HAL_LOCATION_GPS_ERR_NONE) {
if (gps_event_info->event_data.sv_ind.sv.pos_valid) {
if (_gps_server_get_gps_state() != POSITION_CONNECTED)
_gps_server_set_gps_state(POSITION_CONNECTED);
LOG_GPS(DBG_ERR, "GPS_EVENT_SATELLITE Failed, error : %d", gps_event_info->event_data.sv_ind.error);
}
break;
- case GPS_EVENT_REPORT_NMEA:
+ case HAL_LOCATION_GPS_EVENT_REPORT_NMEA:
/* if (_gps_server_get_gps_state() != POSITION_CONNECTED) */
/*LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_NMEA :::::::::::::::"); */
- if (gps_event_info->event_data.nmea_ind.error == GPS_ERR_NONE)
+ if (gps_event_info->event_data.nmea_ind.error == HAL_LOCATION_GPS_ERR_NONE)
_report_nmea_event(server, gps_event_info);
else
LOG_GPS(DBG_ERR, "GPS_EVENT_NMEA Failed, error : %d", gps_event_info->event_data.nmea_ind.error);
break;
- case GPS_EVENT_ERR_CAUSE:
+ case HAL_LOCATION_GPS_EVENT_ERR_CAUSE:
break;
- case GPS_EVENT_AGPS_VERIFICATION_INDI:
+ case HAL_LOCATION_GPS_EVENT_AGPS_VERIFICATION_INDI:
break;
- case GPS_EVENT_GET_IMSI:
+ case HAL_LOCATION_GPS_EVENT_GET_IMSI:
break;
- case GPS_EVENT_GET_REF_LOCATION:
+ case HAL_LOCATION_GPS_EVENT_GET_REF_LOCATION:
break;
- case GPS_EVENT_OPEN_DATA_CONNECTION: {
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_OPEN_DATA_CONNECTION :::::::::::::::");
+ case HAL_LOCATION_GPS_EVENT_OPEN_DATA_CONNECTION: {
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_OPEN_DATA_CONNECTION :::::::::::::::");
result = _gps_server_open_data_connection(server);
}
break;
- case GPS_EVENT_CLOSE_DATA_CONNECTION: {
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_CLOSE_DATA_CONNECTION :::::::::::::::");
+ case HAL_LOCATION_GPS_EVENT_CLOSE_DATA_CONNECTION: {
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_CLOSE_DATA_CONNECTION :::::::::::::::");
result = _gps_server_close_data_connection(server);
}
break;
- case GPS_EVENT_DNS_LOOKUP_IND:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_DNS_LOOKUP_IND :::::::::::::::");
- if (gps_event_info->event_data.dns_query_ind.error == GPS_ERR_NONE)
+ case HAL_LOCATION_GPS_EVENT_DNS_LOOKUP_IND:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_DNS_LOOKUP_IND :::::::::::::::");
+ if (gps_event_info->event_data.dns_query_ind.error == HAL_LOCATION_GPS_ERR_NONE)
result = _gps_server_resolve_dns(gps_event_info->event_data.dns_query_ind.domain_name);
else
result = FALSE;
LOG_GPS(DBG_LOW, "Success to get the DNS Query about [ %s ]", gps_event_info->event_data.dns_query_ind.domain_name);
break;
- case GPS_EVENT_FACTORY_TEST:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_FACTORY_TEST :::::::::::::::");
- if (gps_event_info->event_data.factory_test_rsp.error == GPS_ERR_NONE) {
+ case HAL_LOCATION_GPS_EVENT_FACTORY_TEST:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_FACTORY_TEST :::::::::::::::");
+ if (gps_event_info->event_data.factory_test_rsp.error == HAL_LOCATION_GPS_ERR_NONE) {
LOG_GPS(DBG_LOW, "[LBS server] Response Factory test result success");
_gps_server_send_facttest_result(gps_event_info->event_data.factory_test_rsp.snr,
gps_event_info->event_data.factory_test_rsp.prn, TRUE);
gps_event_info->event_data.factory_test_rsp.prn, FALSE);
}
break;
- case GPS_EVENT_GEOFENCE_TRANSITION:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_GEOFENCE_TRANSITION :::::::::::::::");
+ case HAL_LOCATION_GPS_EVENT_GEOFENCE_TRANSITION:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_GEOFENCE_TRANSITION :::::::::::::::");
_report_geofence_transition(gps_event_info->event_data.geofence_transition_ind.geofence_id,
gps_event_info->event_data.geofence_transition_ind.state,
gps_event_info->event_data.geofence_transition_ind.pos.latitude,
gps_event_info->event_data.geofence_transition_ind.pos.bearing,
gps_event_info->event_data.geofence_transition_ind.pos.hor_accuracy);
break;
- case GPS_EVENT_GEOFENCE_STATUS:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_GEOFENCE_STATUS :::::::::::::::");
+ case HAL_LOCATION_GPS_EVENT_GEOFENCE_STATUS:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_GEOFENCE_STATUS :::::::::::::::");
_report_geofence_service_status(gps_event_info->event_data.geofence_status_ind.status);
break;
- case GPS_EVENT_ADD_GEOFENCE:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_ADD_GEOFENCE :::::::::::::::");
+ case HAL_LOCATION_GPS_EVENT_ADD_GEOFENCE:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_ADD_GEOFENCE :::::::::::::::");
_gps_server_send_geofence_result(GEOFENCE_ADD_FENCE,
gps_event_info->event_data.geofence_event_rsp.geofence_id,
gps_event_info->event_data.geofence_event_rsp.error);
break;
- case GPS_EVENT_DELETE_GEOFENCE:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_DELETE_GEOFENCE :::::::::::::::");
+ case HAL_LOCATION_GPS_EVENT_DELETE_GEOFENCE:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_DELETE_GEOFENCE :::::::::::::::");
_gps_server_send_geofence_result(GEOFENCE_DELETE_FENCE,
gps_event_info->event_data.geofence_event_rsp.geofence_id,
gps_event_info->event_data.geofence_event_rsp.error);
break;
- case GPS_EVENT_PAUSE_GEOFENCE:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_PAUSE_GEOFENCE :::::::::::::::");
+ case HAL_LOCATION_GPS_EVENT_PAUSE_GEOFENCE:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_PAUSE_GEOFENCE :::::::::::::::");
_gps_server_send_geofence_result(GEOFENCE_PAUSE_FENCE,
gps_event_info->event_data.geofence_event_rsp.geofence_id,
gps_event_info->event_data.geofence_event_rsp.error);
break;
- case GPS_EVENT_RESUME_GEOFENCE:
- LOG_GPS(DBG_LOW, "<<::::::::::: GPS_EVENT_RESUME_GEOFENCE :::::::::::::::");
+ case HAL_LOCATION_GPS_EVENT_RESUME_GEOFENCE:
+ LOG_GPS(DBG_LOW, "<<::::::::::: HAL_LOCATION_GPS_EVENT_RESUME_GEOFENCE :::::::::::::::");
_gps_server_send_geofence_result(GEOFENCE_RESUME_FENCE,
gps_event_info->event_data.geofence_event_rsp.geofence_id,
gps_event_info->event_data.geofence_event_rsp.error);
#ifndef _TIZEN_PUBLIC_
int request_supl_ni_session(const char *header, const char *body, int size)
{
- agps_supl_ni_info_t info;
- gps_failure_reason_t reason_code;
+ hal_location_agps_supl_ni_info_s info;
+ gps_failure_reason_e reason_code;
info.msg_body = (char *)body;
info.msg_size = size;
return FALSE;
}
- if (!hal_location_request(GPS_ACTION_REQUEST_SUPL_NI, &info, &reason_code)) {
+ if (!hal_location_request(HAL_LOCATION_GPS_ACTION_REQUEST_SUPL_NI, &info, &reason_code)) {
LOG_GPS(DBG_ERR, "Failed to request SUPL NI (code:%d)", reason_code);
return FALSE;
}
static void *request_supl_ni_session(void *data)
{
gps_ni_data_t *ni_data = (gps_ni_data_t *) data;
- agps_supl_ni_info_t info;
- gps_failure_reason_t reason_code;
+ hal_location_agps_supl_ni_info_s info;
+ gps_failure_reason_e reason_code;
info.msg_body = (char *)ni_data->msg_body;
info.msg_size = ni_data->msg_size;
return;
}
- if (!hal_location_request(GPS_ACTION_REQUEST_SUPL_NI, &info, &reason_code))
+ if (!hal_location_request(HAL_LOCATION_GPS_ACTION_REQUEST_SUPL_NI, &info, &reason_code))
LOG_GPS(DBG_ERR, "Failed to request SUPL NI (code:%d)", reason_code);
free(ni_data);
memset(&g_gps_server->gps_plugin, 0x00, sizeof(gps_plugin_handler_t));
if (g_gps_server->pos_data == NULL) {
- g_gps_server->pos_data = (pos_data_t *) malloc(sizeof(pos_data_t));
+ g_gps_server->pos_data = (hal_location_pos_data_s *) malloc(sizeof(hal_location_pos_data_s));
if (g_gps_server->pos_data == NULL) {
LOG_GPS(DBG_ERR, "Failed to alloc g_gps_server->pos_data");
return NULL;
} else {
- memset(g_gps_server->pos_data, 0x00, sizeof(pos_data_t));
+ memset(g_gps_server->pos_data, 0x00, sizeof(hal_location_pos_data_s));
}
}
if (g_gps_server->batch_data == NULL) {
- g_gps_server->batch_data = (batch_data_t *) malloc(sizeof(batch_data_t));
+ g_gps_server->batch_data = (hal_location_batch_data_s *) malloc(sizeof(hal_location_batch_data_s));
if (g_gps_server->batch_data == NULL) {
LOG_GPS(DBG_ERR, "Failed to alloc g_gps_server->batch_data");
return NULL;
} else {
- memset(g_gps_server->batch_data, 0x00, sizeof(batch_data_t));
+ memset(g_gps_server->batch_data, 0x00, sizeof(hal_location_batch_data_s));
}
}
if (g_gps_server->sv_data == NULL) {
- g_gps_server->sv_data = (sv_data_t *) malloc(sizeof(sv_data_t));
+ g_gps_server->sv_data = (hal_location_sv_data_s *) malloc(sizeof(hal_location_sv_data_s));
if (g_gps_server->sv_data == NULL) {
LOG_GPS(DBG_ERR, "Failed to alloc g_gps_server->sv_data");
return NULL;
} else {
- memset(g_gps_server->sv_data, 0x00, sizeof(sv_data_t));
+ memset(g_gps_server->sv_data, 0x00, sizeof(hal_location_sv_data_s));
}
}
if (g_gps_server->nmea_data == NULL) {
- g_gps_server->nmea_data = (nmea_data_t *) malloc(sizeof(nmea_data_t));
+ g_gps_server->nmea_data = (hal_location_nmea_data_s *) malloc(sizeof(hal_location_nmea_data_s));
if (g_gps_server->nmea_data == NULL) {
LOG_GPS(DBG_ERR, "Failed to alloc g_gps_server->nmea_data");
return NULL;
} else {
- memset(g_gps_server->nmea_data, 0x00, sizeof(nmea_data_t));
+ memset(g_gps_server->nmea_data, 0x00, sizeof(hal_location_nmea_data_s));
}
}
int deinitialize_server()
{
- gps_failure_reason_t ReasonCode = GPS_FAILURE_CAUSE_NORMAL;
+ gps_failure_reason_e ReasonCode = HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL;
#ifdef _TIZEN_PUBLIC_
pthread_join(g_gps_server->msg_thread, (void *)&g_gps_server->msg_thread_status);