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, @jakarta.validation.constraints.NotNull byte[] key) Constructs a ApplicationKey object with a given key index and network key -
Method Summary
Modifier and TypeMethodDescriptionclone()
protected boolean
distributeKey
(@jakarta.validation.constraints.NotNull byte[] key) boolean
int
getAid()
int
Returns the index of the associated netkeyint
getId()
byte[]
getKey()
Returns the application keyint
Returns the application key indexReturns the meshUuid of the Mesh networkgetName()
Returns a friendly name of the application keyint
byte[]
Returns the old app keyvoid
setBoundNetKeyIndex
(int boundNetKeyIndex) Set the net key index to which the app key is associated withvoid
setId
(int id) void
setKey
(@jakarta.validation.constraints.NotNull byte[] key) Sets a network key.void
setKeyIndex
(int keyIndex) Sets the key index of network keyvoid
setMeshUuid
(String meshUuid) Sets the meshUuid of the mesh network to this application keyvoid
Sets a friendly name of the application keyvoid
setOldKey
(byte[] oldKey) Set the old keyprotected boolean
valid
(@jakarta.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 @jakarta.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 @jakarta.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 @jakarta.validation.constraints.NotNull byte[] key) -
distributeKey
protected boolean distributeKey(@NotNull @jakarta.validation.constraints.NotNull byte[] key)
-