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

超详细!思岚S2激光雷达hector_mapping建图

使用思岚S2激光雷达,在ros平台上利用hector_mapping功能包实现建图功能

m0_50965539的博客 5591

Parrot OS最新安装教程

Parrot OS和Kali Linux一样是一个基于 Debian 的免费开源 Linux 发行版,适合安全专家、开发人员、以及关心隐私的人。相较于Kali,Parrot OS属于轻量级,对于硬件的要求无需很高,目前版本已更新到6.3。通过按照本教程的方法,能够成功安装Parrot OS。

🦸💻冰草花生酱提醒您“请记得检查所有电子设备的最后登录时间哦⏰🔍” 4417

Android系统的HAL层分析 -- GPS

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

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

别再乱提MR了!手把手教你配置GitLab的CI/CD与分支保护规则,让团队协作更丝滑

本文详细介绍了如何配置GitLab的CI/CD与分支保护规则,以优化团队协作流程。通过设置Protected Branches、MR流水线检查和自动化审批规则,有效防止不规范操作和合并冲突,提升开发效率与代码质量。特别强调MR(Merge Request)的正确使用,确保团队协作更丝滑。

weixin_28840591的博客 234

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

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

东月之神 2万+

Vue3实战:集成bpmn-js与Activiti工作流引擎的完整指南

本文详细介绍了如何在Vue3项目中集成bpmn-js流程图编辑器与Activiti工作流引擎,构建一个完整的前端流程设计器。文章重点解析了Vue3响应式系统与bpmn-js集成的核心陷阱及解决方案,并提供了属性面板配置、XML命名空间适配、撤销重做等实用功能的完整实现指南,帮助开发者高效完成工作流系统的前端开发。

weixin_29009881的博客 212

01. VBA从入门到精通——录制宏、窗口、快捷键

excel表功能区右击→常用→选择显示开发工具选项→确定Visual Basic:打开VBA窗口宏:查看要录制的宏录制宏:准备录制宏使用相对引用:录制宏的时候对单元格的引用做一个设置宏安全性:对宏的使用做安全设置,一般设置为禁用所有宏,并发出通知,此时打开带有宏代码的工作薄时会出现警告标记,如果宏可信就选择启动。

weixin_43812198的博客 1696

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

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

Jack的博客 3082

uniapp [安卓苹果App端] - 详细实现PDF预览功能在线预览PDF文档,Uniapp App端实现pdf文件预览在线预览pdf二进制文件流、本地pdf文档、PDF文件地址url路径(解决白屏

uni-app,安卓Android,苹果ios,安卓app端,苹果App端,uniapp苹果安卓app,uniapp在线预览pdf功能,在安卓苹果app平台实现PDF的预览查看,uniappApp端实现pdf文件预览,UNIAPP在线预览PDF文档,Uniappapp在线预览pdf文件流,从后端接口里获取pdf文件如何转成链接预览,预览pdf的插件,uni-app的pdf预览功能,uniapp使用pdf.js插件预览pdf文件,预览pdf白屏没有报错,打开后没反应,打开是空白,加载PDF时发生错误,如

🏆 前端领域优质创作者 1万+
上一篇: 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、付费专栏及课程。

余额充值