Package com.android.identity
Class ConnectionMethodBle
- java.lang.Object
-
- com.android.identity.ConnectionMethod
-
- com.android.identity.ConnectionMethodBle
-
public class ConnectionMethodBle extends ConnectionMethod
Connection method for BLE.
-
-
Constructor Summary
Constructors Constructor Description ConnectionMethodBle(boolean supportsPeripheralServerMode, boolean supportsCentralClientMode, java.util.UUID peripheralServerModeUuid, java.util.UUID centralClientModeUuid)
Creates a new connection method for BLE.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataTransport
createDataTransport(android.content.Context context, int role, DataTransportOptions options)
Creates a newDataTransport
-derived instance for the given type ofConnectionMethod
.java.util.UUID
getCentralClientModeUuid()
Gets the UUID used for mdoc central client mode, if any.java.util.UUID
getPeripheralServerModeUuid()
Gets the UUID used for mdoc peripheral server mode, if any.boolean
getSupportsCentralClientMode()
Gets whether the connection method indicates that mdoc central client mode is enabled.boolean
getSupportsPeripheralServerMode()
Gets whether the connection method indicates that mdoc peripheral server mode is enabled.java.lang.String
toString()
-
Methods inherited from class com.android.identity.ConnectionMethod
combine, disambiguate
-
-
-
-
Constructor Detail
-
ConnectionMethodBle
public ConnectionMethodBle(boolean supportsPeripheralServerMode, boolean supportsCentralClientMode, @Nullable java.util.UUID peripheralServerModeUuid, @Nullable java.util.UUID centralClientModeUuid)
Creates a new connection method for BLE.- Parameters:
supportsPeripheralServerMode
- whether mdoc peripheral mode is supported.supportsCentralClientMode
- whether mdoc central client mode is supported.peripheralServerModeUuid
- the UUID to use for mdoc peripheral server mode.centralClientModeUuid
- the UUID to use for mdoc central client mode.
-
-
Method Detail
-
getSupportsPeripheralServerMode
public boolean getSupportsPeripheralServerMode()
Gets whether the connection method indicates that mdoc peripheral server mode is enabled.- Returns:
- the value.
-
getSupportsCentralClientMode
public boolean getSupportsCentralClientMode()
Gets whether the connection method indicates that mdoc central client mode is enabled.- Returns:
- the value.
-
getPeripheralServerModeUuid
@Nullable public java.util.UUID getPeripheralServerModeUuid()
Gets the UUID used for mdoc peripheral server mode, if any.- Returns:
- the value or
null
.
-
getCentralClientModeUuid
@Nullable public java.util.UUID getCentralClientModeUuid()
Gets the UUID used for mdoc central client mode, if any.- Returns:
- the value or
null
.
-
createDataTransport
@NonNull public DataTransport createDataTransport(@NonNull android.content.Context context, int role, @NonNull DataTransportOptions options)
Description copied from class:ConnectionMethod
Creates a newDataTransport
-derived instance for the given type ofConnectionMethod
.- Specified by:
createDataTransport
in classConnectionMethod
- Parameters:
context
- application context.role
- whether the transport will be used by the mdoc or mdoc reader.options
- options for configuring the created instance.- Returns:
- A
DataTransport
-derived instance configured with the given options.
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-