Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-gps: Commit

hardware/gps


Commit MetaInfo

Révision4f94c7e432c71c994ffa4cda149b89e5b58b40d1 (tree)
l'heure2015-04-07 16:56:45
AuteurChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Message de Log

enable gps.huawei

Change Summary

Modification

--- a/Android.mk
+++ b/Android.mk
@@ -1,4 +1,4 @@
1-# Copyright (C) 2011 The Android-x86 Open Source Project
1+# Copyright (C) 2011-2014 The Android-x86 Open Source Project
22
33 ifeq ($(strip $(BOARD_HAS_GPS_HARDWARE)),true)
44 LOCAL_PATH := $(call my-dir)
@@ -6,15 +6,18 @@ LOCAL_PATH := $(call my-dir)
66 # HAL module implemenation, not prelinked and stored in
77 # hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so
88 include $(CLEAR_VARS)
9-LOCAL_PRELINK_MODULE := false
109 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
1110 LOCAL_SHARED_LIBRARIES := liblog libcutils
1211 LOCAL_MODULE := gps.default
1312 LOCAL_MODULE_TAGS := optional
14-ifeq ($(strip $(BOARD_GPS_HARDWARE)),huawei)
15-LOCAL_SRC_FILES := gps_huawei.c
16-else
1713 LOCAL_SRC_FILES := gps.c
18-endif
14+include $(BUILD_SHARED_LIBRARY)
15+
16+include $(CLEAR_VARS)
17+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
18+LOCAL_SHARED_LIBRARIES := liblog libcutils
19+LOCAL_MODULE := gps.huawei
20+LOCAL_MODULE_TAGS := optional
21+LOCAL_SRC_FILES := gps_huawei.c
1922 include $(BUILD_SHARED_LIBRARY)
2023 endif
--- a/gps_huawei.c
+++ b/gps_huawei.c
@@ -42,7 +42,7 @@
4242 #define GPS_DEBUG 0
4343
4444 #if GPS_DEBUG
45-# define D(...) LOGD(__VA_ARGS__)
45+# define D(...) ALOGD(__VA_ARGS__)
4646 #else
4747 # define D(...) ((void)0)
4848 #endif
@@ -170,7 +170,7 @@ static void dev_power(int state)
170170 return ; //RvdB
171171
172172 if (property_get("gps.power_on",prop,GPS_POWER_IF) == 0) {
173- LOGE("no gps power interface name");
173+ ALOGE("no gps power interface name");
174174 return;
175175 }
176176
@@ -179,7 +179,7 @@ static void dev_power(int state)
179179 } while (fd < 0 && errno == EINTR);
180180
181181 if (fd < 0) {
182- LOGE("could not open gps power interface: %s", prop );
182+ ALOGE("could not open gps power interface: %s", prop );
183183 return;
184184 }
185185
@@ -926,7 +926,7 @@ static void nmea_reader_parse( NmeaReader* r )
926926 }
927927 gmtime_r( (time_t*) &r->fix.timestamp, &utc );
928928 p += snprintf(p, end-p, " time=%s", asctime( &utc ) );
929- LOGE("%s\n",temp);
929+ ALOGE("%s\n",temp);
930930 }
931931 #endif
932932 }
@@ -1067,7 +1067,7 @@ static void gps_status_cb( GpsState* state , GpsStatusValue status)
10671067 }
10681068 }
10691069
1070-static void gps_set_capabilities_cb( GpsState* state , uint32_t caps)
1070+static void gps_set_capabilities_cb( GpsState* state, unsigned long caps)
10711071 {
10721072 D("%s()", __FUNCTION__ );
10731073 if (state->callbacks.set_capabilities_cb) {
@@ -1151,13 +1151,13 @@ static void* gps_state_thread( void* arg )
11511151 nevents = epoll_wait( epoll_fd, events, 2, -1 );
11521152 if (nevents < 0) {
11531153 if (errno != EINTR)
1154- LOGE("epoll_wait() unexpected error: %s", strerror(errno));
1154+ ALOGE("epoll_wait() unexpected error: %s", strerror(errno));
11551155 continue;
11561156 }
11571157 D("gps thread received %d events", nevents);
11581158 for (ne = 0; ne < nevents; ne++) {
11591159 if ((events[ne].events & (EPOLLERR|EPOLLHUP)) != 0) {
1160- LOGE("EPOLLERR or EPOLLHUP after epoll_wait() !?");
1160+ ALOGE("EPOLLERR or EPOLLHUP after epoll_wait() !?");
11611161 goto Exit;
11621162 }
11631163 if ((events[ne].events & EPOLLIN) != 0) {
@@ -1188,7 +1188,7 @@ static void* gps_state_thread( void* arg )
11881188 state->init = STATE_START;
11891189
11901190 if ( pthread_create( &state->tmr_thread, NULL, gps_timer_thread, state ) != 0 ) {
1191- LOGE("could not create gps timer thread: %s", strerror(errno));
1191+ ALOGE("could not create gps timer thread: %s", strerror(errno));
11921192 started = 0;
11931193 state->init = STATE_INIT;
11941194 goto Exit;
@@ -1236,7 +1236,7 @@ static void* gps_state_thread( void* arg )
12361236 }
12371237 else
12381238 {
1239- LOGE("epoll_wait() returned unkown fd %d ?", fd);
1239+ ALOGE("epoll_wait() returned unkown fd %d ?", fd);
12401240 }
12411241 }
12421242 }
@@ -1296,7 +1296,7 @@ static int open_serialport( const char* name )
12961296 } while (fd < 0 && errno == EINTR);
12971297
12981298 if (fd < 0) {
1299- LOGE("could not open serial device %s: %s", name, strerror(errno) );
1299+ ALOGE("could not open serial device %s: %s", name, strerror(errno) );
13001300 return fd;
13011301 }
13021302
@@ -1394,7 +1394,7 @@ static void gps_state_init( GpsState* state )
13941394
13951395 state->fd = open_serialport( gps_data );
13961396 if (state->fd < 0) {
1397- LOGE("could not open gps serial device %s: %s", gps_data, strerror(errno) );
1397+ ALOGE("could not open gps serial device %s: %s", gps_data, strerror(errno) );
13981398 dev_power(0);
13991399 return;
14001400 }
@@ -1413,7 +1413,7 @@ static void gps_state_init( GpsState* state )
14131413
14141414 state->ctrl_fd = open_serialport( gps_ctrl );
14151415 if (state->ctrl_fd < 0) {
1416- LOGE("could not open gps serial device %s: %s", gps_ctrl, strerror(errno) );
1416+ ALOGE("could not open gps serial device %s: %s", gps_ctrl, strerror(errno) );
14171417 close(state->fd);
14181418 state->fd = -1;
14191419 dev_power(0);
@@ -1448,13 +1448,13 @@ static void gps_state_init( GpsState* state )
14481448 serial_write(state->ctrl_fd,"AT^WPDGP\r\n");
14491449
14501450 if ( socketpair( AF_LOCAL, SOCK_STREAM, 0, state->control ) < 0 ) {
1451- LOGE("could not create thread control socket pair: %s", strerror(errno));
1451+ ALOGE("could not create thread control socket pair: %s", strerror(errno));
14521452 goto Fail;
14531453 }
14541454
14551455
14561456 if ( pthread_create( &state->thread, NULL, gps_state_thread, state ) != 0 ) {
1457- LOGE("could not create gps thread: %s", strerror(errno));
1457+ ALOGE("could not create gps thread: %s", strerror(errno));
14581458 goto Fail;
14591459 }
14601460
@@ -1751,7 +1751,7 @@ static const GpsInterface sGpsInterface = {
17511751
17521752 static const GpsInterface* gps_get_hardware_interface(struct gps_device_t* dev)
17531753 {
1754- LOGV("get_interface was called");
1754+ ALOGV("get_interface was called");
17551755 return &sGpsInterface;
17561756 }
17571757
@@ -1775,7 +1775,7 @@ static struct hw_module_methods_t gps_module_methods = {
17751775 .open = open_gps
17761776 };
17771777
1778-DLL_PUBLIC const struct hw_module_t HAL_MODULE_INFO_SYM = {
1778+DLL_PUBLIC struct hw_module_t HAL_MODULE_INFO_SYM = {
17791779 .tag = HARDWARE_MODULE_TAG,
17801780 .version_major = 1,
17811781 .version_minor = 0,
Afficher sur ancien navigateur de dépôt.