




已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
基本函数微软只将RIL提供给设备开发商进行开发,并不公开!很多手机里都没有ril.dll。我们用的多普达手机里有。开始想通过RIL_GetCellTowerInfo结构体得到dwRxQuality,但是发现从手机里得到的是值0。可见,此款手机并没有将RIL_GetCellTowerInfo这个结构体填充完,只是真充了几个数据。后来查询得知,RIL中有一专门的结构体RILSIGNALQUALITY用来接收信号强度的信息。这样才成功了!程序中要包含以下文件:#include ril.h#pragma comment(lib, ril.lib)还有几点重要的:SignalQuality=RIL_GetSignalQuality(hRil);/获取基站信号强度在没有SIM卡时,返回值大概为50多,有SIM卡时为五百到六百而且,还是会调用回调函数。也就是说,无SIM卡,手机的信号质量一样可以测但是CellTowerInfo= RIL_GetCellTowerInfo(hRil);/获取基站信息这个函数却不一样。无SIM卡时,返回值为50多。但不会调用回调函数HRESULT RIL_Initialize( DWORD dwIndex, RILRESULTCALLBACK pfnResult, RILNOTIFYCALLBACK pfnNotify, DWORD dwNotificationClasses, DWORD dwParam, HRIL* lphRil);This function initializes RIL for use by a client.The function returns the following values:Value Description S_OK The driver is up and radio is present.S_FALSE The driver is still waiting for radio presence.E_XXX The call to initialize the driver has failed. HRESULT RIL_GetCellTowerInfo( HRIL hRil);This function retrieves information about the cell tower currently used by the phone.Positive HRESULT values indicate success and are used as command identifications for matching the asynchronous call result. Negative HRESULT values indicate an error. Errors are defined in the Ril.h file. An asynchronous result of RIL_RESULT_OK indicates success. The lpData notification parameter points to a RILCELLTOWERINFO structure.HRESULT RIL_Deinitialize( HRIL hRil);This function deinitializes RIL.An HRESULT value of S_OK indicates success. HRESULT values of E_XXX indicate an error. Errors are defined in the winerror.h file. typedef void (CALLBACK *RILRESULTCALLBACK)( DWORD dwCode, / Specifies the result code. HRESULT hrCmdID, / ID returned by the command that originated this response const void* lpData, / data associated with the notification DWORD cbData, / size of the strcuture pointed to lpData DWORD dwParam /Specifies the parameter passed to );This callback function is called to send a return value after an asynchronous RIL function call.typedef struct rilsignalquality_tag DWORD cbSize; / field structure size in bytes DWORD dwParams; / field indicates valid parameters int nSignalStrength; / field TBD int nMinSignalStrength; / field TBD int nMaxSignalStrength; / field TBD DWORD dwBitErrorRate; / field bit error rate in 1/100 of a percent int nLowSignalStrength; / field TBD int nHighSignalStrength; / field TBD RILSIGNALQUALITY, *LPRILSIGNALQUALITY;cbSize Structure size, in bytes.dwParams Specifies valid parameters. Must be one or a combination of the RILSIGNALQUALITY parameter constants. nSignalStrength Specifies the signal strength.nMinSignalStrength Specifies the minimum signal strength.nMaxSignalStrength Specifies the maximum signal strength.dwBitErrorRate Bit error rate in 1/100 of a percent. Must be one of the bit error rate constants. nLowSignalStrength Indicates a low signal strength.nHighSignalStrength Indicates a high signal strength.其中最感興趣的部份就是 nSignalStrength, nMinSignalStrength and nMaxSignalStrength一般而言 nMinSignalStrength = -113 而 nMaxSignalStrength = -51, nSignalStrength 就介於這之間.而 Shell 或其它 App 取得這些 Data 後可以再把它轉換成 0 - 100 之間的線性變化, 也就是 Percent = (nSignalStrength - nMinSignalStrength )/(nSignalStrength - nMaxSignalStrength)反之有 percentage 也可以再逆算回來, 只是這些 value 可能也不是真的 calibration 過, 所以也不一定那麼準就是了.单位dBm!无线信号多为mW级别,小于1,取对数就会负了。如信号强度为0.05mw,10Log(0.05)=13概念辨析:dBm, dBi, dBd, dB, dBc, dBuV 1、 dBmdBm是一个考征功率绝对值的值,计算公式为:10lgP(功率值/1mw)。例1 如果发射功率P为1mw,折算为dBm后为0dBm。例2 对于40W的功率,按dBm单位进行折算后的值应为:10lg(40W/1mw)=10lg(40000)=10lg4+10lg10+10lg1000=46dBm。2、dBi 和dBddBi和dBd是考征增益的值(功率增益),两者都是一个相对值, 但参考基准不一样。dBi的参考基准为全方向性天线,dBd的参考基准为偶极子,所以两者略有不同。一般认为,表示同一个增益,用dBi表示出来比用dBd表示出来要大2. 15。例3 对于一面增益为16dBd的天线,其增益折算成单位为dBi时,则为18.15dBi(一般忽略小数位,为18dBi)。例4 0dBd=2.15dBi。例5 GSM900天线增益可以为13dBd(15dBi),GSM1800天线增益可以为15dBd(17dBi)。3、dBdB是一个表征相对值的值,当考虑甲的功率相比于乙功率大或小多少个dB时,按下面计算公式:10lg(甲功率/乙功率)例6 甲功率比乙功率大一倍,那么10lg(甲功率/乙功率)=10lg2=3dB。也就是说,甲的功率比乙的功率大3 dB。例7 7/8 英寸GSM900馈线的100米传输损耗约为3.9dB。例8 如果甲的功率为46dBm,乙的功率为40dBm,则可以说,甲比乙大6 dB。例9 如果甲天线为12dBd,乙天线为14dBd,可以说甲比乙小2 dB。4、dBc有时也会看到dBc,它也是一个表示功率相对值的单位,与dB的计算方法完全一样。一般来说,dBc 是相对于载波(Carrier)功率而言,在许多情况下,用来度量与载波功率的相对值,如用来度量干扰(同频干扰、互调干扰、交调干扰、带外干扰等)以及耦合、杂散等的相对量值。 在采用dBc的地方,原则上也可以使用dB替代。5、dBuV根据功率与电平之间的基本公式V2=P*R,可知 dBuV=90+dBm+10*log(R),R为电阻值。载PHS系统中正确应该是dBm=dBuv-107,因为其天馈阻抗为50欧。6、dBuVemf 和dBuVemf:electromotive force(电动势) 对于一个信号源来讲,dBuVemf是指开路时的端口电压,dBuV是接匹配负载时的端口电压DWORD dwMobileCountryCode; DWORD dwLocationAreaCode; typedef struct rilcelltowerinfo_tag DWORD cbSize; / field structure size in bytes DWORD dwParams; / field indicates valid parameters DWORD dwMobileCountryCode; / field TBD DWORD dwMobileNetworkCode; / field TBD DWORD dwLocationAreaCode; / field TBD DWORD dwCellID; / field TBD DWORD dwBaseStationID; / field TBD DWORD dwBroadcastControlChannel; / field TBD DWORD dwRxLevel; / field Value from 0-63 (see GSM 05.08, 8.1.4) DWORD dwRxLevelFull; / field Value from 0-63 (see GSM 05.08, 8.1.4) DWORD dwRxLevelSub; / field Value from 0-63 (see GSM 05.08, 8.1.4) DWORD dwRxQuality; / field Value from 0-7 (see GSM 05.08, 8.2.4) DWORD dwRxQualityFull; / field Value from 0-7 (see GSM 05.08, 8.2.4) DWORD dwRxQualitySub; / field Value from 0-7 (see GSM 05.08, 8.2.4) DWORD dwIdleTimeSlot; / field TBD DWORD dwTimingAdvance; / field TBD DWORD dwGPRSCellID; / field TBD DWORD dwGPRSBaseStationID; / field TBD DWORD dwNumBCCH; / field TBD BYTE rgbBCCHMAXLENGTH_BCCH; / field TBD BYTE rgbNMRMAXLENGTH_NMR; / field TBD RILCELLTOWERINFO, *LPRILCELLTOWERINFO;cbSize Structure size, in bytes.dwParams Specifies valid parameters. Must be one or a combination of the RILCELLTOWERINFO parameter constants. dwMobileCountryCode Specifies the country/region code.dwMobileNetworkCode Specifies the code of the mobile network.dwLocationAreaCode Specifies the area code of the current location.dwCellID Specifies the ID of the cellular tower.dwBaseStationID Specifies the ID of the base station.dwBroadcastControlChannel Specifies the Broadcast Control Channel (BCCH).dwRxLevel Specifies the received signal level.dwRxLevelFull Specifies the receiv
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 健康管理基础知识培训课件
- 便秘的西医治疗课件
- 广西钦州市第十三中学2025-2026学年高二上学期第一周考试历史试卷(含答案)
- 2025年全国中医类别医师资格定期考核理论试题及答案
- 企业电焊工安全培训总结课件
- 企业春节节前安全培训课件
- 网络餐饮管理办法评价
- 2025年中医内科试题及答案
- 新疆维吾尔自治区高级导游等级考试(导游综合知识)考前冲刺试题及答案(2025年)
- 紧急冲淋、洗眼器操作规程
- 智能传感器与传感器系统
- 数字媒体艺术概论
- 腹部触诊肛门直肠外生殖器
- 《抗病育种》课件
- 汽车吊装t梁施工方案(终)
- 《水循环》-完整版课件
- 轮胎印痕分析与运用课件
- 库房温湿度记录表
- 小学生天然气安全知识
- 10KV电力安全工器具试验报告
- 6、crm管理制度客户冲突管理
评论
0/150
提交评论