public class BluetoothPayloadUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte |
ADVERTISING_INTERVAL
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.15.
|
static byte |
APPEARANCE
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.12.
|
static byte |
COMPLETE_LOCAL_NAME
Bluetooth Core Specification:Vol.
|
static byte |
CONNECTION_INTERVAL
Bluetooth Core Specification:Vol.
|
static byte |
FLAG_BR_EDR_NOT_SUPPORTED
BR/EDR not supported.
|
static byte |
FLAG_LE_BR_EDR_CONTROLLER
Simultaneous LE and BR/EDR, Controller.
|
static byte |
FLAG_LE_BR_EDR_HOST
Simultaneous LE and BR/EDR, Host.
|
static byte |
FLAG_LE_GENERAL_DISC_MODE
LE General Discoverable Mode.
|
static byte |
FLAG_LE_LIMITED_DISC_MODE
LE Limited Discoverable Mode.
|
static byte |
FLAGS
Bluetooth Core Specification:Vol.
|
static byte |
FLAGS_LE_ONLY_GENERAL_DISC_MODE
LE General Discoverable Mode, BR/EDR not supported.
|
static byte |
FLAGS_LE_ONLY_LIMITED_DISC_MODE
LE Limited Discoverable Mode, BR/EDR not supported.
|
static byte |
MANUFACTURER_DATA
Bluetooth Core Specification:Vol.
|
static byte |
PUBLIC_TARGET_ADDRESS
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.13.
|
static byte |
RANDOM_TARGET_ADDRESS
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.14.
|
static byte |
SERVICE_DATA_UUID128
Core Specification Supplement, Part A, section 1.11.
|
static byte |
SERVICE_DATA_UUID16
Core Specification Supplement, Part A, section 1.11.
|
static byte |
SERVICE_DATA_UUID32
Core Specification Supplement, Part A, section 1.11.
|
static byte |
SERVICE_UUID128_FULL_LIST
Bluetooth Core Specification:Vol.
|
static byte |
SERVICE_UUID128_PARTIAL_LIST
Bluetooth Core Specification:Vol.
|
static byte |
SERVICE_UUID16_FULL_LIST
Bluetooth Core Specification:Vol.
|
static byte |
SERVICE_UUID16_PARTIAL_LIST
Bluetooth Core Specification:Vol.
|
static byte |
SERVICE_UUID32_FULL_LIST
Bluetooth Core Specification:Vol.
|
static byte |
SERVICE_UUID32_PARTIAL_LIST
Bluetooth Core Specification:Vol.
|
static byte |
SHORTENED_LOCAL_NAME
Bluetooth Core Specification:Vol.
|
static byte |
SOLICITATION_UUID128_LIST
Bluetooth Core Specification:Vol.
|
static byte |
SOLICITATION_UUID16_LIST
Bluetooth Core Specification:Vol.
|
static byte |
SOLICITATION_UUID32_LIST
Core Specification Supplement, Part A, section 1.10.
|
static byte |
TX_POWER_LEVEL
Bluetooth Core Specification:Vol.
|
static byte |
URI
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.18.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
appendPayload(byte type,
byte[] value,
byte[] payload)
Appends a new type to a payload.
|
static java.lang.Byte |
getByte(byte type,
byte[] payload)
Gets the byte of a type from the payload.
|
static byte[] |
getBytes(byte type,
byte[] payload)
Gets the value of a type from the payload.
|
static java.lang.String |
getString(byte type,
byte[] payload)
Gets the string value of a type from the payload.
|
static byte[] |
removePayload(byte type,
byte[] payload)
Remove a type from the payload.
|
public static final byte FLAGS
public static final byte SERVICE_UUID16_PARTIAL_LIST
public static final byte SERVICE_UUID16_FULL_LIST
public static final byte SERVICE_UUID32_PARTIAL_LIST
public static final byte SERVICE_UUID32_FULL_LIST
public static final byte SERVICE_UUID128_PARTIAL_LIST
public static final byte SERVICE_UUID128_FULL_LIST
public static final byte SHORTENED_LOCAL_NAME
public static final byte COMPLETE_LOCAL_NAME
public static final byte TX_POWER_LEVEL
public static final byte CONNECTION_INTERVAL
public static final byte SOLICITATION_UUID16_LIST
public static final byte SOLICITATION_UUID128_LIST
public static final byte SERVICE_DATA_UUID16
public static final byte PUBLIC_TARGET_ADDRESS
public static final byte RANDOM_TARGET_ADDRESS
public static final byte APPEARANCE
public static final byte ADVERTISING_INTERVAL
public static final byte SOLICITATION_UUID32_LIST
public static final byte SERVICE_DATA_UUID32
public static final byte SERVICE_DATA_UUID128
public static final byte URI
public static final byte MANUFACTURER_DATA
public static final byte FLAG_LE_LIMITED_DISC_MODE
public static final byte FLAG_LE_GENERAL_DISC_MODE
public static final byte FLAG_BR_EDR_NOT_SUPPORTED
public static final byte FLAG_LE_BR_EDR_CONTROLLER
public static final byte FLAG_LE_BR_EDR_HOST
public static final byte FLAGS_LE_ONLY_LIMITED_DISC_MODE
public static final byte FLAGS_LE_ONLY_GENERAL_DISC_MODE
public static byte[] getBytes(byte type, @NonNull byte[] payload)
type
- the type.payload
- the payload.null
if the type has not been found.public static java.lang.String getString(byte type, @NonNull byte[] payload)
type
- the type.payload
- the payload.null
if the type has not been found.public static java.lang.Byte getByte(byte type, @NonNull byte[] payload)
type
- the type.payload
- the payload.null
if the type has not been found or its length is more than 1.public static byte[] appendPayload(byte type, @NonNull byte[] value, @Nullable byte[] payload)
type
- the new type to append.value
- the bytes to append.payload
- the payload to append to.public static byte[] removePayload(byte type, byte[] payload)
type
- the type to remove.payload
- the payload to handle.