28import java.nio.ByteOrder;
30import org.jau.net.EUI48;
31import org.jau.util.BasicTypes;
69 public static PropertyType get(
final String name)
throws IllegalArgumentException {
80 case (
byte) 0x01:
return RESPONDER;
81 case (
byte) 0x02:
return AUTH;
109 final StringBuilder out =
new StringBuilder();
114 if( 0 < count ) { out.append(
", "); }
117 return "["+out.toString()+
"]";
159 public void get(
final byte[] source,
int pos) {
160 if(
byte_size > ( source.length - pos ) ) {
161 throw new IllegalArgumentException(
"Stream ( "+source.length+
" - "+pos+
" ) < "+
byte_size+
" bytes");
164 System.arraycopy(source, pos,
irk, 0, 16); pos+=16;
165 id_address =
new EUI48(source, pos, ByteOrder.nativeOrder()); pos+=6;
179 public final void put(
final byte[] sink,
int pos) {
180 if(
byte_size > ( sink.length - pos ) ) {
181 throw new IllegalArgumentException(
"Stream ( "+sink.length+
" - "+pos+
" ) < "+
byte_size+
" bytes");
184 System.arraycopy(
irk, 0, sink, pos, 16); pos+=16;
185 System.arraycopy(
id_address.b, 0, sink, pos, 6); pos+=6;
191 public native
boolean matches(
final EUI48 rpa);
196 ", id "+
id_address+
", irk "+BasicTypes.bytesHexString(
irk, 0, -1,
true )+
SMPIdentityResolvingKey PropertyType Bit Mask
byte mask
The PropertyType bit mask.
boolean isSet(final PropertyType bit)
SMP Identity Resolving Key, used for platform agnostic persistence.
final boolean isResponder()
EUI48 id_address
Identity Address for the IRK.
SMPIdentityResolvingKey()
Construct emoty unset instance.
static final int byte_size
Size of the byte stream representation in bytes.
Properties properties
Properties bit mask.
final void put(final byte[] sink, int pos)
Method transfers all bytes representing this instance into the given destination array at the given p...
native boolean matches(final EUI48 rpa)
Returns true if this IRK matches the given random private address (RPA).
SMPIdentityResolvingKey(final byte source[], final int pos)
Construct instance via given source byte array.
byte irk[]
Identity Resolving Key (IRK)
SMPIdentityResolvingKey Property Bits
NONE
No specific property.
RESPONDER
Responder Key (LL slave).
PropertyType(final byte v)