Class ApplicationKey
java.lang.Object
org.openremote.agent.protocol.bluetooth.mesh.ApplicationKey
- All Implemented Interfaces:
Cloneable
Wrapper class for application key
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionApplicationKey(int keyIndex, @javax.validation.constraints.NotNull byte[] key) Constructs a ApplicationKey object with a given key index and network key -
Method Summary
Modifier and TypeMethodDescriptionclone()protected booleandistributeKey(@javax.validation.constraints.NotNull byte[] key) booleanintgetAid()intReturns the index of the associated netkeyintgetId()byte[]getKey()Returns the application keyintReturns the application key indexReturns the meshUuid of the Mesh networkgetName()Returns a friendly name of the application keyintbyte[]Returns the old app keyvoidsetBoundNetKeyIndex(int boundNetKeyIndex) Set the net key index to which the app key is associated withvoidsetId(int id) voidsetKey(@javax.validation.constraints.NotNull byte[] key) Sets a network key.voidsetKeyIndex(int keyIndex) Sets the key index of network keyvoidsetMeshUuid(String meshUuid) Sets the meshUuid of the mesh network to this application keyvoidSets a friendly name of the application keyvoidsetOldKey(byte[] oldKey) Set the old keyprotected booleanvalid(@javax.validation.constraints.NotNull byte[] key)
-
Field Details
-
id
protected int id -
meshUuid
-
keyIndex
protected int keyIndex -
name
-
key
protected byte[] key -
oldKey
protected byte[] oldKey
-
-
Constructor Details
-
ApplicationKey
public ApplicationKey(int keyIndex, @NotNull @javax.validation.constraints.NotNull byte[] key) Constructs a ApplicationKey object with a given key index and network key- Parameters:
keyIndex- 12-bit app key indexkey- 16-byte app key
-
-
Method Details
-
getBoundNetKeyIndex
public int getBoundNetKeyIndex()Returns the index of the associated netkey- Returns:
- network key index
-
setBoundNetKeyIndex
public void setBoundNetKeyIndex(int boundNetKeyIndex) Set the net key index to which the app key is associated with- Parameters:
boundNetKeyIndex- network key index
-
setKey
public void setKey(@NotNull @javax.validation.constraints.NotNull byte[] key) Sets a network key.In order to change the key call
BaseMeshNetwork.updateNetKey(NetworkKey, String)orBaseMeshNetwork.updateAppKey(ApplicationKey, String))}}- Parameters:
key- 16-byte network key
-
setOldKey
public void setOldKey(byte[] oldKey) Set the old key- Parameters:
oldKey- old app key
-
getAid
public int getAid() -
getOldAid
public int getOldAid() -
clone
- Throws:
CloneNotSupportedException
-
getId
public int getId() -
setId
public void setId(int id) -
getMeshUuid
Returns the meshUuid of the Mesh network- Returns:
- String meshUuid
-
setMeshUuid
Sets the meshUuid of the mesh network to this application key- Parameters:
meshUuid- mesh network meshUuid
-
getName
Returns a friendly name of the application key- Returns:
- string containing the name
-
setName
Sets a friendly name of the application key- Parameters:
name- friendly name for the application key- Throws:
IllegalArgumentException
-
getKey
public byte[] getKey()Returns the application key- Returns:
- 16 byte application key
-
getKeyIndex
public int getKeyIndex()Returns the application key index- Returns:
- key index
-
setKeyIndex
public void setKeyIndex(int keyIndex) Sets the key index of network key- Parameters:
keyIndex- index
-
getOldKey
public byte[] getOldKey()Returns the old app key- Returns:
- old key
-
equals
-
valid
protected boolean valid(@NotNull @javax.validation.constraints.NotNull byte[] key) -
distributeKey
protected boolean distributeKey(@NotNull @javax.validation.constraints.NotNull byte[] key)
-