Class ApplicationKey

java.lang.Object
org.openremote.agent.protocol.bluetooth.mesh.ApplicationKey
All Implemented Interfaces:
Cloneable

public final class ApplicationKey extends Object
Wrapper class for application key
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected byte[]
     
    protected int
     
    protected String
     
    protected String
     
    protected byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ApplicationKey(int keyIndex, @jakarta.validation.constraints.NotNull byte[] key)
    Constructs a ApplicationKey object with a given key index and network key
  • Method Summary

    Modifier and Type
    Method
    Description
     
    protected boolean
    distributeKey(@jakarta.validation.constraints.NotNull byte[] key)
     
    boolean
     
    int
     
    int
    Returns the index of the associated netkey
    int
     
    byte[]
    Returns the application key
    int
    Returns the application key index
    Returns the meshUuid of the Mesh network
    Returns a friendly name of the application key
    int
     
    byte[]
    Returns the old app key
    void
    setBoundNetKeyIndex(int boundNetKeyIndex)
    Set the net key index to which the app key is associated with
    void
    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 key
    void
    setMeshUuid(String meshUuid)
    Sets the meshUuid of the mesh network to this application key
    void
    setName(@NotNull String name)
    Sets a friendly name of the application key
    void
    setOldKey(byte[] oldKey)
    Set the old key
    protected boolean
    valid(@jakarta.validation.constraints.NotNull byte[] key)
     

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      protected int id
    • meshUuid

      protected String meshUuid
    • keyIndex

      protected int keyIndex
    • name

      protected String 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 index
      key - 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)
      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

      public String getMeshUuid()
      Returns the meshUuid of the Mesh network
      Returns:
      String meshUuid
    • setMeshUuid

      public void setMeshUuid(String meshUuid)
      Sets the meshUuid of the mesh network to this application key
      Parameters:
      meshUuid - mesh network meshUuid
    • getName

      public String getName()
      Returns a friendly name of the application key
      Returns:
      string containing the name
    • setName

      public void setName(@NotNull @NotNull String name) throws IllegalArgumentException
      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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • valid

      protected boolean valid(@NotNull @jakarta.validation.constraints.NotNull byte[] key)
    • distributeKey

      protected boolean distributeKey(@NotNull @jakarta.validation.constraints.NotNull byte[] key)