Class MedMScanner

java.lang.Object
com.medm.devicekit.MedMScanner

public class MedMScanner extends Object
MedM Scanner is where you search Bluetooth environment for new devices.
  • Method Details

    • 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 granted IErrorCallback.onPermissionsRequired(NotEnoughPermissionsException) is called.
      Returns:
      token to stop scanning for devices
    • start

      Deprecated.
      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.
      Parameters:
      callback - callback to receive discovered devices or notification that discovery was finished
      Returns:
      token to stop scanning for devices