Class MedMCollector

java.lang.Object
com.medm.devicekit.MedMCollector

public class MedMCollector extends Object
MedM Collector is where you receive data from controlled devices.
  • Method Details

    • setDataCallback

      public MedMCollector setDataCallback(IDataCallback callback)
      Parameters:
      callback - callback to receive data in XML format
      Returns:
      this collector instance
    • setDeviceStatusCallback

      public MedMCollector setDeviceStatusCallback(IDeviceStatusCallback callback)
      Parameters:
      callback - callback to receive device status (connected/disconnected/etc).
      Returns:
      this collector instance
    • setAddDeviceCallback

      public MedMCollector setAddDeviceCallback(IAddDeviceCallback callback)
      Parameters:
      callback - callback to receive results of postponed adding
      Returns:
      this collector instance
      See Also:
    • setErrorCallback

      public MedMCollector setErrorCallback(IErrorCallback callback)
      Parameters:
      callback - callback to receive errors
      Returns:
      this collector instance
    • setDeviceFilter

      public MedMCollector setDeviceFilter(IDeviceDescription[] deviceFilter)
      Parameters:
      deviceFilter - devices to receive data from
      Returns:
      this collector instance
    • getDeviceFilter

      public IDeviceDescription[] getDeviceFilter()
      Returns:
      current device filter
    • start

      public CollectorStopToken start()
      Start receiving data from added devices. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time.
      Returns:
      token to stop data collection
    • startWithPostponedAdding

      public CollectorStopToken startWithPostponedAdding()
      Start receiving data from added devices and add devices via postponed adding. Calling this method will result in starting bluetooth scan which requires ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION on Android 10+ and ACCESS_BACKGROUND_LOCATION if the app is currently in background. It also requires location services to be enabled on Android 6-11. On Android 12+ it requires BLUETOOTH_SCAN and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time. Postponed adding feature is available only for specific licences. Make sure that your license includes it.
      Returns:
      token to stop data collection
      Throws:
      FeatureUnsupportedException - if the license doesn't include postponed pairing
    • start

      @Deprecated public CollectorStopToken start(IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback)
      Start receiving data from added devices. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time.
      Parameters:
      dataCallback - callback to receive data in XML format
      deviceStatusCallback - callback to receive device status (connected/disconnected/etc).
      Returns:
      token to stop data collection
    • start

      @Deprecated public CollectorStopToken start(IDeviceDescription device, IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback)
      Start receiving data from specific device or try to add it via postponed adding. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time. Postponed adding feature is available only for specific licences. Make sure that your license includes it.
      Parameters:
      device - device to receive data from
      dataCallback - callback to receive data in XML format
      deviceStatusCallback - callback to receive device status (connected/disconnected/etc)
      Returns:
      token to stop data collection
    • start

      @Deprecated public CollectorStopToken start(IDeviceDescription device, IDataCallback dataCallback, IDeviceStatusWithAddResultCallback deviceStatusCallback)
      Start receiving data from specific device or try to add it via postponed adding. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time. Postponed adding feature is available only for specific licences. Make sure that your license includes it.
      Parameters:
      device - device to receive data from
      dataCallback - callback to receive data in XML format
      deviceStatusCallback - callback to receive device status (connected/disconnected/add result/etc)
      Returns:
      token to stop data collection
    • start

      @Deprecated public CollectorStopToken start(IDeviceDescription[] devices, IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback)
      Start receiving data from specific devices. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time.
      Parameters:
      devices - devices to receive data from
      dataCallback - callback to receive data in XML format
      deviceStatusCallback - callback to receive device status (connected/disconnected)
      Returns:
      token to stop data collection
    • startWithPostponedAdding

      @Deprecated public CollectorStopToken startWithPostponedAdding(IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback)
      Start receiving data from added devices and add devices via postponed adding. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time. Postponed adding feature is available only for specific licences. Make sure that your license includes it.
      Parameters:
      dataCallback - callback to receive data in XML format
      deviceStatusCallback - callback to receive device status (connected/disconnected/etc).
      Returns:
      token to stop data collection
      Throws:
      FeatureUnsupportedException - if the license doesn't include postponed pairing
    • startWithPostponedAdding

      @Deprecated public CollectorStopToken startWithPostponedAdding(IDataCallback dataCallback, IDeviceStatusWithAddResultCallback deviceStatusCallback)
      Start receiving data from added devices and adding devices via postponed adding. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time. Postponed adding feature is available only for specific licences. Make sure that your license includes it.
      Parameters:
      dataCallback - callback to receive data in XML format
      deviceStatusCallback - callback to receive device status (connected/disconnected/add result/etc).
      Returns:
      token to stop data collection
      Throws:
      FeatureUnsupportedException - if the license doesn't include postponed pairing
    • startWithPostponedAdding

      @Deprecated public CollectorStopToken startWithPostponedAdding(IDeviceDescription[] devices, IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback)
      Start receiving data from specific devices or try to add them via postponed adding. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time. Postponed adding feature is available only for specific licences. Make sure that your license includes it.
      Parameters:
      devices - devices to receive data from
      dataCallback - callback to receive data in XML format
      deviceStatusCallback - callback to receive device status (connected/disconnected)
      Returns:
      token to stop data collection
    • startWithPostponedAdding

      @Deprecated public CollectorStopToken startWithPostponedAdding(IDeviceDescription[] devices, IDataCallback dataCallback, IDeviceStatusWithAddResultCallback deviceStatusCallback)
      Start receiving data from specific device or try to add them via postponed adding. Calling this method will result in starting a bluetooth scan which 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 and BLUETOOTH_CONNECT permissions. If the device doesn't automatically delete data after sending, Device Kit would filter incoming data by storing the last reading time. Postponed adding feature is available only for specific licences. Make sure that your license includes it.
      Parameters:
      devices - devices to receive data from
      dataCallback - callback to receive data in XML format
      deviceStatusCallback - callback to receive device status (connected/disconnected/add result/etc)
      Returns:
      token to stop data collection