Class SmartKey
This class contains additional requests that are specific for blukii SmartKeys.
To quick start please follow the instructions of the quick start documentation of base class
Blukii
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
SmartKey security mode setting: convenience modestatic final int
SmartKey security mode setting: error (invalid config)static final int
SmartKey security mode setting: off (no config)static final int
SmartKey security mode setting: pairing modestatic final int
SmartKey security mode setting: secure modestatic final int
SmartKey security mode setting: prepared secure mode: secure mode without pairing key setFields inherited from class com.blukii.sdk.config.Blukii
FIRMWARE, HARDWARE, SETTING_BLUETOOTH_TXPOWER_VALUES_003, SETTING_BLUETOOTH_TXPOWER_VALUES_007, SETTING_BLUKII_BATTERY_TYPE_3000, SETTING_BLUKII_BATTERY_TYPE_3300, SETTING_BLUKII_BATTERY_TYPE_3600, SETTING_BLUKII_LED_FLASH_1000, SETTING_BLUKII_LED_FLASH_300, SETTING_BLUKII_LED_FLASH_50, SETTING_BLUKII_LED_OFF, SETTING_BLUKII_LED_ON_MINUTES, SETTING_BLUKII_LED_ON_SECONDS, SETTING_BLUKII_SYSTEM_RESET_FACTORY_DATA_RESET, SETTING_BLUKII_SYSTEM_RESET_FACTORY_DATA_UPDATE, SETTING_BLUKII_SYSTEM_RESET_FACTORY_FLASH_RESET, SETTING_BLUKII_SYSTEM_RESET_FACTORY_IMAGE_RESET, SETTING_BLUKII_SYSTEM_RESET_REBOOT
-
Method Summary
Modifier and TypeMethodDescriptionvoid
initiateAuthentication
(ResponseListener responseListener) Initiates the authentication in pairing and secure mode.void
readButton
(ResponseListener responseListener) Reads the actual state of the SmartKey button.void
readMode
(ResponseListener responseListener) Reads the security mode of the SmartKey.void
resetMode
(ResponseListener responseListener) Resets the security mode toSETTING_MODE_OFF
.void
writeButton
(int frames, ResponseListener responseListener) Writes the number of advertised SmartKey button flags.void
writeModeConvenience
(ResponseListener responseListener) Sets the security mode toSETTING_MODE_CONVENIENCE
.void
writeModePairing
(int pairingKey, ResponseListener responseListener) Sets the security mode toSETTING_MODE_PAIRING
.void
writeModeSecure
(int pairingKey, ResponseListener responseListener) Sets the security mode toSETTING_MODE_SECURE
.Methods inherited from class com.blukii.sdk.config.Blukii
check, connect, connect, disconnect, getBluetoothDevice, getBluetoothDeviceName, getBlukiiData, getConnectionTimeout, getSubType, getType, initiatePairing, isReady, isSensorBeacon, isSmartBeacon, isSmartKey, readAdvertisingChannels, readAdvertisingUpdateDelay, readBatteryLevel, readBatteryType, readConnectionParameterDelay, readCurrentConnectionParameter, readDelayedAdvertisingInterval, readDelayedConnectionParameter, readDelayedDisconnect, readEnergySaveSettings, readInitialAdvertisingInterval, readLimitedAdvertising, readRssi, readRTC, readSecureConnect, readStateCounter, readTemperature, readTxPower, resetStateCounter, setConnectionTimeout, syncRTC, updateData, updateFirmware, updateFirmware, writeAdvertisingChannels, writeAdvertisingUpdateDelay, writeBatteryType, writeConnectionParameterDelay, writeCurrentConnectionParameter, writeDelayedAdvertisingInterval, writeDelayedConnectionParameter, writeDelayedDisconnect, writeEnergySaveSettings, writeInitialAdvertisingInterval, writeLEDMode, writeLimitedAdvertising, writeSecureConnect, writeSecureKey, writeSystemReset, writeTemperature, writeTxPower
-
Field Details
-
SETTING_MODE_ERROR
public static final int SETTING_MODE_ERRORSmartKey security mode setting: error (invalid config) -
SETTING_MODE_OFF
public static final int SETTING_MODE_OFFSmartKey security mode setting: off (no config) -
SETTING_MODE_CONVENIENCE
public static final int SETTING_MODE_CONVENIENCESmartKey security mode setting: convenience mode -
SETTING_MODE_PAIRING
public static final int SETTING_MODE_PAIRINGSmartKey security mode setting: pairing mode -
SETTING_MODE_SECURE_PREPARED
public static final int SETTING_MODE_SECURE_PREPAREDSmartKey security mode setting: prepared secure mode: secure mode without pairing key set -
SETTING_MODE_SECURE
public static final int SETTING_MODE_SECURESmartKey security mode setting: secure mode
-
-
Method Details
-
readMode
Reads the security mode of the SmartKey.Values:
SETTING_MODE_ERROR
SETTING_MODE_OFF
SETTING_MODE_CONVENIENCE
SETTING_MODE_PAIRING
SETTING_MODE_SECURE_PREPARED
SETTING_MODE_SECURE
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
resetMode
Resets the security mode toSETTING_MODE_OFF
.On this mode the SmartKey is sending connectable advertising frames.
It is recommended to use this mode for changing general Bluetooth or blukii settings (see requests of base class
Blukii
).Note: This request is only available in service mode that is running 30 seconds after re-inserting the battery.
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeModeConvenience
Sets the security mode toSETTING_MODE_CONVENIENCE
.On this mode the SmartKey is sending nonconnectable advertising frames so you only can connect in service mode (see below).
Use this mode for low security: the master can identify the blukii by reading the advertising packages.
Note: This request is only available in service mode that is running 30 seconds after re-inserting the battery.
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeModePairing
Sets the security mode toSETTING_MODE_PAIRING
.Use this mode for medium security: the master can identify the blukii by doing the following steps:
- Ensure master and blukii are paired
- Connect to blukii
- Try to authenticate (see
initiateAuthentication(ResponseListener)
for more information)
On pairing mode the communication is encrypted by the pairing key.
It is recommended to call
Blukii.initiatePairing(ResponseListener)
after running this request and to release the connection.Note: This request is only available in service mode that is running 30 seconds after re-inserting the battery.
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
pairingKey
- 6-digit pairing key (000000 - 999999)responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeModeSecure
Sets the security mode toSETTING_MODE_SECURE
.Use this mode for high security: the master can identify the blukii by doing the following steps:
- Ensure master and blukii are paired
- Connect to blukii
- Try to authenticate (see
initiateAuthentication(ResponseListener)
for more information)
On secure mode the communication is encrypted by the pairing key and an additional cryptographic key exchange.
It is recommended to call
Blukii.initiatePairing(ResponseListener)
after running this request and to release the connection.Note: This request is only available in service mode that is running 30 seconds after re-inserting the battery.
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
pairingKey
- 6-digit pairing key (000000 - 999999)responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
initiateAuthentication
Initiates the authentication in pairing and secure mode.The authentication depends on the actual SmartKey security mode:
- Pairing mode: the master is sending a pairing key encrypted authentication request.
- Secure mode: the master is requesting the authentication by a multi-stage challenge
response process. The communication is encrypted by the cryptographic key that has been
set in background by calling
writeModeSecure(int, ResponseListener)
. - Convenience mode: no authentication supported.
Note: Master and SmartKey have to be paired.
ResponseData:
BlukiiDataItem Type
-null
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readButton
Reads the actual state of the SmartKey button.Note: This request is only valid, if the SmartKey is successfully authenticated.
ResponseData:
BlukiiDataItem Type
-Boolean
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeButton
Writes the number of advertised SmartKey button flags.If the SmartKey button is pushed, a corresponding flag is set on the SmartKey advertising frame. Use this request for setting the amount of frame that will contain this flag.
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
frames
- amount of frames with activate SmartKey button flag.responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-