Class MedMDeviceManager


  • public class MedMDeviceManager
    extends java.lang.Object
    MedM Device Manager is where you can control devices list: add devices found in scanner, remove devices, list devices, etc.
    • Method Detail

      • addDevice

        public DeviceAddingCancellationToken addDevice​(IDeviceDescription device,
                                                       IAddDeviceCallback callback)
        Start device adding
        Parameters:
        device - device to add
        callback - 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,
                                                       java.lang.String pin,
                                                       IAddDeviceCallback callback)
        Start device adding
        Parameters:
        device - device to add
        pin - Bluetooth pin code to pair device
        callback - callback to receive the result when the add operation is finished
        Returns:
        Cancellation token -- could be used to cancel asynchronous add operation
      • addDeviceManually

        public DeviceAddingCancellationToken addDeviceManually​(java.lang.String address,
                                                               int sku,
                                                               IAddDeviceCallback callback)
        Start manual device adding. This is exactly the same as addDevice, but doesn't require IDeviceDescription as argument.
        Parameters:
        address - device bluetooth address
        sku - device sku
        callback - callback to receive the result when the add operation is finished
        Returns:
        Cancellation token -- could be used to cancel asynchronous add operation
      • addDeviceManually

        public DeviceAddingCancellationToken addDeviceManually​(java.lang.String address,
                                                               int sku,
                                                               java.lang.String pin,
                                                               IAddDeviceCallback callback)
        Start manual device adding. This is exactly the same as addDevice, but doesn't require IDeviceDescription as argument.
        Parameters:
        address - device bluetooth address
        sku - device sku
        pin - Bluetooth pin code to pair device
        callback - callback to receive the result when the add operation is finished
        Returns:
        Cancellation token -- could be used to cancel asynchronous add operation
      • addDevicePostponed

        public void addDevicePostponed​(int sku,
                                       PostponedAddFilter filter,
                                       java.lang.String pin)
        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 sku
        filter - filter to identify the exact device
        pin - Bluetooth pin code for this device (if required)
        Throws:
        FeatureUnsupportedException - if the license doesn't include postponed pairing
        FailedToAddPostponedDeviceException - if adding failed
      • removeDevice

        public void removeDevice​(java.lang.String address)
        Remove device from the list of added devices
        Parameters:
        address - bluetooth address of the device to remove
      • removeDevice

        public void removeDevice​(IDeviceDescription device)
        Remove device from the list of added devices
        Parameters:
        device - device to remove
      • getDevicesList

        public IDeviceDescription[] 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

        @Nullable
        public IDeviceDescription getDevice​(java.lang.String address)
        Get the description for the device
        Parameters:
        address - address of the device
        Returns:
        The device description, null if the device isn't found.
      • getSupportedSKUs

        public java.util.List<java.lang.Integer> getSupportedSKUs()
        Get list of SKUs supported by this DeviceKit
        Returns:
        List of supported SKUs
      • getSupportedMeasurementTypes

        public java.util.List<MeasurementType> getSupportedMeasurementTypes​(int sku)
        Get list of measurement types for the device identified by the SKU.
        Parameters:
        sku - device sku
        Returns:
        List of measurement types
      • getDeviceModelName

        public java.lang.String getDeviceModelName​(int sku)
        Get device model name for the provided sku.
        Parameters:
        sku - device sku
        Returns:
        device model name
      • getDeviceManufacturer

        public java.lang.String getDeviceManufacturer​(int sku)
        Get device manufacturer name for the provided sku.
        Parameters:
        sku - device sku
        Returns:
        device manufacturer