當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。