This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Missing GPS files

Hello,

in the TI_Android_JB_4.2.2_DevKit_4.1.1 the GPS folder is missing. I'm following a guide to "attach" an NMEA gps to my board, but this file seem to be missing:

hardware/libhardware_legacy/gps/gps.cpp

Someone can help me? I'm starting this porting now and i get a little bit confused...

regards,
Gianmaria
  • Hi Gianmaria,

    If I understand correctly, you are trying to port your custom GPS to Android JB 4.2.2.
    To do this, you need to implement your own libhardware libgps.so probably in hardware/ tree. The JB AOSP provides you with the gps.h files that exposes all the strucutre and macros used by Android framework.

    The gps.cpp file you are referring to is not required anymore since now, Android provides a generic way to load HAL libraries that applies to GPS: hw_get_module(GPS_HARDWARE_MODULE_ID, ...) rather than gps_find_hardware().

    Unfortunately, most of the GPS HAL is usually close source and not many examples can be found.

    You can refer to the  frameworks/base/services/jni/com_android_server_location_GpsLocationProvider.cpp which is the JNI binding of higher level location service.
    You will see there how the init is done and combining this with gps.h, you should be able to design your own HAL.

    I hope this answers your question and gets you started.

  • Hello,

    thank you for your help. Ok.. What I've done. 

    1) I started with freerunner_gps.c cause it seem the simplest solution, and it clearly works with a serial nmea port, wich is right my case. I've a ttyUSB1 wich produces just NMEA sentences. 

    2) I've created a directory:

    android/hardware/libhardware_legacy/gps

    and placed freerunner_gps.c  , a link to referenced gps.h pointing at 

    android/hardware/libhardware/include/hardware/gps.h

    and created an Android.mk so simple:

    LOCAL_PATH := $(call my-dir)
     
      include $(CLEAR_VARS)
     
      LOCAL_SRC_FILES := \
        gps_freerunner.c
     
      LOCAL_MODULE := libgps.telit
     
      LOCAL_SHARED_LIBRARIES := \
        libutils \
        libcutils \
        libdl \
        libc
     
      include $(BUILD_SHARED_LIBRARY)



    it produces a libpgs.telit.so in output folder /system/lib

    3) I added to my BoardConfig.mk the following:

    BOARD_GPS_LIBRARIES := libgps.telit

    4) in my build.prop i added this line ro.kernel.android.gps=/dev/ttyUSB1
    Where USB1 is a working serial that produces NMEA.

    After this, i checked if everything on board is ok, all files are in place. But I absolutely cant see any debug line or initialization string.

    It seems I have to do something else to enable the GPS part.. Android at moment is copletly ignoring this hardware.

    Any suggest?

    Regards,
    Gianmaria

  • Hello,

    need a little help with this.. Cant find documentation nowhere...
    I'm tring all the ways but it seems that Android cant load the library noway.. it just ignore it.. 

    Also I've tried creating a directory gps in hardware directory.. but in this way the Android.mk file were readed but the library were not produced.. the only way I have is to build using mm in the gps directory. 

    thank you so much.. 

    Gianmaria

  • Hello,

    i finally got it working. If someone need helps with GPS porting.. i travelled that sea.. and can help. 

    Regards,

    Gianmaria

  • Hi Gianmaria,

    I am too facing the same issue in interfacing a GPS Module. Can you outline the steps please 

    Regards,

    John

  • Hi Gianmaria,

    I am facing same problem. i have iwave g7 board with android jelly bean (OS). and external gps is connected to /dev/ttymxc2 node.

    i am able to see NMEA data (cat /dev/ttymxc2 ) .

    And i want to write my own HAL layer for gps and to link it to jni layer by which application(ex ;- google map ) can able to get gps location ( my location ).

    Please give me some suggestion .

     

    Regards 

    Satya.