Understanding Android GPS HAL Driver

android9:GPS模块-源码调用流程 参考文章:https://blog.youkuaiyun.com/grekit_sun/article/details/109469351 参考:https://blog.youkuaiyun.com/pangsurong/article/details/73912714?utm_medium=distribute.pc_relevant.none-task-blog-title-11&spm=1001.2101.3001.4242 参考:https://blog.youkuaiyun.com/weixin_45244289/article/ 阅读详情

Understanding Android GPS HAL Driver

Alex Dou 

autoasm@yahoo.com


Android Hardware Abstraction Layer

The Android HAL (Hardware Abstraction Layer) is software layer that the user space device drivers reside in. According to Google's documents, the purpose of introducing the layer is to provide a unified interface for framework. Meanwhile the HAL is also a antidote for GPL, because anything that be put into kernel have to follow GPL to be open sourced.

Before understanding GPS HAL driver,let us take a look at the the HAL structure. 

The HAL driver is a .so file that under specific path. The .so file must export a hw_module_t symbol as an entry point of the driver. Through calling open() method of of the hw_module_t object, system can retrieve an instance of hw_device_t that represents the expected device. Once the device instance be returned, the android framework can manipulate on the device through methods of hw_device_t.

​The below diagram shows relationship between these concepts.   

As a diagram shows, gps_device_t is a subclass of hw_device_t. Although the C Language does not support object-oriented concepts, from the view point of object module, the relation ship between gps_device_t and hw_device_t should be inheritence. 

​

​

GPS HAL Driver

As we discussed in the above section, the GPS driver is a subclass of HAL driver, it also provide a specific interface to manipulate GPS device.  Now, let us go deeper into the implementation of a typical GPS HAL driver.

Please see the below diagram

​

The GPS HAL driver contains a HAL_MODULE_INFO_SYM block as the entry. System can locate the entry easily because the symbol name is well-defined. Once the entry object is located, the gps_device_t instance can be created by calling open() of gps_module_methods which methods field points to. As we have discussed, the gps_device_t provides an method to export GPS-specific interface, now, the system can call dev->get_gps_interface() to obtain the GPS operations. 

So far, we have known the structure of GPS HAL driver and we understood the GPS driver loading process as well. I don't want talk more about how the GpsInerface workswith Underlying module, because 1. the GPS theory is too complex to discuss within the paper. 2. The implementation of GpsInterface highly depends on your system design, it can work with serial port to retrive location from external GPS module, it is also enable to call ioctrl() to interact with linux device driver.

​​


Android GPS学习笔记—HAL实现 HAL的全称是Hardware Abstraction Layer, 即硬件抽象层。         HAL层是介于Android内核与上层之间抽象出来的一层结构,它是对linux驱动的一个封装,对上层提供统一接口,上层应用不必知道下层是如何实现的,它屏蔽了底层的实现细节。            1. HAL的由来         Android的HAL是为了保护一些硬件 阅读详情

相关推荐

android关于GPS hal层的分析

主控: Samsung   Cortex  ARM A8  smdkc110  1G Gps:    Ublox-G6010 系统:  android 2.3 以下篇幅都是本人的一些建议以及做法 在android里关于普通GPS模块(俗称硬GPS)相对来说是比较简单的,因为android都帮你封装好了,我们要做的稍后做详解。 1

huabinbin110的专栏 1911

Android GPS驱动

1.android定位方式 android 定位一般有四种方法,这四种方式分别是GPS定位、WIFI定位、基站定位、AGPS定位。 1.1 Android GPS 需要GPS硬件支持直接和卫星交互来获取当前经纬度,通过GPS方式准确度是最高的,但确定是比较耗电、从GPS模块启动到获取第一次定位数据可能需要比较长的时间、室内几乎无法使用等等; 1.2 Android Wifi定位 根据一个固定的Wifi MAC地址通过收集到的该Wifi热点的位置然后访...

四季帆的博客 5027

高通8155 GPS HAL层代码移植

