Package com.medm.devicekit
Class MedMDeviceManager
java.lang.Object
com.medm.devicekit.MedMDeviceManager
MedM Device Manager is where you can control devices list: add devices found in
scanner, remove devices, list devices, etc.
-
Method Summary
Modifier and TypeMethodDescriptionaddDevice
(IDeviceDescription device, IAddDeviceCallback callback) Start device addingaddDevice
(IDeviceDescription device, String pin, IAddDeviceCallback callback) Start device addingaddDeviceManually
(String address, int sku, IAddDeviceCallback callback) Deprecated.addDeviceManually
(String address, int sku, IAddDeviceWithErrorCallback callback) Start manual device adding.addDeviceManually
(String address, int sku, String pin, IAddDeviceCallback callback) Deprecated.addDeviceManually
(String address, int sku, String pin, IAddDeviceWithErrorCallback callback) Start manual device adding.void
addDevicePostponed
(int sku, PostponedAddFilter filter, String pin) Add device for postponed adding.Get the description for the devicegetDeviceManufacturer
(int sku) Get device manufacturer name for the provided sku.getDeviceModelName
(int sku) Get device model name for the provided sku.Get the list of added devicesgetSupportedMeasurementTypes
(int sku) Get list of measurement types for the device identified by the SKU.Get list of SKUs supported by this DeviceKitvoid
removeDevice
(IDeviceDescription device) Remove device from the list of added devicesvoid
removeDevice
(String address) Remove device from the list of added devices
-
Method Details
-
addDevice
public DeviceAddingCancellationToken addDevice(IDeviceDescription device, IAddDeviceCallback callback) Start device adding- Parameters:
device
- device to addcallback
- callback to receive the result when the add operation is finished- Returns:
- Cancellation token -- could be used to cancel asynchronous add operation
-
addDevice
public DeviceAddingCancellationToken addDevice(IDeviceDescription device, String pin, IAddDeviceCallback callback) Start device adding- Parameters:
device
- device to addpin
- Bluetooth pin code to pair devicecallback
- callback to receive the result when the add operation is finished- Returns:
- Cancellation token -- could be used to cancel asynchronous add operation
-
addDeviceManually
@Deprecated public DeviceAddingCancellationToken addDeviceManually(String address, int sku, IAddDeviceCallback callback) Deprecated.Start manual device adding. This is exactly the same as addDevice, but doesn't requireIDeviceDescription
as argument.- Parameters:
address
- device bluetooth addresssku
- device skucallback
- callback to receive the result when the add operation is finished- Returns:
- Cancellation token -- could be used to cancel asynchronous add operation
-
addDeviceManually
@Deprecated public DeviceAddingCancellationToken addDeviceManually(String address, int sku, String pin, IAddDeviceCallback callback) Deprecated.Start manual device adding. This is exactly the same as addDevice, but doesn't requireIDeviceDescription
as argument.- Parameters:
address
- device bluetooth addresssku
- device skupin
- Bluetooth pin code to pair devicecallback
- callback to receive the result when the add operation is finished or an error if some permissions are missing- Returns:
- Cancellation token -- could be used to cancel asynchronous add operation
-
addDeviceManually
public DeviceAddingCancellationToken addDeviceManually(String address, int sku, IAddDeviceWithErrorCallback callback) Start manual device adding. This is equal to callingMedMScanner.start()
and thenaddDevice(IDeviceDescription, IAddDeviceCallback)
- Parameters:
address
- device bluetooth addresssku
- device skucallback
- callback to receive the result when the add operation is finished or an error if some permissions are missing- Returns:
- Cancellation token -- could be used to cancel asynchronous add operation
-
addDeviceManually
public DeviceAddingCancellationToken addDeviceManually(String address, int sku, String pin, IAddDeviceWithErrorCallback callback) Start manual device adding. This is equal to callingMedMScanner.start()
and thenaddDevice(IDeviceDescription, String, IAddDeviceCallback)
- Parameters:
address
- device bluetooth addresssku
- device skupin
- Bluetooth pin code to pair devicecallback
- callback to receive the result when the add operation is finished- Returns:
- Cancellation token -- could be used to cancel asynchronous add operation
-
addDevicePostponed
Add device for postponed adding. The device would be added once it's found for the first time in collector. The feature is available only for specific licences. Make sure your license includes it.- Parameters:
sku
- device skufilter
- filter to identify the exact devicepin
- Bluetooth pin code for this device (if required)- Throws:
FeatureUnsupportedException
- if the license doesn't include postponed pairingFailedToAddPostponedDeviceException
- if adding failed
-
removeDevice
Remove device from the list of added devices- Parameters:
address
- bluetooth address of the device to remove
-
removeDevice
Remove device from the list of added devices- Parameters:
device
- device to remove
-
getDevicesList
Get the list of added devices- Returns:
- An array of added devices. IDeviceDescription fields that would be provided are SKU, Address, Name, Title, BatteryLevel, LastBatterySyncTime
-
getDevice
Get the description for the device- Parameters:
address
- address of the device- Returns:
- The device description, null if the device isn't found.
-
getSupportedSKUs
Get list of SKUs supported by this DeviceKit- Returns:
- List of supported SKUs
-
getSupportedMeasurementTypes
Get list of measurement types for the device identified by the SKU.- Parameters:
sku
- device sku- Returns:
- List of measurement types
-
getDeviceModelName
Get device model name for the provided sku.- Parameters:
sku
- device sku- Returns:
- device model name
-
getDeviceManufacturer
Get device manufacturer name for the provided sku.- Parameters:
sku
- device sku- Returns:
- device manufacturer
-
addDeviceManually(String, int, IAddDeviceWithErrorCallback)
instead