当前位置: 首页>>代码示例>>Java>>正文


Java NeighboringCellInfo.UNKNOWN_RSSI属性代码示例

本文整理汇总了Java中android.telephony.NeighboringCellInfo.UNKNOWN_RSSI属性的典型用法代码示例。如果您正苦于以下问题:Java NeighboringCellInfo.UNKNOWN_RSSI属性的具体用法?Java NeighboringCellInfo.UNKNOWN_RSSI怎么用?Java NeighboringCellInfo.UNKNOWN_RSSI使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.telephony.NeighboringCellInfo的用法示例。


在下文中一共展示了NeighboringCellInfo.UNKNOWN_RSSI属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSignalStrengthsChanged

/**
 *  Description:  TODO: add more info
 *
 *  Issues:
 *
 *      [ ]     Getting and comparing signal strengths between different RATs can be very
 *              tricky, since they all return different ranges of values. AOS doesn't
 *              specify very clearly what exactly is returned, even though people have
 *              a good idea, by trial and error.
 *
 *              See note in : SignalStrengthTracker.java
 *
 *  Notes:
 *
 *
 *
 */
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
    // Update Signal Strength
    if (signalStrength.isGsm()) {
        int dbm;
        if (signalStrength.getGsmSignalStrength() <= 2 ||
                signalStrength.getGsmSignalStrength() == NeighboringCellInfo.UNKNOWN_RSSI) {
            // Unknown signal strength, get it another way
            String[] bits = signalStrength.toString().split(" ");
            dbm = Integer.parseInt(bits[9]);
        } else {
            dbm = signalStrength.getGsmSignalStrength();
        }
        mDevice.setSignalDbm(dbm);
    } else {
        int evdoDbm = signalStrength.getEvdoDbm();
        int cdmaDbm = signalStrength.getCdmaDbm();

        // Use lowest signal to be conservative
        mDevice.setSignalDbm((cdmaDbm < evdoDbm) ? cdmaDbm : evdoDbm);
    }
    // Send it to signal tracker
    signalStrengthTracker.registerSignalStrength(mDevice.mCell.getCID(), mDevice.getSignalDBm());
    //signalStrengthTracker.isMysterious(mDevice.mCell.getCID(), mDevice.getSignalDBm());
}
 
开发者ID:5GSD,项目名称:AIMSICDL,代码行数:41,代码来源:CellTracker.java

示例2: onSignalStrengthsChanged

/**
 *  Description:  TODO: add more info
 *
 *  Issues:
 *
 *      [ ]     Getting and comparing signal strengths between different RATs can be very
 *              tricky, since they all return different ranges of values. AOS doesn't
 *              specify very clearly what exactly is returned, even though people have
 *              a good idea, by trial and error.
 *
 *              See note in : SignalStrengthTracker.java
 */
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
    // Update Signal Strength
    if (signalStrength.isGsm()) {
        int dbm;
        if (signalStrength.getGsmSignalStrength() <= 2 ||
                signalStrength.getGsmSignalStrength() == NeighboringCellInfo.UNKNOWN_RSSI) {
            // Unknown signal strength, get it another way
            String[] bits = signalStrength.toString().split(" ");
            dbm = Integer.parseInt(bits[9]);
        } else {
            dbm = signalStrength.getGsmSignalStrength();
        }
        device.setSignalDbm(dbm);
    } else {
        int evdoDbm = signalStrength.getEvdoDbm();
        int cdmaDbm = signalStrength.getCdmaDbm();

        // Use lowest signal to be conservative
        device.setSignalDbm((cdmaDbm < evdoDbm) ? cdmaDbm : evdoDbm);
    }
    // Send it to signal tracker
    signalStrengthTracker.registerSignalStrength(device.cell.getCellId(), device.getSignalDBm());
    //signalStrengthTracker.isMysterious(device.cell.getCid(), device.getSignalDBm());
}
 
开发者ID:anticomarley,项目名称:Android-IMSI-Catcher-Detector,代码行数:36,代码来源:CellTracker.java

示例3: convertGsmDbmToAsu

public static int convertGsmDbmToAsu(int dbm) {
    if (dbm == Measurement.UNKNOWN_SIGNAL || dbm == NeighboringCellInfo.UNKNOWN_RSSI)
        return Measurement.UNKNOWN_SIGNAL;
    if (dbm <= -113)
        return 0;
    int asu = (dbm + 113) / 2;
    if (asu > 31)
        return 31;
    return asu;
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:10,代码来源:UnitConverter.java

示例4: convertLteAsuToDbm

public static int convertLteAsuToDbm(int asu) {
    if (asu == Measurement.UNKNOWN_SIGNAL || asu == NeighboringCellInfo.UNKNOWN_RSSI)
        return Measurement.UNKNOWN_SIGNAL;
    if (asu <= 0)
        return -140;
    if (asu >= 97)
        return -43;
    return asu - 140;
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:9,代码来源:UnitConverter.java

示例5: convertLteDbmToAsu

public static int convertLteDbmToAsu(int dbm) {
    if (dbm == Measurement.UNKNOWN_SIGNAL || dbm == NeighboringCellInfo.UNKNOWN_RSSI)
        return Measurement.UNKNOWN_SIGNAL;
    if (dbm <= -140)
        return 0;
    if (dbm >= -43)
        return 97;
    return dbm + 140;
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:9,代码来源:UnitConverter.java

示例6: convertCdmaAsuToDbm

public static int convertCdmaAsuToDbm(int asu) {
    if (asu == Measurement.UNKNOWN_SIGNAL || asu == NeighboringCellInfo.UNKNOWN_RSSI)
        return Measurement.UNKNOWN_SIGNAL;
    if (asu == 16)
        return -75;
    else if (asu == 8)
        return -82;
    else if (asu == 4)
        return -90;
    else if (asu == 2)
        return -95;
    else if (asu == 1)
        return -100;
    return Measurement.UNKNOWN_SIGNAL;
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:15,代码来源:UnitConverter.java

示例7: updateGsm

private void updateGsm(Measurement m, int asu) {
    Log.d("update(): Updating GSM signal strength = %s", asu);
    if (asu == NeighboringCellInfo.UNKNOWN_RSSI)
        asu = Measurement.UNKNOWN_SIGNAL;
    m.setGsmLocationSignal(asu, UnitConverter.convertGsmAsuToDbm(asu));
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:6,代码来源:CellLocationSignalConverter.java

示例8: updateLte

private void updateLte(Measurement m, int dbm) {
    Log.d("update(): Updating LTE signal strength = %s", dbm);
    if (dbm == NeighboringCellInfo.UNKNOWN_RSSI)
        dbm = Measurement.UNKNOWN_SIGNAL;
    m.setGsmLocationSignal(UnitConverter.convertLteDbmToAsu(dbm), dbm);
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:6,代码来源:CellLocationSignalConverter.java

示例9: convertGsmAsuToDbm

public static int convertGsmAsuToDbm(int asu) {
    if (asu == Measurement.UNKNOWN_SIGNAL || asu == NeighboringCellInfo.UNKNOWN_RSSI)
        return Measurement.UNKNOWN_SIGNAL;
    return 2 * asu - 113;
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:5,代码来源:UnitConverter.java


注:本文中的android.telephony.NeighboringCellInfo.UNKNOWN_RSSI属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。