Understanding Android GPS HAL Driver

android9:GPS模块-源码调用流程 参考文章:https://blog.csdn.net/grekit_sun/article/details/109469351 参考:https://blog.csdn.net/pangsurong/article/details/73912714?utm_medium=distribute.pc_relevant.none-task-blog-title-11&spm=1001.2101.3001.4242 参考:https://blog.csdn.net/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热点的位置然后访...

四季帆的博客 5037

高通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相关配置。...

四季帆的博客 2476

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

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

zslzsl999的专栏 8960

Android 的定位分层架构

Android GPS

Jun_P的博客 2494

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

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

闲云野鹤话IT -- Enjoy IT 7501

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的专栏 3292

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

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

weixin_49199313的博客 645

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的专栏 2819

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 7212

手把手教你用TP4056和PMOS管搭建锂电池自动切换电路(含元器件选型指南)

本文详细介绍了如何使用TP4056和PMOS管搭建锂电池自动切换电路,包括核心架构设计、元器件选型指南和PCB布局优化。通过智能充电算法和电源路径切换模块,实现外部供电与锂电池的无缝切换,提升便携式设备的电源管理效率。

julia4scientist的博客 904

统信UOS V20 安装mysql5.7.42详细教程

到bin/下,执行下面的命令,初始化mysql服务信息,得到数据库的初始密码,实际如果目录不一样记得换成自己的目录。下载后通过远程将安装包上传至服务器,我这里将安装包上传至/usr/local/mysql 下。ps:这时候如果还是不能远程访问的话,可能是防火墙的原因,命令行执行以下命令即可。再次登录,发现缺少 libtinfo.so.5文件,再次建立软连接。登录,发现报错,提示缺少libncurses.so.5文件,使用。创建 /var/lib/ 下mysql目录。登录成功,修改密码,设置远程访问。

为谁伫立在风中 1万+

Android系统的HAL层分析 -- GPS

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

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

UE4项目迁移指南:如何无缝导入外部.uasset文件并保持材质关联

本文详细解析了将外部.uasset文件无缝导入UE4项目的专业方法。针对手动复制文件时常见的材质关联丢失问题,提供了使用引用查看器进行诊断和修复的实用技巧,并推荐使用引擎内置的“迁移”功能确保资源依赖关系的完整性,帮助开发者高效整合项目资源。

t8u9v0的博客 1051

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

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

东月之神 2万+

【3D目标检测】环境搭建(OpenPCDet、MMdetection3d、Det3d)

在Conda虚拟环境中搭建MMdetection3d环境

qq_44703886的博客 4262

基于Simulink的PID控制防抱死制动系统(ABS)建模与仿真

防抱死制动系统(Anti-lock Braking System,简称ABS)是一种用于防止车辆在紧急制动时车轮完全抱死的技术。通过实时监测车轮速度并调节制动力,ABS能够显著提高车辆的制动性能和操控稳定性,从而减少交通事故的发生。PID(比例-积分-微分)控制器因其结构简单、性能稳定且易于实现而被广泛应用于ABS控制系统中。本项目旨在通过MATLAB/Simulink平台设计和验证一个基于PID控制的ABS系统,重点研究PID参数调优方法、系统动态响应特性以及制动过程中的滑移率控制能力。

MHD0815的博客 488

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

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

Jack的博客 3083

【思考模型框架】MECE原则,确保分析时,考虑到的所有因素,既不重叠又无遗漏

MECE原则,是Mutually Exclusive and Collectively Exhaustive的缩写,中文译为“相互独立、完全穷尽”。MECE原则,这是一种逻辑思维和组织信息的方法,旨在确保分析时既没有遗漏也没有重复。MECE原则,相互独立、完全穷尽(Mutually Exclusive,Collectively Exhaustive)的原则MECE原则,确保分析时考虑到的所有因素既不重叠又无遗漏。

奶爸的编程之路,也就一周冷个三天 2765
上一篇: 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、付费专栏及课程。

余额充值
⌂ 换网址