📄 smsdeviceinfo.java
字号:
//
package edu.soft.buaa.message.sms;
/**
*/
public class SMSDeviceInfo
{
protected String manufacturer;
protected String model;
protected String serialNo;
protected String imsi;
protected String swVersion;
protected int batteryLevel;
protected int signalLevel;
protected CStatistics statistics;
/**
Returns the manufacturer of the device.
@return the manufacturer of the device.
*/
public String getManufacturer() { return manufacturer; }
/**
Returns the model of the device.
@return the model of the device.
*/
public String getModel() { return model; }
/**
Returns the serial no of the device.
@return the serial no of the device.
*/
public String getSerialNo() { return serialNo; }
/**
Returns the IMSI (International Mobile Subscriber Identity) of the device.
This information depends on the device and/or the smartcard and is not
always available.
@return the IMSI of the device.
*/
public String getImsi() { return imsi; }
/**
Returns the software version of the device.
@return the software version of the device.
*/
public String getSwVersion() { return swVersion; }
/**
Returns the battery level of the device. A value of 100 means fully
charged battery. A value of 0 means empty battery.
@return the battery level of the device.
*/
public int getBatteryLevel() { return batteryLevel; }
/**
Returns the signal status of the device. A value of 100 means full signal.
A value of 0 means no signal.
<br>
<strong>
Note: the scale is logarithmic, not linear!
</strong>
@return the signal status of the device.
*/
public int getSignalLevel() { return signalLevel; }
/**
Returns the statistics object which keeps statistics for incoming /
outgoing messages.
@return a CStatistics objects.
*/
public CStatistics getStatistics() { return statistics; }
/**
Default constructor of the class.
*/
public SMSDeviceInfo()
{
manufacturer = "";
model = "";
serialNo = "";
imsi = "";
swVersion = "";
batteryLevel = 0;
signalLevel = 0;
statistics = new CStatistics();
}
/**
This subclass keeps counters for incoming / outgoing messages.
@see SMSService#refreshDeviceInfo()
@see SMSService#getDeviceInfo()
*/
public class CStatistics
{
protected int totalIn;
protected int totalOut;
/**
Default constructor of the class.
*/
public CStatistics()
{
totalIn = 0;
totalOut = 0;
}
/**
Returns the total number of incoming messages processed
by jSMSEngine.
@return the number of incoming messages.
*/
public int getTotalIn() { return totalIn; }
/**
Returns the total number of outgoing messages dispatched
by jSMSEngine.
@return the number of outgoing messages.
*/
public int getTotalOut() { return totalOut; }
protected void incTotalIn() { totalIn ++; }
protected void incTotalOut() { totalOut ++;}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -