public class BluetoothUnlockPacket extends XBeeAPIPacket
The Bluetooth Unlock packet is used to authenticate a connection on the Bluetooth interface and unlock the processing of AT command frames.
The unlock process is an implementation of the SRP (Secure Remote Password) algorithm using the RFC5054 1024-bit group and the SHA-256 hash algorithm. The value of I is fixed to the username apiservice.
Upon completion, each side will have derived a shared session key which is used to communicate in an encrypted fashion with the peer. Additionally, a Modem Status frame - 0x8A with the status code 0x32 (Bluetooth Connected) is sent through the UART (if AP = 1 or 2). When an unlocked connection is terminated, a Modem Status frame with the status code 0x33 (Bluetooth Disconnected) is sent through the UART.
BluetoothUnlockResponsePacket,
XBeeAPIPacketNO_FRAME_ID| Constructor and Description |
|---|
BluetoothUnlockPacket(SrpStep srpStep,
byte[] data)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static BluetoothUnlockPacket |
createPacket(byte[] payload)
Creates a new
BluetoothUnlockPacket object from the given
payload. |
LinkedHashMap<String,String> |
getAPIPacketParameters()
Returns a map with the XBee packet parameters and their values.
|
byte[] |
getAPIPacketSpecificData()
Returns the XBee API packet specific data.
|
byte[] |
getData()
Retrieves the SRP data.
|
SrpStep |
getSrpStep()
Retrieves the SRP step.
|
boolean |
isBroadcast()
Returns whether or not the packet is a broadcast packet.
|
boolean |
needsAPIFrameID()
Returns whether the API packet needs API Frame ID or not.
|
void |
setData(byte[] data)
Sets the SRP data.
|
void |
setSrpStep(SrpStep srpStep)
Sets the SRP step.
|
checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, setFrameIDequals, generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, hashCode, parsePacket, parsePacket, toPrettyString, toStringpublic BluetoothUnlockPacket(SrpStep srpStep, byte[] data)
BluetoothUnlockPacket
object with the given parameters.srpStep - The SRP step.data - Data contained in the packet.NullPointerException - if srpStep == null or
if data == null.public static BluetoothUnlockPacket createPacket(byte[] payload)
BluetoothUnlockPacket object from the given
payload.payload - The API frame payload. It must start with the frame type
corresponding to a Bluetooth Unlock packet (0x2C).
The byte array must be in OperatingMode.API mode.IllegalArgumentException - if payload[0] != APIFrameType.BLE_UNLOCK.getValue() or
if payload.length < .NullPointerException - if payload == null.public LinkedHashMap<String,String> getAPIPacketParameters()
XBeeAPIPacketpublic byte[] getAPIPacketSpecificData()
XBeeAPIPacketThis does not include the frame ID if it is needed.
public byte[] getData()
setData(byte[])public SrpStep getSrpStep()
setSrpStep(SrpStep),
SrpSteppublic boolean isBroadcast()
XBeeAPIPacketisBroadcast in class XBeeAPIPackettrue if the packet is a broadcast packet, false
otherwise.public boolean needsAPIFrameID()
XBeeAPIPacketneedsAPIFrameID in class XBeeAPIPackettrue if the packet needs API Frame ID, false
otherwise.public void setData(byte[] data)
data - The new SRP data.NullPointerException - if data == null.getData()public void setSrpStep(SrpStep srpStep)
srpStep - The new SRP step.NullPointerException - if srpStep == null.getSrpStep(),
SrpStep© Copyright 2014 - 2019 Digi International Inc. All rights reserved.