getIotDevices

abstract fun getIotDevices(sorting: Sorting, iotDeviceFilter: IotDeviceFilter? = null, propertyFilter: PropertyFilter? = null, updateIntervalMillis: Long = -1, callback: (Result<List<IotDevice>>) -> Unit): Cancelable

Support function to get list of IotDevice.

Note: The purpose of this function is to support clients that can not use Coroutines or the Kotlin programming language!

Since

1.3.0

Return

Cancelable It is your responsibility to cancel this operation, when no longer needed, to avoid memory leaks.

Parameters

sorting

Order of the returned IotDevice. Sorting.None, will be the same returned by backend and Sorting.Distance will use bluetooth scan to order from nearest to out-of-range.

iotDeviceFilter

IotDeviceFilter(s) to be applied to the iotDevices. There are a few pre-defined filters such as NearbyFilter and IotDeviceFilterList. Applications can define their own filter(s) and use IotDeviceFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

propertyFilter

PropertyFilter(s) to be applied to the iotDevices. When filtered out, properties will be removed from the IotDevice object. IotDevice objects without any property will be removed from the list. There are a few pre-defined filters such as WritablePropertyFilter, PropertyKindFilter and AvailablePropertyFilter. Applications can define their own filter(s) and use PropertyFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

updateIntervalMillis

The update interval in milliseconds, if its zero or less the query will execute only once.

callback

Receiving the Result containing list of IotDevice.

abstract fun getIotDevices(iotDeviceFilter: IotDeviceFilter? = null, propertyFilter: PropertyFilter? = null, updateIntervalMillis: Long = -1, callback: (Result<List<IotDevice>>) -> Unit): Cancelable

Support function to get list of IotDevice.

Note: The purpose of this function is to support clients that can not use Coroutines or the Kotlin programming language!

Since

1.6.0

Return

Cancelable It is your responsibility to cancel this operation, when no longer needed, to avoid memory leaks.

Parameters

sorting

Order of the returned IotDevice. Sorting.None, will be the same returned by backend and Sorting.Distance will use bluetooth scan to order from nearest to out-of-range.

iotDeviceFilter

IotDeviceFilter(s) to be applied to the iotDevices. There are a few pre-defined filters such as NearbyFilter and IotDeviceFilterList. Applications can define their own filter(s) and use IotDeviceFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

propertyFilter

PropertyFilter(s) to be applied to the iotDevices. When filtered out, properties will be removed from the IotDevice object. IotDevice objects without any property will be removed from the list. There are a few pre-defined filters such as WritablePropertyFilter, PropertyKindFilter and AvailablePropertyFilter. Applications can define their own filter(s) and use PropertyFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

updateIntervalMillis

The update interval in milliseconds, if its zero or less the query will execute only once.

callback

Receiving the Result containing list of IotDevice.

abstract fun getIotDevices(iotDeviceFilter: IotDeviceFilter? = null, propertyFilter: PropertyFilter? = null, updateIntervalMillis: Long = -1, lifecycleOwner: LifecycleOwner, callback: (Result<List<IotDevice>>) -> Unit): Cancelable

Support function to get list of IotDevice.

Note: The purpose of this function is to support clients that can not use Coroutines or the Kotlin programming language!

Since

1.9.0

Return

Cancelable In case you want to cancel before Lifecycle.State.DESTROYED.

Parameters

sorting

Order of the returned IotDevice. Sorting.None, will be the same returned by backend and Sorting.Distance will use bluetooth scan to order from nearest to out-of-range.

iotDeviceFilter

IotDeviceFilter(s) to be applied to the iotDevices. There are a few pre-defined filters such as NearbyFilter and IotDeviceFilterList. Applications can define their own filter(s) and use IotDeviceFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

propertyFilter

PropertyFilter(s) to be applied to the iotDevices. When filtered out, properties will be removed from the IotDevice object. IotDevice objects without any property will be removed from the list. There are a few pre-defined filters such as WritablePropertyFilter, PropertyKindFilter and AvailablePropertyFilter. Applications can define their own filter(s) and use PropertyFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

updateIntervalMillis

The update interval in milliseconds, if its zero or less the query will execute only once.

lifecycleOwner

auto cancel the Cancelable when lifecycle state is Lifecycle.State.DESTROYED.

callback

Receiving the Result containing list of IotDevice.