jiangdou 发表于 2015-1-4 19:54:30

关于CB2和CT的GPS使用,,

本帖最后由 jiangdou 于 2015-1-4 20:14 编辑





调试说明:1,gps.c //open("/dev/ttyS_x",)失败,,参考init.sun7i.rcchmod/dev/ttyS_x权限问题
               2,   注意输出错误的log
               3,   已经编译过的android ,请先make clean再修改以下部分,后再编译android,
               
modify: for gps device

1,device/softwinner/common/hardware/libhardware/gps/Android.mk

LOCAL_PATH := $(call my-dir)

ifeq ($(BOARD_USES_GPS_TYPE),simulator)
# HAL module implemenation, not prelinked and stored in
# hw/<GPS_HARDWARE_MODULE_ID>.<ro.hardware>.so
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_CFLAGS += -DHAVE_GPS_HARDWARE                                     //modify for gps!!!!!!!!!
LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware libc libutils    //modify   gps !!!!!!!!!!
LOCAL_SRC_FILES := gps.c
LOCAL_MODULE := gps.exDroid
LOCAL_MODULE_TAGS := eng   //modify
include $(BUILD_SHARED_LIBRARY)
endif

ifeq ($(BOARD_USES_GPS_TYPE),haiweixun)
include $(CLEAR_VARS)
LOCAL_MODULE := gps.exDroid.so
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/hw/
LOCAL_SRC_FILES := /haiweixun/gps.exDroid.so
include $(BUILD_PREBUILT)
endif

2,device/softwinner/wing-common/BoardConfigCommon.mk

    ....(略)
    #add for gps
    BOARD_USES_GPS_TYPE := simulator   //编译选择gps.c
    ....(略)
3,device/softwinner/wing-common/tablet_core_hardware.xml


<permissions>
    <feature name="android.hardware.location" />
    <feature name="android.hardware.location.network" />
    <feature name="android.hardware.sensor.compass" />
    <feature name="android.hardware.sensor.accelerometer" />
    <feature name="android.hardware.bluetooth" />
    <feature name="android.hardware.touchscreen" />
    <feature name="android.hardware.touchscreen.multitouch" />
    <feature name="android.hardware.touchscreen.multitouch.distinct" />
    <feature name="android.hardware.microphone" />
    <feature name="android.hardware.screen.portrait" />
    <feature name="android.hardware.screen.landscape" />
    <feature name="android.hardware.location.gps" />                                //addmodifyfor gps
    <!-- devices with GPS must include android.hardware.location.gps.xml -->
    <!-- devices with a rear-facing camera must include one of these as appropriate:
         android.hardware.camera.xml or
         android.hardware.camera.autofocus.xml or
         android.hardware.camera.autofocus-flash.xml -->
    <!-- devices with a front facing camera must include
         android.hardware.camera.front.xml -->
    <!-- devices with WiFi must also include android.hardware.wifi.xml -->
    <!-- devices with an ambient light sensor must also include
         android.hardware.sensor.light.xml -->
    <!-- devices with a proximity sensor must also include
         android.hardware.sensor.proximity.xml -->
    <!-- devices with a barometer must also include
         android.hardware.sensor.barometer.xml -->
    <!-- devices with a gyroscope must also include
         android.hardware.sensor.gyroscope.xml -->
    <!-- GSM phones must also include android.hardware.telephony.gsm.xml -->
    <!-- CDMA phones must also include android.hardware.telephony.cdma.xml -->
</permissions>

4,device/softwinner/sugar-standard/sugar_cubieboard.mk,,,,或者sugar_cubietruck.mk
PRODUCT_PACKAGES += \
      TvdLauncher \
      gps.exDroid    //add for make gps .so

5,packages/apps/Settings/src/com/android/settings/LocationSettings.java
       ....(略)//禁止setting检测
      //modify by jiangdou 20141218
      //mGps.setChecked(gpsEnabled);
      ....(略)
6,packages/apps/Settings/res/xml/location_settings.xml
   ....(略)注释掉此处!!

<!--modify by jiangdou for gps
      <CheckBoxPreference
            android:key="location_gps"
            android:title="@string/location_gps"
            android:summary="@string/location_street_level"
            android:dependency="location_toggle"
            android:persistent="false" />


-->
      <com.android.settings.WrappingCheckBoxPreference
            android:key="location_network"
            android:title="@string/location_network_based"
            android:summary="@string/location_neighborhood_level"
            android:dependency="location_toggle"
            android:persistent="false" />

   ....(略)

7,device/softwinner/sugar-cubieboard/init.sun7i.rc,,,,或者sugar-cubietruck

   ....(略)修改权限问题
    chmod/dev/ttyS_x
    ....(略)
推荐 chmod777 /dev/ttyS5

8,device/softwinner/common/hardware/libhardware/gps/gps.c
修改的源码参考附件!!!!



9,gps测试APK
参考附件

kerwin666 发表于 2015-1-4 20:04:46

{:soso_e179:}

lin 发表于 2015-1-4 20:39:37

写的不错哦:loveliness:

leyiwo 发表于 2015-1-9 13:43:06

不错、、不过这个是用来做什么的?

wake 发表于 2015-1-12 10:47:47

LZ,请问一下你桌面上的那个小屏幕,CT支持使用么?

jiangdou 发表于 2015-1-12 14:04:09

wake 发表于 2015-1-12 10:47 static/image/common/back.gif
LZ,请问一下你桌面上的那个小屏幕,CT支持使用么?

CB1 CB2 pinto pin专用的显示屏,CT插不去啊

wake 发表于 2015-1-15 13:37:06

jiangdou 发表于 2015-1-12 14:04 static/image/common/back.gif
CB1 CB2 pinto pin专用的显示屏,CT插不去啊

LZ知道有支持CT的屏幕么?

jiangdou 发表于 2015-1-15 16:59:02

本帖最后由 jiangdou 于 2015-1-15 17:09 编辑

wake 发表于 2015-1-15 13:37 static/image/common/back.gif
LZ知道有支持CT的屏幕么?
CT没有引出LCD接口,所以不支持任何RGB的显示屏,,建议买一个CB2,,CB2可以


lam007 发表于 2015-9-29 23:19:11

按照此方式修改,我的编译之后提示不能创建out/target/product/wing-clover/obj/SHARED_LIBRARIES/gps.exDroid_intermediates/import_includes
这个是缺少什么文件呢
页: [1]
查看完整版本: 关于CB2和CT的GPS使用,,