Class Blukii
- Direct Known Subclasses:
SmartBeacon
,SmartKey
Blukii
is the single point of contact for all actions that are provided by blukii GATT
profiles.
Quick start documentation
blukii types
This class contains all blukii functions that are independent of any blukii type.
For each blukii type there is a derived class that contains additional type specific functions:
Get blukii device object
Initially, you need a valid blukii device (BluetoothDevice
) to connect to. You have to
search for BLE devices what can easily be done by the BlukiiClient
class, which is part of the library's
info
package.
You can retrieve a BluetoothDevice
object by calling DiscoveryData.getDevice()
.
Connect & Disconnect
This class provides methods to connect to a blukii device and disconnect from it. So you can
call connect(ConnectionListener)
to initiate the connection and you can call
disconnect()
if your work is done and you want to free your device.
You can keep track about the connection state via the ConnectionListener
interface
which is handed to the Blukii
class via the connect(ConnectionListener)
method.
Example snippet
private boolean connectDevice() {
// get blukii device object from an OutputElement, that is retrieved
// from BlukiiClient.OnDiscoveryListener
BluetoothDevice bluetoothDevice = outputElement.getDiscoveryData().getDevice();
// create new Blukii instance (see also BlukiiController
)
mBlukii = BlukiiController.getInstance().getNewSmartBeaconConfig(bluetoothDevice);
// initiate connection => retrieve callback via ConnectionListener
mBlukii.connect(mConnectionListener);
}
private final ConnectionListener mConnectionListener = new ConnectionListener() {
@Override
public void onConnected() {
// Connection successful
}
@Override
public void onDisconnected(DisconnectReason reason) {
// Device is disconnected or connection failed
}
// ...
});
Asynchronous requests
This class contains a large set of requests that are supported by the several blukii devices.
Important: all requests are called asynchronously. The results are returned via
callbacks of ResponseListener
.
Via ResponseListener.onResponse(ResponseData)
you get the value if the call was
successful. Otherwise you get an Error via the ResponseListener.onError(ResponseError)
callback.
Each method gets a ResponseListener
object to provide the callable callback methods
ResponseListener.onResponse(ResponseData)
, ResponseListener.onError(ResponseError)
and ResponseListener.onNotify(ResponseData)
.
Example Snippet
private void readTxPower() {
mBlukii.readTxPower(new ResponseListener() {
@Override
onResponse(ResponseData response) {
int txPower = response.getData().getDeviceValue();
Log.i(TAG, "Read TxPower Success: " + txPower);
}
@Override
onError(ResponseError error) {
Log.e(TAG, "Read TxPower Error: + error.getErrorStatus());
}
@Override
onNotify(ResponseData response) {}
}
}
private void writeIBeacon(UUID uuid, int major, int minor) {
IBeacon iBeaconData = new IBeacon();
iBeaconData.setUUID(uuid);
iBeaconData.setMajor(major);
iBeaconData.setMinor(minor);
mBlukii.writeIBeaconAdvertising(iBeaconData, new ResponseListener() {
@Override
onResponse(ResponseData response) {
IBeacon iBeaconData = response.getData().getDeviceValue();
Log.i(TAG, "Write iBeacon Success");
}
@Override
onError(ResponseError error) {
Log.e(TAG, "Write iBeacon Error: " + error.getErrorStatus());
}
@Override
onNotify(ResponseData response) {}
}
}
Cloud support
You can interact with blukii Manager for retrieving cloud managed data and synchronizing device data to cloud.
This sdk feature requires an authentication via the BlukiiCloud
class:
- Setting your developer's API key by calling
BlukiiCloud.setApiKey(String)
. - Setting the blukii Manager user's name and password by calling
BlukiiCloud.setCredentials(String, String)
. - Login by calling
BlukiiCloud.login(BlukiiCloud.OnLoginListener)
.
See also DataManager
class for managing cloud dependent data.
-
Field Summary
Modifier and TypeFieldDescriptionRepresents the actual firmware version of device.Represents the actual hardware version of device.static final short[]
List of all possible TxPower values that depends on the Bluetooth hardware of blukii SensorBeacon (Version 003.xxx).static final short[]
List of all possible TxPower values that depends on the Bluetooth hardware of blukii SmartBeacon (Version 007.xxx).static final int
Battery type setting: Batteries with max 3000 mVstatic final int
Battery type setting: Batteries with max 3300 mVstatic final int
Battery type setting: Batteries with max 3600 mVstatic final int
LED mode setting: LED is blinking in interval of 1000 ms (slow).static final int
LED mode setting: LED is blinking in interval of 300 ms (middle).static final int
LED mode setting: LED is blinking in interval of 50 ms (fast).static final int
LED mode setting: LED is set off (reset other LED setting).static final int
LED mode setting: LED is permanently on for a defined number of minutesstatic final int
LED mode setting: LED is permanently on for a defined number of secondsstatic final int
System reset mode: Factory data reset and rebootstatic final int
System reset mode: Factory data update without reboot (admin user only)static final int
Reboot mode setting: Factory flash reset and reboot (admin user only)static final int
System reset mode: Factory image reset and reboot (admin user only)static final int
System reset mode: Default reboot -
Method Summary
Modifier and TypeMethodDescriptionboolean
check
(BlukiiAction action) Checks via action if function is callableboolean
connect
(ConnectionListener connectionListener) Initiates a connection to the GATT server hosted on the blukii device.boolean
connect
(ConnectionListener connectionListener, OfflineConnectionCallback offlineConnectionCallback) Initiates a connection to the GATT server hosted on the blukii device.void
Disconnects the connected blukii or cancel a pending connection.android.bluetooth.BluetoothDevice
Gets the Bluetooth device that has been set on instantiation.Gets the name of bluetooth device.Gets the Blukii Data objectint
Gets the user defined connection timeout (in milliseconds) for theconnect(ConnectionListener)
request.Gets the sub type of this blukii.getType()
Gets the type of this blukii.void
initiatePairing
(ResponseListener responseListener) Initiates a pairing request from the blukii to the master device.boolean
isReady()
Check whether device is ready for configuration.boolean
Checks if current device is Sensor Beacon.boolean
Checks if current device is Smart Beacon.boolean
Checks if current device is Smart Key.void
readAdvertisingChannels
(ResponseListener responseListener) Reads the advertising channels that are used for the Bluetooth advertising.void
readAdvertisingUpdateDelay
(ResponseListener responseListener) Reads the advertising update delay (in seconds).void
readBatteryLevel
(ResponseListener responseListener) Read the battery level percentage of your blukii.void
readBatteryType
(ResponseListener responseListener) Gets the battery type of your blukii.void
readConnectionParameterDelay
(ResponseListener responseListener) Reads the connection parameter delay (in seconds).void
readCurrentConnectionParameter
(ResponseListener responseListener) Reads the current parameter set for the connection.void
readDelayedAdvertisingInterval
(ResponseListener responseListener) Reads the delayed advertising interval (in milliseconds).void
readDelayedConnectionParameter
(ResponseListener responseListener) Reads the delayed parameter set for the connection.void
readDelayedDisconnect
(ResponseListener responseListener) Reads the time until the blukii will trigger the disconnection afterwriteDelayedDisconnect(int, ResponseListener)
has been called.void
readEnergySaveSettings
(ResponseListener responseListener) Gets the energy save settings.void
readInitialAdvertisingInterval
(ResponseListener responseListener) Reads the initial advertising interval (in milliseconds) that is active after reboot and disconnection.void
readLimitedAdvertising
(ResponseListener responseListener) Reads the limited advertising delay (in seconds) after pushing the blukii button.void
readRssi
(ResponseListener responseListener) Reads the rssi value of the actual signal strengthvoid
readRTC
(ResponseListener responseListener) Reads the actual time from real time clock of your blukii.void
readSecureConnect
(ResponseListener responseListener) Reads the state of secure connect.void
readStateCounter
(ResponseListener responseListener) Reads the amount of reboots and connections that has been occurred after the counter reset byresetStateCounter(ResponseListener)
.void
readTemperature
(ResponseListener responseListener) Reads the calibrated value of the temperature sensor.void
readTxPower
(ResponseListener responseListener) Reads the Bluetooth TxPower strength.void
resetStateCounter
(ResponseListener responseListener) Resets the state counter of your blukii.void
setConnectionTimeout
(int connectionTimeout) Sets the user defined connection timeout (in milliseconds) for theconnect(ConnectionListener)
request.void
syncRTC
(ResponseListener responseListener) Sets the blukii's real time clock to actual time.void
updateData
(DataUpdateListener listener) Updates the blukii device with cloud configuration data.void
updateFirmware
(FirmwareUpdateListener listener) Updates the blukii device with new firmware.void
updateFirmware
(FirmwareUpdateListener listener, String targetFirmware) Updates the blukii device with new firmware.void
writeAdvertisingChannels
(int channels, ResponseListener responseListener) Writes the advertising channels that are used for the Bluetooth advertising.void
writeAdvertisingUpdateDelay
(int delay, ResponseListener responseListener) Writes the advertising update delay (in seconds).void
writeBatteryType
(int value, ResponseListener responseListener) Sets the battery type of your blukii.void
writeConnectionParameterDelay
(int delay, ResponseListener responseListener) Writes the connection parameter delay (in seconds).void
writeCurrentConnectionParameter
(ConnectionParameter connectionParameter, ResponseListener responseListener) Writes the current parameter set for the connection for a immediate change of the connection parameters.void
writeDelayedAdvertisingInterval
(int interval, ResponseListener responseListener) Writes the delayed advertising interval (in milliseconds).void
writeDelayedConnectionParameter
(ConnectionParameter connectionParameter, ResponseListener responseListener) Writes the delayed parameter set for the connection.void
writeDelayedDisconnect
(int delay, ResponseListener responseListener) Writes the time (in seconds) until the blukii will trigger the disconnection.void
writeEnergySaveSettings
(EnergySaveSettings settings, ResponseListener responseListener) Sets the energy save settings.void
writeInitialAdvertisingInterval
(int interval, ResponseListener responseListener) Writes the initial advertising interval (in milliseconds) that is active after disconnection.void
writeLEDMode
(int mode, int count, ResponseListener responseListener) Activates/deactivates LED of your blukii.void
writeLimitedAdvertising
(int delay, ResponseListener responseListener) Writes the limited advertising delay (in seconds) after pushing the blukii button.void
writeSecureConnect
(boolean state, ResponseListener responseListener) Enables/Disables secure connect on your blukii.void
writeSecureKey
(String secureKey, ResponseListener responseListener) Sets secure key of your blukii.void
writeSystemReset
(int mode, ResponseListener responseListener) Initiates a system reset command.void
writeTemperature
(float temperature, ResponseListener responseListener) Writes the actual sensor temperature.void
writeTxPower
(short value, ResponseListener responseListener) Writes the Bluetooth TxPower strength.
-
Field Details
-
SETTING_BLUKII_LED_OFF
public static final int SETTING_BLUKII_LED_OFFLED mode setting: LED is set off (reset other LED setting). -
SETTING_BLUKII_LED_FLASH_1000
public static final int SETTING_BLUKII_LED_FLASH_1000LED mode setting: LED is blinking in interval of 1000 ms (slow). -
SETTING_BLUKII_LED_FLASH_300
public static final int SETTING_BLUKII_LED_FLASH_300LED mode setting: LED is blinking in interval of 300 ms (middle). -
SETTING_BLUKII_LED_FLASH_50
public static final int SETTING_BLUKII_LED_FLASH_50LED mode setting: LED is blinking in interval of 50 ms (fast). -
SETTING_BLUKII_LED_ON_SECONDS
public static final int SETTING_BLUKII_LED_ON_SECONDSLED mode setting: LED is permanently on for a defined number of seconds -
SETTING_BLUKII_LED_ON_MINUTES
public static final int SETTING_BLUKII_LED_ON_MINUTESLED mode setting: LED is permanently on for a defined number of minutes -
SETTING_BLUKII_BATTERY_TYPE_3000
public static final int SETTING_BLUKII_BATTERY_TYPE_3000Battery type setting: Batteries with max 3000 mV -
SETTING_BLUKII_BATTERY_TYPE_3300
public static final int SETTING_BLUKII_BATTERY_TYPE_3300Battery type setting: Batteries with max 3300 mV -
SETTING_BLUKII_BATTERY_TYPE_3600
public static final int SETTING_BLUKII_BATTERY_TYPE_3600Battery type setting: Batteries with max 3600 mV -
SETTING_BLUKII_SYSTEM_RESET_REBOOT
public static final int SETTING_BLUKII_SYSTEM_RESET_REBOOTSystem reset mode: Default reboot -
SETTING_BLUKII_SYSTEM_RESET_FACTORY_DATA_RESET
public static final int SETTING_BLUKII_SYSTEM_RESET_FACTORY_DATA_RESETSystem reset mode: Factory data reset and reboot -
SETTING_BLUKII_SYSTEM_RESET_FACTORY_IMAGE_RESET
public static final int SETTING_BLUKII_SYSTEM_RESET_FACTORY_IMAGE_RESETSystem reset mode: Factory image reset and reboot (admin user only) -
SETTING_BLUKII_SYSTEM_RESET_FACTORY_DATA_UPDATE
public static final int SETTING_BLUKII_SYSTEM_RESET_FACTORY_DATA_UPDATESystem reset mode: Factory data update without reboot (admin user only) -
SETTING_BLUKII_SYSTEM_RESET_FACTORY_FLASH_RESET
public static final int SETTING_BLUKII_SYSTEM_RESET_FACTORY_FLASH_RESETReboot mode setting: Factory flash reset and reboot (admin user only) -
SETTING_BLUETOOTH_TXPOWER_VALUES_007
public static final short[] SETTING_BLUETOOTH_TXPOWER_VALUES_007List of all possible TxPower values that depends on the Bluetooth hardware of blukii SmartBeacon (Version 007.xxx).Following Values are defined:
-20 dBm, -10 dBm, -8 dBm, -6 dBm, -4 dBm, -2 dBm, 0 dBm, 2 dBm, 4 dBm, 6 dBm, 8 dBm, 10 dBm
Note: for 4 dBm and lower the SmartBeacon is in low power mode -
SETTING_BLUETOOTH_TXPOWER_VALUES_003
public static final short[] SETTING_BLUETOOTH_TXPOWER_VALUES_003List of all possible TxPower values that depends on the Bluetooth hardware of blukii SensorBeacon (Version 003.xxx).Following Values are defined:
-21 dBm, -15 dBm, -12 dBm, -9 dBm, -6 dBm, -3 dBm, 0 dBm, 1 dBm, 2 dBm, 3 dBm, 4 dBm, 5 dBm
-
FIRMWARE
Represents the actual firmware version of device.Note: only valid after connect
- See Also:
-
HARDWARE
Represents the actual hardware version of device.Note: only valid after connect
-
-
Method Details
-
getType
Gets the type of this blukii.- Returns:
- type of blukii
- See Also:
-
getSubType
Gets the sub type of this blukii.- Returns:
- sub type of blukii
- See Also:
-
isSmartKey
public boolean isSmartKey()Checks if current device is Smart Key.- Returns:
true
if device is Smart Key, otherwisefalse
-
isSmartBeacon
public boolean isSmartBeacon()Checks if current device is Smart Beacon.- Returns:
true
if device is Smart Beacon, otherwisefalse
-
isSensorBeacon
public boolean isSensorBeacon()Checks if current device is Sensor Beacon.- Returns:
true
if device is Sensor Beacon, otherwisefalse
-
getBluetoothDevice
public android.bluetooth.BluetoothDevice getBluetoothDevice()Gets the Bluetooth device that has been set on instantiation.- Returns:
- actual Bluetooth Device
- See Also:
-
Blukii(Context, BluetoothDevice)
-
getBluetoothDeviceName
Gets the name of bluetooth device.- Returns:
- actual device name
-
isReady
public boolean isReady()Check whether device is ready for configuration.- Returns:
true
if ready, otherwisefalse
-
getBlukiiData
Gets the Blukii Data object- Returns:
- a BlukiiData object
- See Also:
-
getConnectionTimeout
public int getConnectionTimeout()Gets the user defined connection timeout (in milliseconds) for theconnect(ConnectionListener)
request.If connection timeout is larger than 0 and less than 30 seconds the connection request is canceled.
If connection timeout is 0 (default), the blukii hardware defined timeout takes effect, which is 30 seconds.
- Returns:
- connection timeout in milliseconds
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) Sets the user defined connection timeout (in milliseconds) for theconnect(ConnectionListener)
request.If connection timeout is larger than 0 and less than 30 seconds the connection request is canceled.
If connection timeout is 0 (default), the blukii hardware defined timeout takes effect, which is 30 seconds.
- Parameters:
connectionTimeout
- connection timeout in milliseconds
-
connect
Initiates a connection to the GATT server hosted on the blukii device.The parameter "onConnectionListener" contains the listener for all requests that will be called during connection lifecycle. See interface
ConnectionListener
.If this action has successfully finished, callback
ConnectionListener.onConnected()
is fired.If an error occurs callback
ConnectionListener.onDisconnected(DisconnectReason)
with an error reason is fired.- Parameters:
connectionListener
- listener for connection state changes- Returns:
true
if the connection is initiated successfully, otherwisefalse
- See Also:
-
connect
public boolean connect(@NonNull ConnectionListener connectionListener, @NonNull OfflineConnectionCallback offlineConnectionCallback) Initiates a connection to the GATT server hosted on the blukii device.The parameter "connectionListener" contains the listener for all state changes relevant during connection lifecycle. See interface
ConnectionListener
.If this action has successfully finished, callback
ConnectionListener.onConnected()
is fired.If an error occurs callback
ConnectionListener.onDisconnected(DisconnectReason)
with an error reason is fired.The parameter "offlineConnectionCallback" contains the callback which is relevant to establish a secure connection when blukii cloud is not used. See abstract class
OfflineConnectionCallback
- Parameters:
connectionListener
- listener for connection state changesofflineConnectionCallback
- callback necessary if secure connection must be established offline- Returns:
true
if the connection is initiated successfully, otherwisefalse
- See Also:
-
disconnect
public void disconnect()Disconnects the connected blukii or cancel a pending connection.If this action has finished, callback
ConnectionListener.onDisconnected(DisconnectReason)
is called withDisconnectReason.Disconnect
.- See Also:
-
updateData
Updates the blukii device with cloud configuration data.This function is only successful, if the device owner is logged in and BlukiiData is loaded from cloud.
The listener (see parameter) gives you feedback about success and a list with all updated actions and actions with error.
blukii device must not be connected when this function is called.
- Parameters:
listener
- DataUpdateLister for asynchronous update result
-
updateFirmware
Updates the blukii device with new firmware.This function is only successful, if the device owner is logged in.
The listener (see parameter) gives you feedback about the progress and success. You can control and cancel the progress via
FirmwareUpdateListener.onProgress(FirmwareUpdateProgress, Object)
.blukii device must not be connected when this function is called. If a firmware update is available you can retrieve with
BlukiiData.getAvailableFirmware()
.- Parameters:
listener
- FirmwareUpdateListener for asynchronous update result
-
updateFirmware
Updates the blukii device with new firmware.
If you are logged in as admin, you can determine the target firmware version. For simple users this function is equal to
updateFirmware(FirmwareUpdateListener)
, because the targetFirmware parameter is not interpreted.This function is only successful, if the device owner is logged in.
The listener (see parameter) gives you feedback about the progress and success. You can control and cancel the progress via
FirmwareUpdateListener.onProgress(FirmwareUpdateProgress, Object)
.blukii device must not be connected when this function is called. If a firmware update is available you can retrieve with
BlukiiData.getAvailableFirmware()
.- Parameters:
listener
- FirmwareUpdateListener for asynchronous update resulttargetFirmware
- determined target firmware version (for admin logins only)
-
check
Checks via action if function is callable- Parameters:
action
- Action to check- Returns:
true
if action is available for this blukii, otherwisefalse
- See Also:
-
readRssi
Reads the rssi value of the actual signal strengthResponseData:
BlukiiDataItem Type
-Short
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readDelayedDisconnect
Reads the time until the blukii will trigger the disconnection afterwriteDelayedDisconnect(int, ResponseListener)
has been called.See
writeDelayedDisconnect(int, ResponseListener)
for more information.Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeDelayedDisconnect
Writes the time (in seconds) until the blukii will trigger the disconnection.Value range:
0 - 3600 s
-1
: Disconnect will be triggered directly
Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
delay
- seconds after blukii will disconnectresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readInitialAdvertisingInterval
Reads the initial advertising interval (in milliseconds) that is active after reboot and disconnection.See
writeInitialAdvertisingInterval(int, ResponseListener)
for more information.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeInitialAdvertisingInterval
public void writeInitialAdvertisingInterval(int interval, @NonNull ResponseListener responseListener) Writes the initial advertising interval (in milliseconds) that is active after disconnection.Value range:
100 - 10000 ms
- steps of
100 ms
between100
and2500
- steps of
2500 ms
between2500
and10000
- Note: Values between this steps will be rounded down
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
interval
- initial advertising interval (in milliseconds)responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readDelayedAdvertisingInterval
Reads the delayed advertising interval (in milliseconds).See
writeDelayedAdvertisingInterval(int, ResponseListener)
for more information.Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeDelayedAdvertisingInterval
public void writeDelayedAdvertisingInterval(int interval, @NonNull ResponseListener responseListener) Writes the delayed advertising interval (in milliseconds).The initial advertising interval (see
readInitialAdvertisingInterval(ResponseListener)
is changing to the delayed advertising interval after the advertising update delay (seereadAdvertisingUpdateDelay(ResponseListener)
. It stays active until the blukii is rebooted (switched off) or getting a new connection.Value range:
100 - 10000 ms
- steps of
100 ms
between100
and2500
- steps of
2500 ms
between2500
and10000
- Note: Values between this steps will be rounded down.
Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
interval
- delayed advertising interval (in milliseconds)responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readAdvertisingUpdateDelay
Reads the advertising update delay (in seconds).See
writeAdvertisingUpdateDelay(int, ResponseListener)
for more information.Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeAdvertisingUpdateDelay
Writes the advertising update delay (in seconds).After the advertising update delay, the initial advertising interval (see
readInitialAdvertisingInterval(ResponseListener)
is changing to the delayed advertising interval (seereadDelayedAdvertisingInterval(ResponseListener)
.Value range:
0 - 65535 s
Note: If this value is
0
, the initial advertising interval stays active without changing.Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
delay
- advertising update delay (in seconds)responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readAdvertisingChannels
Reads the advertising channels that are used for the Bluetooth advertising.See
writeAdvertisingChannels(int, ResponseListener)
for more information.Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeAdvertisingChannels
Writes the advertising channels that are used for the Bluetooth advertising.ResponseData:
BlukiiDataItem Type
-Integer
Values:
Channel 1: 0x01
Channel 2: 0x02
Channel 3: 0x04
- Parameters:
channels
- bitwise set of channels 1, 2 and 3responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readDelayedConnectionParameter
Reads the delayed parameter set for the connection.See
writeDelayedConnectionParameter(ConnectionParameter, ResponseListener)
for more information.ResponseData:
BlukiiDataItem Type
-ConnectionParameter
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeDelayedConnectionParameter
public void writeDelayedConnectionParameter(ConnectionParameter connectionParameter, @NonNull ResponseListener responseListener) Writes the delayed parameter set for the connection.The initial connection parameters (defined by the connected master device} are changing to the delayed connection parameters after the connection parameter delay (see
readConnectionParameterDelay(ResponseListener)
. It stays active until the blukii is disconnected.Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-ConnectionParameter
- Parameters:
connectionParameter
- Parameter of connectionresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readConnectionParameterDelay
Reads the connection parameter delay (in seconds).See
writeConnectionParameterDelay(int, ResponseListener)
for more information.Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeConnectionParameterDelay
Writes the connection parameter delay (in seconds).After the connection parameter delay, the initial connection parameters (defined by the connected master device} are changing to the delayed connection parameters (see
readDelayedConnectionParameter(ResponseListener)
.Value range:
0 - 65535 s
Note: If this value is
0
, the initial connection parameters stay active without changing.Note:
SmartBeacon
does not support this request.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
delay
- connection parameter delay (in seconds)responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readCurrentConnectionParameter
Reads the current parameter set for the connection.See
writeCurrentConnectionParameter(ConnectionParameter, ResponseListener)
for more information.ResponseData:
BlukiiDataItem Type
-CurrentConnectionParameter
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeCurrentConnectionParameter
public void writeCurrentConnectionParameter(ConnectionParameter connectionParameter, @NonNull ResponseListener responseListener) Writes the current parameter set for the connection for a immediate change of the connection parameters.Value ranges:
- interval min:
10 - 4000 ms
- interval max:
10 - 4000 ms
- latency:
0 - 499 ms
- timeout:
100 - 32000 ms
ResponseData:
BlukiiDataItem Type
-ConnectionParameter
- Parameters:
connectionParameter
- Parameter of connectionresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
- interval min:
-
readTxPower
Reads the Bluetooth TxPower strength.See
writeTxPower(short, ResponseListener)
for more information.ResponseData:
BlukiiDataItem Type
-Short
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeTxPower
Writes the Bluetooth TxPower strength.Value range:
- defined values between:
-21 dBm - 5 dBm
- see constant array
SETTING_BLUETOOTH_TXPOWER_VALUES_003
andSETTING_BLUETOOTH_TXPOWER_VALUES_007
This request is not supported for SmartBeacon with Eddystone Feature
isSmartBeacon()
. There you have to useSmartBeacon.writeEddystoneTxPowerMode(int, ResponseListener)
instead.ResponseData:
BlukiiDataItem Type
-Short
- Parameters:
value
- TxPower value in dBmresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
- defined values between:
-
readLimitedAdvertising
Reads the limited advertising delay (in seconds) after pushing the blukii button.See
writeLimitedAdvertising(int, ResponseListener)
for more information.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeLimitedAdvertising
Writes the limited advertising delay (in seconds) after pushing the blukii button.Value range:
0
: limited advertising is off (unlimited advertising)1 - 1800 s
: the blukii is advertising (connectable frames) for the defined delay after the blukii button has been pushed
Note: After re-inserting the battery the advertising is always active for at least 30 seconds!
This request is only supported for blukii
SmartKey
s that's hardware includes a push button.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
delay
- limited advertising delay (in seconds)responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeSystemReset
Initiates a system reset command.You can choose between different modes:
SETTING_BLUKII_SYSTEM_RESET_REBOOT
- reboots deviceSETTING_BLUKII_SYSTEM_RESET_FACTORY_DATA_RESET
- resets the actual settings to factory settings and reboots deviceSETTING_BLUKII_SYSTEM_RESET_FACTORY_DATA_UPDATE
- overwrites the factory settings with the actual settings (for admins only)SETTING_BLUKII_SYSTEM_RESET_FACTORY_IMAGE_RESET
- resets the firmware to factory image version and reboots device (for admins only)SETTING_BLUKII_SYSTEM_RESET_FACTORY_FLASH_RESET
- resets the external flash and reboot device (for admins only)
Note: The real time clock is reset after reboot see
readRTC(ResponseListener)
Note: In some cases
ResponseListener.onResponse(ResponseData)
will not be called. Disconnection of blukii device indicates that reboot has been started successfully. The system reset command mode is returned on callbackConnectionListener.onDisconnected(DisconnectReason)
as parameter.- Parameters:
mode
- system reset command moderesponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called
-
initiatePairing
Initiates a pairing request from the blukii to the master device.If blukii is paired already the master device shows the pairing request as dialog or notification.
If the pairing key is typed in correctly the success status will be notified on callback
ResponseListener.onNotify(ResponseData)
.This request is only supported for
SmartKey
.ResponseData:
- initially via onResponse:
BlukiiDataItem Type
-null
- success via onNotify:
BlukiiDataItem Type
-Boolean
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
- initially via onResponse:
-
readStateCounter
Reads the amount of reboots and connections that has been occurred after the counter reset byresetStateCounter(ResponseListener)
.You can use this information to verify if there has been some unscheduled reboots or unauthenticated connections.
Note: The reboot counter increments if battery is removed. It doesn't increment if you make a reboot via
writeSystemReset(int, ResponseListener)
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
resetStateCounter
Resets the state counter of your blukii.See
readStateCounter(ResponseListener)
for more information.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readRTC
Reads the actual time from real time clock of your blukii.Note: If you use the secure beacon feature of
SmartBeacon
the real time clock is synced automatically while secure beacon activation. SeeSmartBeacon.syncSecureMode(ResponseListener)
for more information.Note: The real time clock will be reset to date/time
1/1/2000 00:00
when blukii is rebooted. CallsyncRTC(ResponseListener)
for setting to actual date/time.This request is not supported for
SmartKey
.ResponseData:
BlukiiDataItem Type
-Calendar
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
syncRTC
Sets the blukii's real time clock to actual time.The actual time is read from the master device.
See
readRTC(ResponseListener)
for more information.Note: If you use the secure beacon feature of
SmartBeacon
the real time clock is synced automatically while secure beacon activation. SeeSmartBeacon.syncSecureMode(ResponseListener)
for more information.This request is not supported for
SmartKey
.ResponseData:
BlukiiDataItem Type
-Calendar
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeLEDMode
Activates/deactivates LED of your blukii.You have to define the mode (off, blink or permanent) and the amount of blinks or time.
Note: LED Mode is write only.
This request is only supported for
SmartKey
.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
mode
- LED mode - available values:SETTING_BLUKII_LED_OFF
,SETTING_BLUKII_LED_FLASH_1000
,SETTING_BLUKII_LED_FLASH_300
,SETTING_BLUKII_LED_FLASH_50
,SETTING_BLUKII_LED_ON_SECONDS
orSETTING_BLUKII_LED_ON_MINUTES
count
- amount of blinks or timeresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readSecureConnect
Reads the state of secure connect.Secure connect can be enabled or disabled.
See
writeSecureConnect(boolean, ResponseListener)
for more information.ResponseData:
BlukiiDataItem Type
-Boolean
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeSecureConnect
Enables/Disables secure connect on your blukii.Possible values:
true
to enablefalse
to disable
ResponseData:
BlukiiDataItem Type
-Boolean
- Parameters:
state
-true
to enable Secure Connect,false
to disable Secure ConnectresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeSecureKey
Sets secure key of your blukii.Note: Secure Key is write only.
ResponseData:
BlukiiDataItem Type
-null
- Parameters:
secureKey
- 32 byte hex stringresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readBatteryLevel
Read the battery level percentage of your blukii.ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readBatteryType
Gets the battery type of your blukii.Possible values:
SETTING_BLUKII_BATTERY_TYPE_3000
Batteries with max 3000 mVSETTING_BLUKII_BATTERY_TYPE_3300
Batteries with max 3300 mVSETTING_BLUKII_BATTERY_TYPE_3600
Batteries with max 3600 mV
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeBatteryType
Sets the battery type of your blukii.Possible values:
SETTING_BLUKII_BATTERY_TYPE_3000
Batteries with max 3000 mVSETTING_BLUKII_BATTERY_TYPE_3300
Batteries with max 3300 mVSETTING_BLUKII_BATTERY_TYPE_3600
Batteries with max 3600 mV
ResponseData:
BlukiiDataItem Type
-Integer
- Parameters:
value
- battery type:SETTING_BLUKII_BATTERY_TYPE_3000
,SETTING_BLUKII_BATTERY_TYPE_3300
orSETTING_BLUKII_BATTERY_TYPE_3600
,responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readEnergySaveSettings
Gets the energy save settings.ResponseData:
BlukiiDataItem Type
-EnergySaveSettings
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeEnergySaveSettings
public void writeEnergySaveSettings(@NonNull EnergySaveSettings settings, @NonNull ResponseListener responseListener) Sets the energy save settings.ResponseData:
BlukiiDataItem Type
-EnergySaveSettings
- Parameters:
settings
- energy save settingsresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
readTemperature
Reads the calibrated value of the temperature sensor.See
writeTemperature(float, ResponseListener)
for more information.The sensor value is returned as float value via ResponseListener callback. If value is
Float.MIN_VALUE
no temperature sensor is existing.Note:
SmartKey
does not support this request.ResponseData:
BlukiiDataItem Type
-Float
- Parameters:
responseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-
writeTemperature
Writes the actual sensor temperature.Use this function to calibrate the blukii's temperature sensor.
Value range:
-3.276,7 °C - +3.267,7 °C
step: 0,1 °C
Sensor offset reset: You can reset the temperature sensor to default by setting
Float.MIN_VALUE
as temperature value.Note:
SmartKey
does not support this request.ResponseData:
BlukiiDataItem Type
-Float
- Parameters:
temperature
- temperature value in °CresponseListener
-ResponseListener
on which callbacksonResponse
,onError
oronNotify
are called- See Also:
-