如何以编程方式找出载波信号强度 [英] How to find out carrier signal strength programmatically

查看:136
本文介绍了如何以编程方式找出载波信号强度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我用来找出载波信号强度的代码:

Here is the code that I have used to find out carrier signal strength:

int getSignalStrength()
{
    void *libHandle = dlopen("/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony", RTLD_LAZY);
    int (*CTGetSignalStrength)();
    CTGetSignalStrength = dlsym(libHandle, "CTGetSignalStrength");
    if( CTGetSignalStrength == NULL) NSLog(@"Could not find CTGetSignalStrength");
    int result = CTGetSignalStrength();
    dlclose(libHandle);
    return result;
}

它给我的值在60到100之间,但是当我通过调用此*3001#12345#*数字测试设备中的信号强度时,它显示为-65.下面附上了屏幕截图.来自getSignalStrength()的值是否准确?那么为什么总是返回正值呢?

It is giving me values between 60 to 100, but when I test the signal strength in device by calling to this *3001#12345#* number it showed me as -65. Below I have attached the screenshot. Is the value coming from getSignalStrength() accurate? Then why is it returning positive values always?

推荐答案

getSignalStrength()显示消极的dB衰减,例如-(-60)==60.呼入通常以小于零的度量显示它.是的,这些变化是典型的.即使在严格控制的条件下,您也可以得到+/- 20分贝.解决该问题的一种方法是随时间推移进行一系列测量,例如每秒进行一次,并保留最近10次左右测量的运行列表.然后报告均值或中位数或其他一些统计数据.以我的经验,这大大减少了变化.您还可以进行标准偏差以提供可靠性的度量.

getSignalStrength() is showing negated dB attenuation, e.g. -(-60) == 60. The call in is displaying it more conventionally as a measurement less than zero. Yes, these kinds of variations are typical. Even in strictly controlled conditions you can get +/- 20 decibels. One way you can fix it is to take a series of measurements over time, say every second, and keep a running list of the last 10 or so measurements. Then report the mean or median or some other statistic. In my experience this cuts down the variation a lot. You can also do standard deviation to provide a measure of reliability.

这篇关于如何以编程方式找出载波信号强度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