| Direct-BT
    2.3.1
    Direct-BT - Direct Bluetooth Programming. | 
 
 
 
Go to the documentation of this file.
   26 package org.direct_bt;
 
   66         public static PropertyType get(
final String name) 
throws IllegalArgumentException {
 
   77                 case (
byte) 0x01: 
return RESPONDER;
 
   78                 case (
byte) 0x02: 
return AUTH;
 
   79                 case (
byte) 0x04: 
return SC;
 
  107             final StringBuilder out = 
new StringBuilder();
 
  112                 if( 0 < count ) { out.append(
", "); }
 
  116                 if( 0 < count ) { out.append(
", "); }
 
  119             return "["+out.toString()+
"]";
 
  143         if( 
byte_size > ( source.length - pos ) ) {
 
  144             throw new IllegalArgumentException(
"Stream ( "+source.length+
" - "+pos+
" ) < "+
byte_size+
" bytes");
 
  172         if( 
byte_size > ( source.length - pos ) ) {
 
  173             throw new IllegalArgumentException(
"Stream ( "+source.length+
" - "+pos+
" ) < "+
byte_size+
" bytes");
 
  177         ediv[0]    = source[pos++];
 
  178         ediv[1]    = source[pos++];
 
  179         System.arraycopy(source, pos, 
rand, 0,  8); pos+=8;
 
  180         System.arraycopy(source, pos, 
ltk,  0, 16); pos+=16;
 
  194     public final void getStream(
final byte[] sink, 
int pos) {
 
  195         if( 
byte_size > ( sink.length - pos ) ) {
 
  196             throw new IllegalArgumentException(
"Stream ( "+sink.length+
" - "+pos+
" ) < "+
byte_size+
" bytes");
 
  200         sink[pos++] = 
ediv[0];
 
  201         sink[pos++] = 
ediv[1];
 
  202         System.arraycopy(
rand, 0, sink, pos,  8); pos+=8;
 
  203         System.arraycopy(
ltk,  0, sink, pos, 16); pos+=16;
 
  
void putStream(final byte[] source, int pos)
Method transfers all bytes representing a SMPLongTermKeyInfo from the given source array at the given...
boolean isSet(final PropertyType bit)
static final int byte_size
Size of the byte stream representation in bytes (28)
byte rand[]
Random Number, 8 octets or 64 bits.
SMP Long Term Key Info, used for platform agnostic persistence.
NONE
No specific property.
SMPLongTermKeyInfo Property Bits
SMPLongTermKeyInfo PropertyType Bit Mask
byte enc_size
Encryption Size, 1 octets or 8 bits.
byte mask
The PropertyType bit mask.
final boolean isResponder()
SMPLongTermKeyInfo(final byte source[], final int pos)
Construct instance via given source byte array.
RESPONDER
Responder Key (LL slave).
byte ltk[]
Long Term Key (LTK), 16 octets or 128 bits.
byte ediv[]
Encryption Diversifier, 2 octets or 16 bits.
Properties properties
Properties bit mask.
static String bytesHexString(final byte[] bytes, final int offset, final int length, final boolean lsbFirst)
Produce a lower-case hexadecimal string representation of the given byte values.
SC
Secure Connection used.
PropertyType(final byte v)
final void getStream(final byte[] sink, int pos)
Method transfers all bytes representing this instance into the given destination array at the given p...
SMPLongTermKeyInfo()
Construct emoty unset instance.