Package com.zebra.bluetooth.btinsightlib
Class BtConnectionEvent
- java.lang.Object
-
- com.zebra.bluetooth.btinsightlib.BtConnectionEvent
-
- All Implemented Interfaces:
android.os.Parcelable
public class BtConnectionEvent extends java.lang.Object implements android.os.ParcelableClass that provides more information about connection status of remote device
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<BtConnectionEvent>CREATORprivate intmBondedStateprivate intmConnectionStateprivate java.lang.StringmDeviceMacprivate java.lang.StringmDeviceNameprivate java.lang.StringmLastConnectedAtprivate java.lang.StringmLastDisconnectedAtprivate intmLastDisconnectReasonprivate intmPeripheralTypeprivate java.lang.StringmSerialNumber
-
Constructor Summary
Constructors Constructor Description BtConnectionEvent()BtConnectionEvent(android.os.Parcel in)Creates object of this class using serializable data given as input.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()intgetBondedState()Get the bond status of remote device.intgetConnectionState()Get connection status of remote device.java.lang.StringgetDeviceMac()Get bluetooth MAC address of remote device.java.lang.StringgetDeviceName()Get the friendly name of remote devicejava.lang.StringgetLastConnectedAt()Get the timestamp of connected state w.r.t remote device during last time.java.lang.StringgetLastDisconnectedAt()Get the timestamp of disconnected state w.r.t remote device during last time.intgetLastDisconnectReason()Get reason for last disconnection w.r.t remote device.intgetPeripheralType()Get the type of remote peripheral connected to DUT.java.lang.StringgetSerialNumber()Get serial number of remote device.voidsetBondedState(int bondedState)Set the bond status of remote device.voidsetConnectionState(int state)Set connection status of remote device.voidsetDeviceMac(java.lang.String mac)Set bluetooth MAC address of remote device for reference in local DUTvoidsetDeviceName(java.lang.String name)Set friendly name of remote device for reference in local DUT See alsogetDeviceName()voidsetLastConnectedAt(java.lang.String lastConnectedAt)Set the timestamp of connected state w.r.t remote device during last time.voidsetLastDisconnectedAt(java.lang.String lastDisconnectedAt)Set the timestamp of disconnected state w.r.t remote device during last time.voidsetLastDisconnectReason(int lastDisconnectReason)Set reason for last disconnection w.r.t remote device.voidsetPeripheralType(int type)Set the type of remote peripheral connected to DUT.voidsetSerialNumber(java.lang.String serialNumber)Set serial number of remote device.java.lang.StringtoString()voidwriteToParcel(android.os.Parcel parcel, int i)
-
-
-
Field Detail
-
mDeviceName
private java.lang.String mDeviceName
-
mDeviceMac
private java.lang.String mDeviceMac
-
mLastConnectedAt
private java.lang.String mLastConnectedAt
-
mLastDisconnectedAt
private java.lang.String mLastDisconnectedAt
-
mLastDisconnectReason
private int mLastDisconnectReason
-
mConnectionState
private int mConnectionState
-
mBondedState
private int mBondedState
-
mSerialNumber
private java.lang.String mSerialNumber
-
mPeripheralType
private int mPeripheralType
-
CREATOR
public static final android.os.Parcelable.Creator<BtConnectionEvent> CREATOR
-
-
Method Detail
-
getPeripheralType
public int getPeripheralType()
Get the type of remote peripheral connected to DUT. This identification will be based on class of device that remote peripheral exhibits during discovery or connection process.- Returns:
- type of remote peripheral that is communicating with DUT.
See
BtInsightConstants.PeripheralType
-
setPeripheralType
public void setPeripheralType(int type)
Set the type of remote peripheral connected to DUT. SeegetPeripheralType()- Parameters:
type- type of remote peripheral
-
setDeviceName
public void setDeviceName(java.lang.String name)
Set friendly name of remote device for reference in local DUT See alsogetDeviceName()- Parameters:
name- name of remote device
-
getSerialNumber
public java.lang.String getSerialNumber()
Get serial number of remote device. Note: only legacy pairing devices' serial number would be valid and provided.- Returns:
- string format of remote device's serial number
-
setSerialNumber
public void setSerialNumber(java.lang.String serialNumber)
Set serial number of remote device. See alsogetSerialNumber()- Parameters:
serialNumber- string format of remote device's serial number
-
getDeviceName
public java.lang.String getDeviceName()
Get the friendly name of remote device- Returns:
- name of remote device
-
setDeviceMac
public void setDeviceMac(java.lang.String mac)
Set bluetooth MAC address of remote device for reference in local DUT- Parameters:
mac- address of remote device
-
getDeviceMac
public java.lang.String getDeviceMac()
Get bluetooth MAC address of remote device.- Returns:
- address of remote device
-
setConnectionState
public void setConnectionState(int state)
Set connection status of remote device. See alsoBtInsightConstants.ConnectionState- Parameters:
state- connection status of remote device
-
getConnectionState
public int getConnectionState()
Get connection status of remote device. See alsoBtInsightConstants.ConnectionState- Returns:
- connection status of remote device
-
setLastConnectedAt
public void setLastConnectedAt(java.lang.String lastConnectedAt)
Set the timestamp of connected state w.r.t remote device during last time. Remote device is identified viamDeviceMacormDeviceName.- Parameters:
lastConnectedAt- string format of timestamp of connected state last time
-
getLastConnectedAt
public java.lang.String getLastConnectedAt()
Get the timestamp of connected state w.r.t remote device during last time. Remote device is identified viamDeviceMacormDeviceName.- Returns:
- string format of timestamp of connected state last time
-
setLastDisconnectedAt
public void setLastDisconnectedAt(java.lang.String lastDisconnectedAt)
Set the timestamp of disconnected state w.r.t remote device during last time. Remote device is identified viamDeviceMacormDeviceName.- Parameters:
lastDisconnectedAt- string format of timestamp of disconnected state last time
-
getLastDisconnectedAt
public java.lang.String getLastDisconnectedAt()
Get the timestamp of disconnected state w.r.t remote device during last time. Remote device is identified viamDeviceMacormDeviceName.- Returns:
- string format of timestamp of disconnected state last time
-
getBondedState
public int getBondedState()
Get the bond status of remote device. See alsoBtInsightConstants.BondState- Returns:
- bond status of remote device
-
setBondedState
public void setBondedState(int bondedState)
Set the bond status of remote device. See alsoBtInsightConstants.BondState- Parameters:
bondedState- bond status of remote device
-
setLastDisconnectReason
public void setLastDisconnectReason(int lastDisconnectReason)
Set reason for last disconnection w.r.t remote device. Remote device is identified viamDeviceMacormDeviceName. See alsoBtInsightConstants.DisconnectionReason- Parameters:
lastDisconnectReason- reason for last disconnection
-
getLastDisconnectReason
public int getLastDisconnectReason()
Get reason for last disconnection w.r.t remote device. Remote device is identified viamDeviceMacormDeviceName. See alsoBtInsightConstants.DisconnectionReason- Returns:
- reason for last disconnection
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel parcel, int i)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
-