Qup的全称是qualcommuniversalperipherals即高通通用外设,uart就是连接在qup上,我的gpsuart连接在QUP13上,所以肯需要在tz_8155/trustzone_images/core/settings/buses/qup_accesscontrol/qupv3/config/855/QUPAC_Access.c文件中修改qupv3_perms_auto[]数组的QUPV3_2_SE3相关配置。...

四季帆的博客 2474

android gps驱动 可见/已连接卫星支持北斗

前提:GPS驱动已通 其实不加这个也能定位,因为定位信息是模块结合gps和北斗的定位算好一起发上来的,加这个只是能让app能看到北斗的卫星信息(例如gps测试仪) 修改的部分为GSA 和 GSV GSV -> 可见卫星 GSA -> 已连接卫星 GSV存下GPGSV和BDGSV的信息后一起上传 } else if ( !memcmp(tok.p, "GSV", 3) ) {

zslzsl999的专栏 8959

Android 的定位分层架构

Android GPS

Jun_P的博客 2490

搭建基于ubuntu的内核开发环境

内核开发的版本依赖问题 Linux 内核模块与运行内核之间存在着版本依赖。如果编译内核模块使用的代码树与运行内核的版本不完全匹配,则在用insmod安装模块时,很可能会产生Invalid module format. 错误。 为了解决这个问题,要么使用与当前运行内核完全匹配的

闲云野鹤话IT -- Enjoy IT 7499

Android系统GPS HAL层移植笔记

转载地址:http://blog.chinaunix.net/uid-14198351-id-3371590.html Android系统源码都有虚拟机GPS HAL层文件gps_qemu.c,移植GPS HAL层修改该文件就可以了。 下面将从上到下说明主要修改的地方。 修改LOG TAG #define  LOG_TAG  "gps_qemu" -> #define  LOG

u010402372的专栏 3287

【信息科学与工程学】【数据中心】第三十五篇 云计算数据中心的学科知识04

编号学科(课程)核心知识点在云计算/云存储/云网络/云安全/云MaaS中的作用代表教材/资料/论文 + 数学方程式列表工业界应用D1421​云原生数据库:TiDB​HTAP(混合事务/分析处理)、分布式SQL、水平扩展、强一致(Raft)、自动故障恢复、与MySQL兼容、TiFlash列式引擎提供弹性扩展的分布式数据库;支撑高并发在线交易与实时分析教材:《TiDB in Action》PingCAP(2020) 论文:《TiDB: A Raft-based HTAP Database》(2017)

weixin_49199313的博客 403

Android GPS HAL详解

GPS HAL Callback函数 * Callback with location information. 告知上层位置信息*/ typedef void (* gps_location_callback)(GpsLocation* location);/** Callback with status information.GPS状态信息回调*/ typedef void (* gps_st

kunis的专栏 1717

GPS Android底层驱动资料(附关键源码)

GPS Android底层驱动的编写详细步骤与资料详解 JNI与HAL层介绍 Java层与JNI层交互接口函数介绍 GpsInterface及其他交互接口介绍与代码分析

STM32基于HAL解析GPS经度纬度以及时间

STM32基于HAL解析GPS经度纬度以及时间

GPS模块HAL层分析和调试

主控:SamsungCortexARM A8smdkc1101G Gps:Ublox-G6010 系统:android 2.3 在android里关于普通GPS模块(俗称硬GPS)相对来说是比较简单的,因为android都帮你封装好了,我们要做的稍后做详解。 1、首先拿到一个GPS模块我们先判断是硬GPS、还是半软半硬的GPS,只要不用于某个行业或者对于...

jinron10的专栏 2817

Android_GPSDriverLibrary_SourceCode

Android_GPSDriverLibrary_SourceCode

Android-Gnss/GPS HAL层实现绑定+直通式修改为纯绑定式示例

Android-Gnss/gps HAL层实现直通式修改为绑定式的简单方法 先来看一下 Gnss/GPS HAL service 直通式的调用方式 using android::hardware::gnss::V1_0::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { android::ProcessState::initWithDriver("/dev/vndbind

halazi100 7210

IKM 测试题 - Java SE 8 评估测试题目

IKM 测试题 - Java SE 8 评估测试题目

licheng11y的博客 1314

麒麟V10 ARM环境离线部署MySQL:从依赖缺失到服务自启的完整避坑指南

本文详细介绍了在麒麟V10 ARM环境下离线部署MySQL的完整流程,包括依赖缺失解决方案、目录配置、服务自启设置及性能调优。特别针对国产操作系统和ARM架构的兼容性问题,提供了实用的避坑指南和优化建议,帮助用户高效完成MySQL部署与维护。

weixin_28741413的博客 409

Android系统的HAL层分析 -- GPS

Android系统HAL层分析 -- GPS0 前言1 HAL层gps代码分析/注释 0 前言 1 HAL层gps代码分析/注释

Android系统工程师--小馬佩德罗 958

OMNET++ INET框架学习教程(一)

在自组网学习的道路上摸石头过河,帮你快速入门OIMNET++平台下的INET框架。

NLDwangzhe的博客 6565

和菜鸟一起学android4.0.3源码之硬件gps简单移植

关于android定位方式 android 定位一般有四种方法,这四种方式分别是GPS定位、WIFI定位、基站定位、AGPS定位。 1、 Android GPS 需要GPS硬件支持直接和卫星交互来获取当前经纬度,这种方式需要手机支持GPS模块现在大部分的智能机应该都有了。通过GPS方式准确度是最高的但是它的缺点也非常明显。 1、 比较耗电 2、 绝大部分用户默认不开启GPS模块 3、

东月之神 2万+

Zabbix7.4监控系统在Rocky Linux10.0上的完整部署流程(含MariaDB配置)

本文详细介绍了在Rocky Linux 10.0操作系统上部署企业级监控系统Zabbix 7.4的完整流程,并重点阐述了与MariaDB数据库的深度集成与性能优化配置。内容涵盖从系统环境准备、数据库安装与安全加固、Zabbix核心组件部署,到服务配置、Web界面初始化以及生产环境高级调优的全方位实战指南,旨在帮助用户构建稳定高效的监控平台。

weixin_29200741的博客 328

安装 Claude Code 并接入阿里云百炼(Bailian)

这些工具通常提供可视化界面,只需在设置中填入阿里云百炼的 API Key 和 Base URL 即可,无需配置环境变量。注意:如果你使用的是阿里云百炼的 Coding Plan 套餐,请使用该套餐专属的 API Key 和 Base URL。你可以使用文本编辑器打开该文件,或者在终端使用命令(如 macOS/Linux 下使用 nano ~/.claude/settings.json)。你可以直接用自然语言下达指令,例如:“帮我在这个目录下写一个 Python 脚本,实现两数之和的功能”。

hopsky的博客 1844

android gps机制分析--定位数据HAL处理

6 gps数据在HAL中处理 reportPosition的实现,前面提到的包含了position信息的qmiLocEventPositionReportIndMsgT_v02数据类型作为参数传入: 解析出qmiLocEventPositionReportIndMsgT_v02里的相应的数据,填充到UlpLocation结构中, 以下是经纬度,填充到UlpLocation l

Jack的博客 3082

实测!Gemini+ChatGPT赋能学术写作:我的论文写作SOP(附提示词)

各位同仁好,我是七哥。一个在高校里从事人工智能相关领域研究,钻研用大模型AI实操的学术人。可以和七哥交流学术写作或Gemini、GPT、Claude等大模型学术实操相关问题,多多交流,相互成就,共同进步。为什么ChatGPT逻辑清晰却写不长?为什么Gemini能深入分析但废话连篇?这其实是两种模型架构的本质差异,GPT系列擅长指令跟随和语言精炼,而Gemini原生支持超长上下文,适合深度文本生成。两者在深度生成与精炼表达上形成了天然互补。我们可以将它们组合起来使用发挥他们各自的特长。

智能AI让学术科研更容易 521
上一篇: Characteristics of a good team and team member
下一篇: 8 Things I learned from "High Performance MySQL"
AutoAsm
博客等级 码龄27年 27粉丝 20原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值