CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 12268|回复: 8

关于CB2和CT的GPS使用,,

[复制链接]
发表于 2015-1-4 19:54:30 | 显示全部楼层 |阅读模式
本帖最后由 jiangdou 于 2015-1-4 20:14 编辑

41220171150.jpg



调试说明:1,  gps.c //open("/dev/ttyS_x",)失败,,参考init.sun7i.rc  chmod  /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" />                                //add  modify  for 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
    ....(略)
推荐 chmod  777 /dev/ttyS5

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


gps.c.tar.gz (8.23 KB, 下载次数: 35)
9,gps测试APK
参考附件 gpstest.tar.gz (913.59 KB, 下载次数: 43)

回复

使用道具 举报

发表于 2015-1-4 20:04:46 | 显示全部楼层
{:soso_e179:}
回复 支持 反对

使用道具 举报

发表于 2015-1-4 20:39:37 | 显示全部楼层
写的不错哦
回复 支持 反对

使用道具 举报

发表于 2015-1-9 13:43:06 | 显示全部楼层
不错、、不过这个是用来做什么的?
回复 支持 反对

使用道具 举报

发表于 2015-1-12 10:47:47 | 显示全部楼层
LZ,请问一下你桌面上的那个小屏幕,CT支持使用么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-1-12 14:04:09 | 显示全部楼层
wake 发表于 2015-1-12 10:47
LZ,请问一下你桌面上的那个小屏幕,CT支持使用么?

CB1 CB2 pin  to pin  专用的显示屏,CT插不去啊
回复 支持 反对

使用道具 举报

发表于 2015-1-15 13:37:06 | 显示全部楼层
jiangdou 发表于 2015-1-12 14:04
CB1 CB2 pin  to pin  专用的显示屏,CT插不去啊

LZ知道有支持CT的屏幕么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-1-15 16:59:02 | 显示全部楼层
本帖最后由 jiangdou 于 2015-1-15 17:09 编辑
wake 发表于 2015-1-15 13:37
LZ知道有支持CT的屏幕么?

CT没有引出LCD接口,所以不支持任何RGB的显示屏,,建议买一个CB2,,CB2可以

2015-01-15 1.png
回复 支持 反对

使用道具 举报

发表于 2015-9-29 23:19:11 | 显示全部楼层
按照此方式修改,我的编译之后提示不能创建out/target/product/wing-clover/obj/SHARED_LIBRARIES/gps.exDroid_intermediates/import_includes
这个是缺少什么文件呢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-5-1 00:43 , Processed in 0.028281 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部