public class SyncableKontaktDeviceConnection
extends java.lang.Object
KontaktDeviceConnection and KontaktCloud functionalities.
The syncable iBeacon connection allows for immediate pushes to both Bluetooth iBeacon and its
representation in kontakt.io Web API.| Modifier and Type | Class and Description |
|---|---|
static class |
SyncableKontaktDeviceConnection.SyncWriteBatchListener<T>
Abstract class used as listener to notify about batch updating device and syncing with REST API
|
static class |
SyncableKontaktDeviceConnection.SyncWriteListener
Abstract class used as listener to notify about updating device and syncing with REST API
|
| Constructor and Description |
|---|
SyncableKontaktDeviceConnection(android.content.Context context,
RemoteBluetoothDevice remoteBluetoothDevice,
IKontaktDeviceConnection.ConnectionListener connectionListener)
Instantiates a new Syncable Kontakt device connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyConfig(Config config,
SyncableKontaktDeviceConnection.SyncWriteBatchListener<Config> syncWriteBatchListener)
Applies pending configuration (
Config) for Beacon. |
void |
applySecureConfig(Config secureConfig,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Writes secure config and tries to sync with REST API
|
void |
close()
Closes Beacon connection releases provided resources.
|
boolean |
connectToDevice()
Connects to beacon device
|
RemoteBluetoothDevice |
getDevice()
Gets devices that the connection is established with.
|
boolean |
isConnectedToDevice()
Returns true if Connection with Beacon is established.
|
boolean |
isDeviceAuthenticated()
Returns true if Beacon was successfully authenticated.
|
void |
overwriteAdvertisingInterval(long interval,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Writes advertising interval and tries to sync with REST API
|
void |
overwriteInstanceId(java.lang.String instanceId,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Overwrites instanceId
|
void |
overwriteMajor(int value,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Writes major value and tries to sync with REST API
|
void |
overwriteMinor(int value,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Writes minor value and tries to sync with REST API
|
void |
overwriteModelName(java.lang.String modelName,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Writes model name and tries to sync with REST API
|
void |
overwriteNamespace(java.lang.String namespaceId,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Overwrites namespae
|
void |
overwritePassword(java.lang.String password,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Writes password and tries to sync with REST API
|
void |
overwritePowerLevel(int value,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Writes power level and tries to sync with REST API
|
void |
overwriteProximityUUID(java.util.UUID proximityUUID,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Writes proximity uuid value and tries to sync with REST API
|
void |
overwriteUrl(java.lang.String url,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
Overwrites url
|
void |
resetDevice(WriteListener writeListener)
Resets device so that connection is established once again.
|
public SyncableKontaktDeviceConnection(android.content.Context context,
RemoteBluetoothDevice remoteBluetoothDevice,
IKontaktDeviceConnection.ConnectionListener connectionListener)
context - the contextremoteBluetoothDevice - the beacon deviceconnectionListener - the connection listenerpublic boolean connectToDevice()
public boolean isConnectedToDevice()
public void close()
public RemoteBluetoothDevice getDevice()
public boolean isDeviceAuthenticated()
public void overwriteMinor(int value,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
value - the minor value to setsyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwriteMajor(int value,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
value - the major valuesyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwritePowerLevel(int value,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
value - the power levelsyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwriteProximityUUID(java.util.UUID proximityUUID,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
proximityUUID - the proximity UUIDsyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwritePassword(java.lang.String password,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
password - the password for devicesyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwriteAdvertisingInterval(long interval,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
interval - advertising intervalsyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwriteModelName(java.lang.String modelName,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
modelName - model namesyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void resetDevice(WriteListener writeListener)
writeListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwriteUrl(java.lang.String url,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
url - the urlsyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwriteNamespace(java.lang.String namespaceId,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
namespaceId - the namespacesyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void overwriteInstanceId(java.lang.String instanceId,
SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
instanceId - the instanceIdsyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListenerpublic void applyConfig(Config config, SyncableKontaktDeviceConnection.SyncWriteBatchListener<Config> syncWriteBatchListener)
Config) for Beacon.
config - ConfigsyncWriteBatchListener - SyncableKontaktDeviceConnection.SyncWriteBatchListenerpublic void applySecureConfig(Config secureConfig, SyncableKontaktDeviceConnection.SyncWriteListener syncWriteListener)
secureConfig - the secureConfigsyncWriteListener - SyncableKontaktDeviceConnection.SyncWriteListener