FileDocCategorySizeDatePackage
WifiActivityEnergyInfo.javaAPI DocAndroid 5.1 API4360Thu Mar 12 22:22:44 GMT 2015android.net.wifi

WifiActivityEnergyInfo

public final class WifiActivityEnergyInfo extends Object implements android.os.Parcelable
Record of energy and activity information from controller and underlying wifi stack state.Timestamp the record with system time
hide

Fields Summary
private final int
mStackState
private final int
mControllerTxTimeMs
private final int
mControllerRxTimeMs
private final int
mControllerIdleTimeMs
private final int
mControllerEnergyUsed
private final long
timestamp
public static final int
STACK_STATE_INVALID
public static final int
STACK_STATE_STATE_ACTIVE
public static final int
STACK_STATE_STATE_SCANNING
public static final int
STACK_STATE_STATE_IDLE
public static final Parcelable.Creator
CREATOR
Constructors Summary
public WifiActivityEnergyInfo(int stackState, int txTime, int rxTime, int idleTime, int energyUsed)


          
                                      
        mStackState = stackState;
        mControllerTxTimeMs = txTime;
        mControllerRxTimeMs = rxTime;
        mControllerIdleTimeMs = idleTime;
        mControllerEnergyUsed = energyUsed;
        timestamp = System.currentTimeMillis();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public intgetControllerEnergyUsed()
product of current(mA), voltage(V) and time(ms)

return
energy used

        return mControllerEnergyUsed;
    
public intgetControllerIdleTimeMillis()

return
idle time in ms

        return (int)mControllerIdleTimeMs;
    
public intgetControllerRxTimeMillis()

return
rx time in ms

        return (int)mControllerRxTimeMs;
    
public intgetControllerTxTimeMillis()

return
tx time in ms

        return (int)mControllerTxTimeMs;
    
public intgetStackState()

return
bt stack reported state

        return mStackState;
    
public longgetTimeStamp()

return
timestamp(wall clock) of record creation

        return timestamp;
    
public booleanisValid()

return
if the record is valid

        return ((getControllerTxTimeMillis() !=0) ||
                (getControllerRxTimeMillis() !=0) ||
                (getControllerIdleTimeMillis() !=0));
    
public java.lang.StringtoString()

        return "WifiActivityEnergyInfo{"
            + " timestamp=" + timestamp
            + " mStackState=" + mStackState
            + " mControllerTxTimeMs=" + mControllerTxTimeMs
            + " mControllerRxTimeMs=" + mControllerRxTimeMs
            + " mControllerIdleTimeMs=" + mControllerIdleTimeMs
            + " mControllerEnergyUsed=" + mControllerEnergyUsed
            + " }";
    
public voidwriteToParcel(android.os.Parcel out, int flags)


          
        out.writeInt(mStackState);
        out.writeInt(mControllerTxTimeMs);
        out.writeInt(mControllerRxTimeMs);
        out.writeInt(mControllerIdleTimeMs);
        out.writeInt(mControllerEnergyUsed);