Package com.medm.devicekit
Class MedMCollector
java.lang.Object
com.medm.devicekit.MedMCollector
MedM Collector is where you receive data from controlled devices.
-
Method Summary
Modifier and TypeMethodDescriptionsetAddDeviceCallback
(IAddDeviceCallback callback) setDataCallback
(IDataCallback callback) setDeviceFilter
(IDeviceDescription[] deviceFilter) setDeviceStatusCallback
(IDeviceStatusCallback callback) setErrorCallback
(IErrorCallback callback) start()
Start receiving data from added devices.start
(IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback) Deprecated.start
(IDeviceDescription[] devices, IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback) Deprecated.start
(IDeviceDescription device, IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback) Deprecated.start
(IDeviceDescription device, IDataCallback dataCallback, IDeviceStatusWithAddResultCallback deviceStatusCallback) Start receiving data from added devices and add devices via postponed adding.startWithPostponedAdding
(IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback) Deprecated.startWithPostponedAdding
(IDataCallback dataCallback, IDeviceStatusWithAddResultCallback deviceStatusCallback) startWithPostponedAdding
(IDeviceDescription[] devices, IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback) Deprecated.startWithPostponedAdding
(IDeviceDescription[] devices, IDataCallback dataCallback, IDeviceStatusWithAddResultCallback deviceStatusCallback)
-
Method Details
-
setDataCallback
- Parameters:
callback
- callback to receive data in XML format- Returns:
- this collector instance
-
setDeviceStatusCallback
- Parameters:
callback
- callback to receive device status (connected/disconnected/etc).- Returns:
- this collector instance
-
setAddDeviceCallback
- Parameters:
callback
- callback to receive results of postponed adding- Returns:
- this collector instance
- See Also:
-
setErrorCallback
- Parameters:
callback
- callback to receive errors- Returns:
- this collector instance
-
setDeviceFilter
- Parameters:
deviceFilter
- devices to receive data from- Returns:
- this collector instance
-
getDeviceFilter
- Returns:
- current device filter
-
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
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) Deprecated.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 formatdeviceStatusCallback
- 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) Deprecated.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 fromdataCallback
- callback to receive data in XML formatdeviceStatusCallback
- 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) Deprecated.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 fromdataCallback
- callback to receive data in XML formatdeviceStatusCallback
- 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) Deprecated.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 fromdataCallback
- callback to receive data in XML formatdeviceStatusCallback
- callback to receive device status (connected/disconnected)- Returns:
- token to stop data collection
-
startWithPostponedAdding
@Deprecated public CollectorStopToken startWithPostponedAdding(IDataCallback dataCallback, IDeviceStatusCallback deviceStatusCallback) Deprecated.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 formatdeviceStatusCallback
- 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) Deprecated.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 formatdeviceStatusCallback
- 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) Deprecated.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 fromdataCallback
- callback to receive data in XML formatdeviceStatusCallback
- callback to receive device status (connected/disconnected)- Returns:
- token to stop data collection
-
startWithPostponedAdding
@Deprecated public CollectorStopToken startWithPostponedAdding(IDeviceDescription[] devices, IDataCallback dataCallback, IDeviceStatusWithAddResultCallback deviceStatusCallback) Deprecated.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 fromdataCallback
- callback to receive data in XML formatdeviceStatusCallback
- callback to receive device status (connected/disconnected/add result/etc)- Returns:
- token to stop data collection
-
setDataCallback(IDataCallback)
,setDeviceStatusCallback(IDeviceStatusCallback)
andstart()
instead