Package com.medm.devicekit
Class MedMScanner
- java.lang.Object
-
- com.medm.devicekit.MedMScanner
-
public class MedMScanner extends java.lang.Object
MedM Scanner is where you search Bluetooth environment for new devices.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MedMScanner
setCallback(IScannerCallback callback)
MedMScanner
setErrorCallback(IErrorCallback callback)
ScannerStopToken
start()
Start scan for bluetooth devices.ScannerStopToken
start(IScannerCallback callback)
Deprecated.UsesetCallback(IScannerCallback)
andstart()
instead
-
-
-
Method Detail
-
setCallback
public MedMScanner setCallback(IScannerCallback callback)
- Parameters:
callback
- callback to receive discovered devices or notification that discovery was finished- Returns:
- this scanner instance
-
setErrorCallback
public MedMScanner setErrorCallback(IErrorCallback callback)
- Parameters:
callback
- callback to receive errors- Returns:
- this scanner instance
-
start
public ScannerStopToken start()
Start scan for bluetooth devices. Note that scanner will not filter already found devices. Bluetooth scan requires ACCESS_COARSE_LOCATION on Android 6-11, ACCESS_FINE_LOCATION on Android 10-11, and ACCESS_BACKGROUND_LOCATION if the app is currently in the background on Android 10-11. It also requires location services to be enabled on Android 6-11. On Android 12+ it requires BLUETOOTH_SCAN permission. The SDK also needs BLUETOOTH_CONNECT, so it's a good idea to request both at the same time. If some of required permissions aren't grantedIErrorCallback.onPermissionsRequired(NotEnoughPermissionsException)
is called.- Returns:
- token to stop scanning for devices
-
start
@Deprecated public ScannerStopToken start(IScannerCallback callback)
Deprecated.UsesetCallback(IScannerCallback)
andstart()
insteadStart scan for bluetooth devices. Note that scanner will not filter already found devices. Bluetooth scan requires ACCESS_COARSE_LOCATION on Android 6-11, ACCESS_FINE_LOCATION on Android 10-11, and ACCESS_BACKGROUND_LOCATION if the app is currently in the background on Android 10-11. It also requires location services to be enabled on Android 6-11. On Android 12+ it requires BLUETOOTH_SCAN permission. The SDK also needs BLUETOOTH_CONNECT, so it's a good idea to request both at the same time.- Parameters:
callback
- callback to receive discovered devices or notification that discovery was finished- Returns:
- token to stop scanning for devices
-
-