Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
A packed 48 bit EUI-48 identifier, formerly known as MAC-48 or simply network device MAC address (Media Access Control address). More...
Public Member Functions | |
EUI48 (final String str) throws IllegalArgumentException | |
Construct instance via given string representation. More... | |
EUI48 (final byte stream[], final int pos) | |
Construct instance via given source byte array. More... | |
EUI48 (final byte address[]) | |
Construct instance using the given address of the byte array. More... | |
EUI48 () | |
Construct empty unset instance. More... | |
final boolean | equals (final Object obj) |
final int | hashCode () |
void | clearHash () |
Method clears the cached hash value. More... | |
void | clear () |
Method clears the underlying byte array b and cached hash value. More... | |
final void | putStream (final byte[] source, final int pos) |
Method transfers all bytes representing a EUI48 from the given source array at the given position into this instance and clears its cached hash value. More... | |
final void | getStream (final byte[] sink, final int pos) |
Method transfers all bytes representing this instance into the given destination array at the given position. More... | |
BLERandomAddressType | getBLERandomAddressType (final BDAddressType addressType) |
Returns the BLERandomAddressType. More... | |
int | indexOf (final EUI48Sub needle) |
Finds the index of given EUI48Sub. More... | |
boolean | contains (final EUI48Sub needle) |
Returns true, if given EUI48Sub is contained in here. More... | |
final String | toString () |
Static Public Member Functions | |
static boolean | scanEUI48 (final String str, final EUI48 dest, final StringBuilder errmsg) |
Fills given EUI48 instance via given string representation. More... | |
Public Attributes | |
final byte | b [] |
The 6 byte EUI48 address. More... | |
Static Public Attributes | |
static final EUI48 | ANY_DEVICE = new EUI48( new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 } ) |
EUI48 MAC address matching any device, i.e. More... | |
static final EUI48 | ALL_DEVICE = new EUI48( new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff } ) |
EUI48 MAC address matching all device, i.e. More... | |
static final EUI48 | LOCAL_DEVICE = new EUI48( new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff } ) |
EUI48 MAC address matching local device, i.e. More... | |
A packed 48 bit EUI-48 identifier, formerly known as MAC-48 or simply network device MAC address (Media Access Control address).
Implementation caches the hash value hashCode(), hence users shall take special care when mutating the underlying data b, read its API notes.
Definition at line 37 of file EUI48.java.
org.direct_bt.EUI48.EUI48 | ( | final String | str | ) | throws IllegalArgumentException |
Construct instance via given string representation.
Implementation is consistent with toString().
str | a string of exactly 17 characters representing 6 bytes as hexadecimal numbers separated via colon "01:02:03:0A:0B:0C"
|
IllegalArgumentException | if given string doesn't comply with EUI48 |
Definition at line 100 of file EUI48.java.
org.direct_bt.EUI48.EUI48 | ( | final byte | stream[], |
final int | pos | ||
) |
Construct instance via given source byte array.
Definition at line 109 of file EUI48.java.
org.direct_bt.EUI48.EUI48 | ( | final byte | address[] | ) |
Construct instance using the given address of the byte array.
Definition at line 118 of file EUI48.java.
org.direct_bt.EUI48.EUI48 | ( | ) |
Construct empty unset instance.
Definition at line 126 of file EUI48.java.
void org.direct_bt.EUI48.clear | ( | ) |
Method clears the underlying byte array b and cached hash value.
Definition at line 190 of file EUI48.java.
void org.direct_bt.EUI48.clearHash | ( | ) |
boolean org.direct_bt.EUI48.contains | ( | final EUI48Sub | needle | ) |
Returns true, if given EUI48Sub is contained in here.
If the sub is zero, true is returned.
Definition at line 265 of file EUI48.java.
final boolean org.direct_bt.EUI48.equals | ( | final Object | obj | ) |
Definition at line 131 of file EUI48.java.
BLERandomAddressType org.direct_bt.EUI48.getBLERandomAddressType | ( | final BDAddressType | addressType | ) |
Returns the BLERandomAddressType.
If BDAddressType is BDAddressType::BDADDR_LE_RANDOM, method shall return a valid value other than BLERandomAddressType::UNDEFINED.
If BDAddressType is not BDAddressType::BDADDR_LE_RANDOM, method shall return BLERandomAddressType::UNDEFINED.
Definition at line 244 of file EUI48.java.
final void org.direct_bt.EUI48.getStream | ( | final byte[] | sink, |
final int | pos | ||
) |
Method transfers all bytes representing this instance into the given destination array at the given position.
Implementation is consistent with EUI48(byte[], int).
sink | the destination array |
pos | starting position in the destination array |
Definition at line 225 of file EUI48.java.
final int org.direct_bt.EUI48.hashCode | ( | ) |
Implementation uses a lock-free volatile cache.
Definition at line 155 of file EUI48.java.
int org.direct_bt.EUI48.indexOf | ( | final EUI48Sub | needle | ) |
Finds the index of given EUI48Sub.
Definition at line 255 of file EUI48.java.
final void org.direct_bt.EUI48.putStream | ( | final byte[] | source, |
final int | pos | ||
) |
Method transfers all bytes representing a EUI48 from the given source array at the given position into this instance and clears its cached hash value.
Implementation is consistent with EUI48(byte[], int).
source | the source array |
pos | starting position in the source array |
Definition at line 207 of file EUI48.java.
|
static |
Fills given EUI48 instance via given string representation.
Implementation is consistent with toString().
str | a string of exactly 17 characters representing 6 bytes as hexadecimal numbers separated via colon "01:02:03:0A:0B:0C"
|
dest | EUI48 to set its value |
errmsg | error parsing message if returning false |
Definition at line 74 of file EUI48.java.
final String org.direct_bt.EUI48.toString | ( | ) |
Returns the EUI48 string representation, exactly 17 characters representing 6 bytes as upper case hexadecimal numbers separated via colon
.
Definition at line 278 of file EUI48.java.
|
static |
EUI48 MAC address matching all device, i.e.
'ff:ff:ff:ff:ff:ff'.
Definition at line 41 of file EUI48.java.
|
static |
EUI48 MAC address matching any device, i.e.
'0:0:0:0:0:0'.
Definition at line 39 of file EUI48.java.
final byte org.direct_bt.EUI48.b[] |
The 6 byte EUI48 address.
If modifying, it is the user's responsibility to avoid data races.
Further, call clearHash() after mutation is complete.
Definition at line 52 of file EUI48.java.
|
static |
EUI48 MAC address matching local device, i.e.
'0:0:0:ff:ff:ff'.
Definition at line 43 of file EUI48.java.