Companion

object Companion

Properties

Link copied to clipboard

Scan period in milliseconds used when no time period is provided to start.

Link copied to clipboard

Scan period in milliseconds used when no time period is provided to start or scanForHardwareId.

Link copied to clipboard

List of specific permissions required for discovering and connecting to Nix devices via Bluetooth which can vary depending on Android version. This list provides the correct permissions for the version of Android seen at runtime.

Functions

Link copied to clipboard

Checks if the permissions necessary for accessing Bluetooth devices have been granted by the user. If false, these permissions can be requested using requestBluetoothPermissions.

Link copied to clipboard

Launches an new intent to request the user to enable Bluetooth. This requires that the necessary Bluetooth permissions have been granted.

Link copied to clipboard
fun requestBluetoothPermissions(activity: Activity?, requestCode: Int)

Wrapper around ActivityCompat.requestPermissions to request permissions from the user required for running a search for Bluetooth devices. Results of the request will be provided to your ActivityCompat.OnRequestPermissionsResultCallback.onRequestPermissionsResult callback in your activity. Before making the request, you can use isBluetoothPermissionGranted to check if these permissions have already been granted.

@RequiresApi(value = 23)
fun requestBluetoothPermissions(fragment: Fragment?, requestCode: Int)

Wrapper around Fragment.requestPermissions to request permissions from the user required for running a search for Bluetooth devices. Results of the request will be provided to your Fragment.onRequestPermissionsResult callback in your fragment. Before making the request, you can use isBluetoothPermissionGranted to check if these permissions have already been granted.