Skip to main content

IKeyManager

IKeyManager

Description: IKeyManager provides interfaces to access KeyManager, The KeyManager class provides a set of methods to access the parameters of the hardware module and control the behavior of the hardware module, including AutelKey Value setting, Value acquisition, Value monitoring, and Action execution. The AutelKey instance can be created more conveniently through the createKey method provided by the KeyTools class.

Constants

RETRY_MAX_COUNTS = 5 //Maximum trying times when failure

method getValue

fun <Result> getValue(
key: AutelKey<Result>,
callback: CommonCallbacks.CompletionCallbackWithParam<Result>,
retryCount: Int = RETRY_MAX_COUNTS
)

Description: Get a single attribute

Input parameters: key: the requested AutelKey object

callback: the interface that responds to the callback

retryCount: Maximum trying times when failure, default 5.

Output parameters: None

Related parameters: None

method getValueList

fun getValueList(
keyList: List<AutelKey<*>>,
callback: CommonCallbacks.CompletionCallbackWithParam<List<*>>,
retryCount: Int = RETRY_MAX_COUNTS
)

Description: Get multiple attributes

Input parameters: keyList: AutelKey collection requested

callback: the interface that responds to the callback

retryCount: Maximum trying times when failure, default 5.

Output parameters: None

Related parameters: None

method setValue

fun <Param> setValue(
key: AutelKey<Param>,
param: Param,
callback: CommonCallbacks.CompletionCallback?,
retryCount: Maximum trying times when failure, default 5.
)

Description: Set a single property

Input parameters: key: the requested AutelKey object

param: request parameter

callback: the interface that responds to the callback

retryCount: Maximum trying times when failure, default 5.

Output parameters: None

Related parameters: None

method setValueList

fun setValueList(
keyList: List<AutelKey<Any>>,
paramList: List<Any>,
callback: CommonCallbacks.CompletionCallbackWithParam<List<*>>?
)

Description: Set multiple properties

Input parameters: keyList: AutelKey collection requested

paramList: request parameter collection

callback: the interface that responds to the callback

Output parameters: None

Related parameters: None

method setFrequencyReport

fun <Param> setFrequencyReport(
key: AutelKey<Param>,
param: Param
)

Description: Set fixed frequency report

Input parameters: key: the requested AutelKey object

param: request parameter

Output parameters: None

Related parameters: None

method setFrequencyReport

fun <Param, Result> setFrequencyReport(
key: AutelKey.ActionKey<Param, Result>,
param: Param,
callback: CommonCallbacks.CompletionCallbackWithParam<Result>?,
)

Description: Set fixed frequency report

Input parameters: key: the requested AutelKey object

param: request parameter

callback: the interface that responds to the callback

Output parameters: None

Related parameters: None

method performAction

fun <Param, Result> performAction(
key: AutelKey.ActionKey<Param, Result>,
param: Param? = null,
callback: CommonCallbacks.CompletionCallbackWithParam<Result>?,
retryCount: Int = RETRY_MAX_COUNTS,
bizType: String? = null
)

Description: Event Request

Input parameters: key: the requested ActionKey object

param: request parameters

callback: the interface that responds to the callback

retryCount:Maximum trying times when failure, default 5.

bizType: Business reserved for use: currently used to determine whether the switching upstream and downstream bandwidth timeout, is OTA, default is null

Output parameters: None

Related parameters: None

method performAction2

fun <Param> performAction2(
key: AutelKey.ActionKey<Param, Int>,
param: Param? = null,
callback: CommonCallbacks.CompletionCallbackWithParam<Int>?,
retryCount: Int = RETRY_MAX_COUNTS
)

Description: Event Request 2

Input parameters: key: the requested ActionKey object

param: request parameters

callback: the interface that responds to the callback

retryCount:Maximum trying times when failure, default 5.

Output parameters: None

Related parameters: None

method listen

fun <Result> listen(
key: AutelKey<Result>,
callback: CommonCallbacks.KeyListener<Result>
)

Description: Add the reported listener

Input parameters: key: the requested AutelKey object

callback: the interface that responds to the callback

Output parameters: None

Related parameters: None

method cancelListen

fun <Result> cancelListen(key: AutelKey<Result>, callback: CommonCallbacks.KeyListener<Result>?)

Description: Cancel the reported monitoring

Input parameters: key: the requested AutelKey object

callback: the interface that responds to the callback

Output parameters: None

Related parameters: None

method cancelSameKeyListen

fun <Result> cancelSameKeyListen(key: AutelKey<Result>)

Description: Cancel All reported monitoring of the same AutelKey

Input parameters: key: the requested AutelKey object

Output parameters: None

Related parameters: None

method setValueChangeListener

fun setValueChangeListener(listener: IValueChangeListener)

Description: set the responds when same value changed

Input parameters: listener: the interface that responds to the callback

Output parameters: None

Related parameters: None

method removeValueChangeListener

fun removeValueChangeListener(listener: IValueChangeListener)

Description: remove listener for value changed

Input parameters: listener: the interface that responds to the callback

Output parameters: None

Related parameters: None