Klasse Blukii
- Bekannte direkte Unterklassen:
SmartBeacon,SmartPen
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 SmartBeacon 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 discovery 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 DiscoveryData object, that is retrieved
// from BlukiiClient.OnDiscoveryListener
BluetoothDevice bluetoothDevice = discoveryData.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 response value.
ResponseData.getStatus() shows if the call was successful.
Example Snippet
private void readTxPower() {
mBlukii.readTxPower(new ResponseListener() {
@Override
onResponse(ResponseData response) {
if(response.getStatus.equals(ResponseStatus.Success) {
int txPower = response.getData().getDeviceValue();
Log.i(TAG, "Read TxPower Success: " + txPower);
} else {
Log.e(TAG, "Read TxPower Error: + error.getErrorStatus());
}
}
}
}
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
if(response.getStatus.equals(ResponseStatus.Success) {
IBeacon iBeaconData = response.getData().getDeviceValue();
Log.i(TAG, "Write iBeacon Success");
} else {
Log.e(TAG, "Write iBeacon Error: + error.getErrorStatus());
}
onResponse(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 to manifest.
- 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.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungRepresents 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 intBattery type setting: Batteries with max 3300 mVstatic final intBattery type setting: Batteries with max 3000 mVstatic final intBattery type setting: Batteries with max 3300 mVstatic final intBattery type setting: Batteries with max 3600 mVstatic final intConnection event: triggers notification with current event statestatic final intConnection event: Offstatic final intConnection event: Onstatic final intLed color index: Bluestatic final intLed color index: Greenstatic final intLed color index: Redstatic final intLed event: Beacon Modestatic final intLed event: Button pushedstatic final intLed event: Power Save Modestatic final intLed event: Settings modestatic final intLed event: Special Event Calibrationstatic final intSystem reset mode: Factory data reset and rebootstatic final intSystem reset mode: Factory data update without reboot (admin user only)static final intReboot mode setting: Factory flash reset and reboot (admin user only)static final intSystem reset mode: Factory image reset and reboot (admin user only)static final intSystem reset mode: Default reboot -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleancheck(BlukiiAction action) Checks via action if function is callablebooleanChecks via action if function is callable Note: for internal use onlybooleanconnect(ConnectionListener connectionListener) Initiates a connection to the GATT server hosted on the blukii device.booleanconnect(ConnectionListener connectionListener, OfflineConnectionCallback offlineConnectionCallback) Initiates a connection to the GATT server hosted on the blukii device.voidDisconnects the connected blukii or cancel a pending connection.android.bluetooth.BluetoothDeviceGets the Bluetooth device that has been set on instantiation.Gets the name of bluetooth device.Gets the Blukii Data objectGets the user defined connection settings forconnect(ConnectionListener)request.intRetrieves the supported Led Events, based on the firmware version.Gets the sub type of this blukii.getType()Gets the type of this blukii.booleanisReady()Check whether device is ready for configuration.booleanChecks if current device is Sensor Beacon.booleanChecks if current device is Smart Beacon.booleanChecks if current device is Smart Pen.voidobserveConnectedEvents(NotificationListener notificationListener) Observes the connected events notifications.voidobserveCurrentConnectionParameter(NotificationListener notificationListener) Observes the current connection parameters.voidreadAdvertisingChannels(ResponseListener responseListener) Reads the advertising channels that are used for the Bluetooth advertising.voidreadAoaSettings(ResponseListener responseListener) Reads the angle of arrival advertising settings.voidreadBatteryLevel(ResponseListener responseListener) Read the battery level percentage of your blukii.voidreadBatteryType(ResponseListener responseListener) Gets the battery type of your blukii.voidreadBlukiiCommand(byte characteristic, byte command, ResponseListener responseListener) Sends a blukii read command to blukii service.voidreadConnectedEvents(ResponseListener responseListener) Reads the connected events settings.voidreadConnectionParameterDelay(ResponseListener responseListener) Reads the connection parameter delay (in seconds).voidreadCurrentConnectionParameter(ResponseListener responseListener) Reads the current parameter set for the connection.voidreadDelayedConnectionParameter(ResponseListener responseListener) Reads the delayed parameter set for the connection.voidreadEnergySaveSettings(ResponseListener responseListener) Gets the energy save settings.voidreadInitialAdvertisingInterval(ResponseListener responseListener) Reads the initial advertising interval (in milliseconds) that is active after reboot and disconnection.voidreadLedEvents(ResponseListener responseListener) Reads the led events configuration.voidreadRssi(ResponseListener responseListener) Reads the rssi value of the actual signal strengthvoidreadRTC(ResponseListener responseListener) Reads the actual time from real time clock of your blukii.voidreadSecureConnect(ResponseListener responseListener) Reads the state of secure connect.voidreadStateCounter(ResponseListener responseListener) Reads the amount of reboots and connections that has been occurred after the counter reset byresetStateCounter(ResponseListener).voidreadSystemTimeouts(ResponseListener responseListener) Gets the system timeouts settings.voidreadTemperature(ResponseListener responseListener) Reads the calibrated value of the temperature sensor.voidreadTxPower(ResponseListener responseListener) Reads the Bluetooth TxPower strength.voidrequestMtu(int mtu, ResponseListener responseListener) Requests a new MTU size.voidresetStateCounter(ResponseListener responseListener) Resets the state counter of your blukii.voidsyncRTC(ResponseListener responseListener) Sets the blukii's real time clock to actual time.voidupdateData(DataUpdateListener listener) Updates the blukii device with cloud configuration data.voidupdateFirmware(FirmwareUpdateListener listener) Updates the blukii device with new firmware.voidupdateFirmware(FirmwareUpdateListener listener, String targetFirmware) Updates the blukii device with new firmware.voidwriteAdvertisingChannels(int channels, ResponseListener responseListener) Writes the advertising channels that are used for the Bluetooth advertising.voidwriteAoaSettings(AoaSettings aoaSettings, ResponseListener responseListener) Sets the angle of arrival advertising settings.voidwriteBatteryType(int value, ResponseListener responseListener) Sets the battery type of your blukii.voidwriteBlukiiCommand(BlukiiCommand command, ResponseListener responseListener) Sends a blukii write command to blukii service.voidwriteConnectedEvents(int connectedEvents, ResponseListener responseListener) Sets the connected events settings.voidwriteConnectionParameterDelay(int delay, ResponseListener responseListener) Writes the connection parameter delay (in seconds).voidwriteCurrentConnectionParameter(ConnectionParameter connectionParameter, ResponseListener responseListener) Writes the current parameter set for the connection for a immediate change of the connection parameters.voidwriteDelayedConnectionParameter(ConnectionParameter connectionParameter, ResponseListener responseListener) Writes the delayed parameter set for the connection.voidwriteEnergySaveSettings(EnergySaveSettings settings, ResponseListener responseListener) Sets the energy save settings.voidwriteInitialAdvertisingInterval(int interval, ResponseListener responseListener) Writes the initial advertising interval (in milliseconds) that is active after disconnection.voidwriteLedAction(LedAction ledAction, ResponseListener responseListener) Starts a led blink signalvoidwriteLedEvents(LedEvents ledEvents, ResponseListener responseListener) Sets the led events configuration.voidwriteSecureConnect(boolean state, ResponseListener responseListener) Enables/Disables secure connect on your blukii.voidwriteSecureKey(String secureKey, ResponseListener responseListener) Sets secure key of your blukii.voidwriteSystemReset(int mode, ResponseListener responseListener) Initiates a system reset command.voidwriteSystemTimeouts(SystemTimeouts systemTimeouts, ResponseListener responseListener) Sets the system timeouts settings.voidwriteTemperature(float temperature, ResponseListener responseListener) Writes the actual sensor temperature.voidwriteTxPower(short value, ResponseListener responseListener) Writes the Bluetooth TxPower strength.
-
Felddetails
-
SETTING_BLUKII_BATTERY_TYPE_2700
public static final int SETTING_BLUKII_BATTERY_TYPE_2700Battery type setting: Batteries with max 3300 mV- Siehe auch:
-
SETTING_BLUKII_BATTERY_TYPE_3000
public static final int SETTING_BLUKII_BATTERY_TYPE_3000Battery type setting: Batteries with max 3000 mV- Siehe auch:
-
SETTING_BLUKII_BATTERY_TYPE_3300
public static final int SETTING_BLUKII_BATTERY_TYPE_3300Battery type setting: Batteries with max 3300 mV- Siehe auch:
-
SETTING_BLUKII_BATTERY_TYPE_3600
public static final int SETTING_BLUKII_BATTERY_TYPE_3600Battery type setting: Batteries with max 3600 mV- Siehe auch:
-
SETTING_BLUKII_SYSTEM_RESET_REBOOT
public static final int SETTING_BLUKII_SYSTEM_RESET_REBOOTSystem reset mode: Default reboot- Siehe auch:
-
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- Siehe auch:
-
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)- Siehe auch:
-
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)- Siehe auch:
-
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)- Siehe auch:
-
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 dBmNote: for 4 dBm and lower the SmartBeacon is in low power mode- Siehe auch:
-
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- Siehe auch:
-
SETTING_BLUKII_LED_COLOR_RED
public static final int SETTING_BLUKII_LED_COLOR_REDLed color index: Red- Siehe auch:
-
SETTING_BLUKII_LED_COLOR_GREEN
public static final int SETTING_BLUKII_LED_COLOR_GREENLed color index: Green- Siehe auch:
-
SETTING_BLUKII_LED_COLOR_BLUE
public static final int SETTING_BLUKII_LED_COLOR_BLUELed color index: Blue- Siehe auch:
-
SETTING_BLUKII_LED_EVENT_SETTINGS_MODE
public static final int SETTING_BLUKII_LED_EVENT_SETTINGS_MODELed event: Settings mode- Siehe auch:
-
SETTING_BLUKII_LED_EVENT_BEACON_MODE
public static final int SETTING_BLUKII_LED_EVENT_BEACON_MODELed event: Beacon Mode- Siehe auch:
-
SETTING_BLUKII_LED_EVENT_BUTTON_PUSHED
public static final int SETTING_BLUKII_LED_EVENT_BUTTON_PUSHEDLed event: Button pushed- Siehe auch:
-
SETTING_BLUKII_LED_EVENT_ENERGY_SAVE_MODE
public static final int SETTING_BLUKII_LED_EVENT_ENERGY_SAVE_MODELed event: Power Save Mode- Siehe auch:
-
SETTING_BLUKII_LED_EVENT_SPECIAL_EVENT_CALIBRATION
public static final int SETTING_BLUKII_LED_EVENT_SPECIAL_EVENT_CALIBRATIONLed event: Special Event Calibration- Siehe auch:
-
SETTING_BLUKII_CONNECTED_EVENT_OFF
public static final int SETTING_BLUKII_CONNECTED_EVENT_OFFConnection event: Off- Siehe auch:
-
SETTING_BLUKII_CONNECTED_EVENT_ON
public static final int SETTING_BLUKII_CONNECTED_EVENT_ONConnection event: On- Siehe auch:
-
SETTING_BLUKII_CONNECTED_EVENT_NOTIFY
public static final int SETTING_BLUKII_CONNECTED_EVENT_NOTIFYConnection event: triggers notification with current event state- Siehe auch:
-
FIRMWARE
Represents the actual firmware version of device.Note: only valid after connect
- Siehe auch:
-
HARDWARE
Represents the actual hardware version of device.Note: only valid after connect
-
-
Methodendetails
-
getType
Gets the type of this blukii.- Gibt zurück:
- type of blukii
- Siehe auch:
-
getSubType
Gets the sub type of this blukii.- Gibt zurück:
- sub type of blukii
- Siehe auch:
-
isSmartBeacon
public boolean isSmartBeacon()Checks if current device is Smart Beacon.- Gibt zurück:
trueif device is Smart Beacon, otherwisefalse
-
isSmartPen
public boolean isSmartPen()Checks if current device is Smart Pen.- Gibt zurück:
trueif device is Smart Pen, otherwisefalse
-
isSensorBeacon
public boolean isSensorBeacon()Checks if current device is Sensor Beacon.- Gibt zurück:
trueif device is Sensor Beacon, otherwisefalse
-
getBluetoothDevice
public android.bluetooth.BluetoothDevice getBluetoothDevice()Gets the Bluetooth device that has been set on instantiation.- Gibt zurück:
- actual Bluetooth Device
- Siehe auch:
-
getBluetoothDeviceName
Gets the name of bluetooth device.- Gibt zurück:
- actual device name
-
isReady
public boolean isReady()Check whether device is ready for configuration.- Gibt zurück:
trueif ready, otherwisefalse
-
getBlukiiData
Gets the Blukii Data object- Gibt zurück:
- a BlukiiData object
- Siehe auch:
-
getConnectionSettings
Gets the user defined connection settings forconnect(ConnectionListener)request. seeConnectionSettings- Gibt zurück:
- connection settings
-
connect
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public boolean connect(@NonNull ConnectionListener connectionListener) 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.- Parameter:
connectionListener- listener for connection state changes- Gibt zurück:
trueif the connection is initiated successfully, otherwisefalse- Siehe auch:
-
connect
@RequiresPermission("android.permission.BLUETOOTH_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- Parameter:
connectionListener- listener for connection state changesofflineConnectionCallback- callback necessary if secure connection must be established offline- Gibt zurück:
trueif the connection is initiated successfully, otherwisefalse- Siehe auch:
-
disconnect
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") 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.- Siehe auch:
-
updateData
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void updateData(@NonNull DataUpdateListener listener) 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.
- Parameter:
listener- DataUpdateLister for asynchronous update result
-
updateFirmware
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void updateFirmware(@NonNull FirmwareUpdateListener listener) 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().- Parameter:
listener- FirmwareUpdateListener for asynchronous update result
-
updateFirmware
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void updateFirmware(@NonNull FirmwareUpdateListener listener, String targetFirmware) 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().- Parameter:
listener- FirmwareUpdateListener for asynchronous update resulttargetFirmware- determined target firmware version (for admin logins only)
-
check
Checks via action if function is callable- Parameter:
action- Action to check- Gibt zurück:
trueif action is available for this blukii, otherwisefalse- Siehe auch:
-
check
Checks via action if function is callable Note: for internal use only- Parameter:
feature- feature to check- Gibt zurück:
trueif action is available for this blukii, otherwisefalse
-
readRssi
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readRssi(@NonNull ResponseListener responseListener) Reads the rssi value of the actual signal strengthResponseData:BlukiiDataItem Type-Short- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called *- Siehe auch:
-
readInitialAdvertisingInterval
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readInitialAdvertisingInterval(@NonNull ResponseListener responseListener) 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- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called *- Siehe auch:
-
writeInitialAdvertisingInterval
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") 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 msbetween100and2500 - steps of
2500 msbetween2500and10000 - Note: Values between this steps will be rounded down
ResponseData:BlukiiDataItem Type-Integer- Parameter:
interval- initial advertising interval (in milliseconds)responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readAdvertisingChannels
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readAdvertisingChannels(@NonNull ResponseListener responseListener) Reads the advertising channels that are used for the Bluetooth advertising.See
writeAdvertisingChannels(int, ResponseListener)for more information.Note:
SmartBeacondoes not support this request.ResponseData:BlukiiDataItem Type-Integer- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeAdvertisingChannels
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeAdvertisingChannels(int channels, @NonNull ResponseListener responseListener) Writes the advertising channels that are used for the Bluetooth advertising.ResponseData:BlukiiDataItem Type-IntegerValues:
Channel 1: 0x01Channel 2: 0x02Channel 3: 0x04
- Parameter:
channels- bitwise set of channels 1, 2 and 3responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readDelayedConnectionParameter
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readDelayedConnectionParameter(@NonNull ResponseListener responseListener) Reads the delayed parameter set for the connection.See
writeDelayedConnectionParameter(ConnectionParameter, ResponseListener)for more information.ResponseData:BlukiiDataItem Type-ConnectionParameter- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeDelayedConnectionParameter
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") 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:
SmartBeacondoes not support this request.ResponseData:BlukiiDataItem Type-ConnectionParameter- Parameter:
connectionParameter- Parameter of connectionresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readConnectionParameterDelay
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readConnectionParameterDelay(@NonNull ResponseListener responseListener) Reads the connection parameter delay (in seconds).See
writeConnectionParameterDelay(int, ResponseListener)for more information.Note:
SmartBeacondoes not support this request.ResponseData:BlukiiDataItem Type-Integer- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeConnectionParameterDelay
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeConnectionParameterDelay(int delay, @NonNull ResponseListener responseListener) 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:
SmartBeacondoes not support this request.ResponseData:BlukiiDataItem Type-Integer- Parameter:
delay- connection parameter delay (in seconds)responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
observeCurrentConnectionParameter
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void observeCurrentConnectionParameter(@NonNull NotificationListener notificationListener) Observes the current connection parameters.If the current connection parameters are updated then
NotificationListener.onNotify(ResponseData)is called.ResponseData:NotificationListener.onNotify(ResponseData):BlukiiDataItem Type-CurrentConnectionParameterSee
writeCurrentConnectionParameter(ConnectionParameter, ResponseListener)for more information.- Parameter:
notificationListener-NotificationListeneron which callbackonNotifyis called- Siehe auch:
-
readCurrentConnectionParameter
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readCurrentConnectionParameter(@NonNull ResponseListener responseListener) Reads the current parameter set for the connection.See
writeCurrentConnectionParameter(ConnectionParameter, ResponseListener)for more information.ResponseData:BlukiiDataItem Type-CurrentConnectionParameter- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeCurrentConnectionParameter
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") 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- Parameter:
connectionParameter- Parameter of connectionresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
- interval min:
-
requestMtu
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void requestMtu(int mtu, @NonNull ResponseListener responseListener) Requests a new MTU size.The MTU (Maximum Transfer Unit) specifies the number of bytes that can be sent within one GATT operation.
Note: The requested size is checked by the blukii device. The accepted size will be responded through callback #
ResponseListener.onResponse(ResponseData).Value range: 23 - 251
ResponseData:BlukiiDataItem Type-Integer- Parameter:
mtu- MTU sizeresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readTxPower
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readTxPower(@NonNull ResponseListener responseListener) Reads the Bluetooth TxPower strength.See
writeTxPower(short, ResponseListener)for more information.ResponseData:BlukiiDataItem Type-Short- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeTxPower
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeTxPower(short value, @NonNull ResponseListener responseListener) Writes the Bluetooth TxPower strength.Value range:
- defined values between:
-21 dBm - 5 dBm - see constant array
SETTING_BLUETOOTH_TXPOWER_VALUES_003andSETTING_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- Parameter:
value- TxPower value in dBmresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
- defined values between:
-
writeSystemReset
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeSystemReset(int mode, @NonNull ResponseListener responseListener) 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.- Parameter:
mode- system reset command moderesponseListener-ResponseListeneron which callbackonResponseis called
-
readStateCounter
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readStateCounter(@NonNull ResponseListener responseListener) 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- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
resetStateCounter
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void resetStateCounter(@NonNull ResponseListener responseListener) Resets the state counter of your blukii.See
readStateCounter(ResponseListener)for more information.ResponseData:BlukiiDataItem Type-Integer- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readRTC
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readRTC(@NonNull ResponseListener responseListener) Reads the actual time from real time clock of your blukii.Note: The real time clock will be reset to date/time
1/1/2000 00:00when blukii is rebooted. CallsyncRTC(ResponseListener)for setting to actual date/time.ResponseData:BlukiiDataItem Type-Calendar- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
syncRTC
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void syncRTC(@NonNull ResponseListener responseListener) 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.ResponseData:BlukiiDataItem Type-Calendar- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readSecureConnect
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readSecureConnect(@NonNull ResponseListener responseListener) Reads the state of secure connect.Secure connect can be enabled or disabled.
See
writeSecureConnect(boolean, ResponseListener)for more information.ResponseData:BlukiiDataItem Type-Boolean- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeSecureConnect
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeSecureConnect(boolean state, @NonNull ResponseListener responseListener) Enables/Disables secure connect on your blukii.Possible values:
trueto enablefalseto disable
ResponseData:BlukiiDataItem Type-Boolean- Parameter:
state-trueto enable Secure Connect,falseto disable Secure ConnectresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeSecureKey
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeSecureKey(String secureKey, @NonNull ResponseListener responseListener) Sets secure key of your blukii.Note: Secure Key is write only.
ResponseData:BlukiiDataItem Type-null- Parameter:
secureKey- 32 byte hex stringresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readBatteryLevel
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readBatteryLevel(@NonNull ResponseListener responseListener) Read the battery level percentage of your blukii.Possible values:
- 255: Battery level is not initialized yet
- 0 - 100: Battery level percentage
ResponseData:BlukiiDataItem Type-Integer- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readBatteryType
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readBatteryType(@NonNull ResponseListener responseListener) Gets the battery type of your blukii.Possible values:
SETTING_BLUKII_BATTERY_TYPE_2700Batteries with max 2700 mVSETTING_BLUKII_BATTERY_TYPE_3000Batteries with max 3000 mVSETTING_BLUKII_BATTERY_TYPE_3300Batteries with max 3300 mVSETTING_BLUKII_BATTERY_TYPE_3600Batteries with max 3600 mV
ResponseData:BlukiiDataItem Type-Integer- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeBatteryType
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeBatteryType(int value, @NonNull ResponseListener responseListener) Sets the battery type of your blukii.Possible values:
SETTING_BLUKII_BATTERY_TYPE_2700Batteries with max 2700 mVSETTING_BLUKII_BATTERY_TYPE_3000Batteries with max 3000 mVSETTING_BLUKII_BATTERY_TYPE_3300Batteries with max 3300 mVSETTING_BLUKII_BATTERY_TYPE_3600Batteries with max 3600 mV
ResponseData:BlukiiDataItem Type-Integer- Parameter:
value- battery type:SETTING_BLUKII_BATTERY_TYPE_3000,SETTING_BLUKII_BATTERY_TYPE_3300orSETTING_BLUKII_BATTERY_TYPE_3600,responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readEnergySaveSettings
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readEnergySaveSettings(@NonNull ResponseListener responseListener) Gets the energy save settings.ResponseData:BlukiiDataItem Type-EnergySaveSettings- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeEnergySaveSettings
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeEnergySaveSettings(@NonNull EnergySaveSettings settings, @NonNull ResponseListener responseListener) Sets the energy save settings.ResponseData:BlukiiDataItem Type-EnergySaveSettings- Parameter:
settings- energy save settingsresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readSystemTimeouts
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readSystemTimeouts(@NonNull ResponseListener responseListener) Gets the system timeouts settings.ResponseData:BlukiiDataItem Type-SystemTimeouts- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeSystemTimeouts
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeSystemTimeouts(@NonNull SystemTimeouts systemTimeouts, @NonNull ResponseListener responseListener) Sets the system timeouts settings.ResponseData:BlukiiDataItem Type-SystemTimeouts- Parameter:
systemTimeouts- system timeouts settingsresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readTemperature
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readTemperature(@NonNull ResponseListener responseListener) 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_VALUEno temperature sensor is existing.ResponseData:BlukiiDataItem Type-Float- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeTemperature
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeTemperature(float temperature, @NonNull ResponseListener responseListener) Writes the actual sensor temperature.Use this function to calibrate the blukii's temperature sensor.
Value range:
-3.276,7 °C - +3.267,7 °Cstep: 0,1 °C
Sensor offset reset: You can reset the temperature sensor to default by setting
Float.MIN_VALUEas temperature value.ResponseData:BlukiiDataItem Type-Float- Parameter:
temperature- temperature value in °CresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readLedEvents
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readLedEvents(@NonNull ResponseListener responseListener) Reads the led events configuration.See
writeLedEvents(LedEvents, ResponseListener)for more information.ResponseData:BlukiiDataItem Type-LedEvents- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeLedEvents
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeLedEvents(@NonNull LedEvents ledEvents, @NonNull ResponseListener responseListener) Sets the led events configuration.ResponseData:BlukiiDataItem Type-LedEvents- Parameter:
ledEvents- led events configurationresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
getLedEventsSelection
public int getLedEventsSelection()Retrieves the supported Led Events, based on the firmware version.Values: (Bitwise Set of following constants)
- Gibt zurück:
- supported Led Events
- Siehe auch:
-
writeLedAction
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeLedAction(@NonNull LedAction ledAction, @NonNull ResponseListener responseListener) Starts a led blink signalResponseData:BlukiiDataItem Type-LedAction- Parameter:
ledAction- led action configurationresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readAoaSettings
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readAoaSettings(@NonNull ResponseListener responseListener) Reads the angle of arrival advertising settings.See
writeAoaSettings(AoaSettings, ResponseListener)for more information.ResponseData:BlukiiDataItem Type-AoaSettings- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeAoaSettings
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeAoaSettings(@NonNull AoaSettings aoaSettings, @NonNull ResponseListener responseListener) Sets the angle of arrival advertising settings.ResponseData:BlukiiDataItem Type-AoaSettings- Parameter:
aoaSettings- angle of arrival advertising settingsresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
observeConnectedEvents
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void observeConnectedEvents(@NonNull NotificationListener notificationListener) Observes the connected events notifications.If an event is triggered then
NotificationListener.onNotify(ResponseData)is called.ResponseData:NotificationListener.onNotify(ResponseData):BlukiiDataItem Type-IntegerSee
writeConnectedEvents(int, ResponseListener)for more information.- Parameter:
notificationListener-NotificationListeneron which callbackonNotifyis called- Siehe auch:
-
readConnectedEvents
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readConnectedEvents(@NonNull ResponseListener responseListener) Reads the connected events settings.ResponseData:ResponseListener.onResponse(ResponseData):BlukiiDataItem Type-IntegerSee
writeConnectedEvents(int, ResponseListener)for more information.- Parameter:
responseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeConnectedEvents
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeConnectedEvents(int connectedEvents, @NonNull ResponseListener responseListener) Sets the connected events settings.ResponseData:BlukiiDataItem Type-IntegerValues:
SETTING_BLUKII_CONNECTED_EVENT_OFFSETTING_BLUKII_CONNECTED_EVENT_ONSETTING_BLUKII_CONNECTED_EVENT_NOTIFY
SETTING_BLUKII_CONNECTED_EVENT_NOTIFY, then the current event trigger is sent via notification. Therefore, you have to callobserveConnectedEvents(NotificationListener)in order to receive callbackonNotify. For all other value the connected event setting value will be saved to blukii device.- Parameter:
connectedEvents- connected events settingsresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
readBlukiiCommand
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void readBlukiiCommand(byte characteristic, byte command, @NonNull ResponseListener responseListener) Sends a blukii read command to blukii service.ResponseData:BlukiiDataItem Type-BlukiiCommand- Parameter:
characteristic- blukii service characteristic idcommand- blukii characteristic command idresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-
writeBlukiiCommand
@RequiresPermission("android.permission.BLUETOOTH_CONNECT") public void writeBlukiiCommand(BlukiiCommand command, @NonNull ResponseListener responseListener) Sends a blukii write command to blukii service.ResponseData:BlukiiDataItem Type-BlukiiCommand- Parameter:
command- blukii command ids and dataresponseListener-ResponseListeneron which callbackonResponseis called- Siehe auch:
-