public class BluetoothUnlockResponsePacket extends XBeeAPIPacket
The Bluetooth Unlock Response 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 |
|---|
BluetoothUnlockResponsePacket(SrpError srpError)
Class constructor.
|
BluetoothUnlockResponsePacket(SrpStep srpStep,
byte[] data)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static BluetoothUnlockResponsePacket |
createPacket(byte[] payload)
Creates a new
BluetoothUnlockResponsePacket 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.
|
SrpError |
getSrpError()
Retrieves the SRP error.
|
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 |
setSrpError(SrpError srpError)
Sets the SRP error.
|
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 BluetoothUnlockResponsePacket(SrpError srpError)
BluetoothUnlockResponsePacket object with the given error.srpError - The SRP error.NullPointerException - if srpError == null.SrpErrorpublic BluetoothUnlockResponsePacket(SrpStep srpStep, byte[] data)
BluetoothUnlockResponsePacket object with the given parameters.srpStep - The SRP step.data - Data contained in the packet.NullPointerException - if srpStep == null or
if data == null.SrpSteppublic static BluetoothUnlockResponsePacket createPacket(byte[] payload)
BluetoothUnlockResponsePacket object from the given
payload.payload - The API frame payload. It must start with the frame type
corresponding to a Bluetooth Unlock packet (0xAC).
The byte array must be in OperatingMode.API mode.IllegalArgumentException - if payload[0] != APIFrameType.BLE_UNLOCK_RESPONSE.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 SrpError getSrpError()
setSrpError(SrpError),
SrpErrorpublic 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.getData()public void setSrpError(SrpError srpError)
srpError - The new SRP error.NullPointerException - if srpError == null.getSrpError(),
SrpErrorpublic void setSrpStep(SrpStep srpStep)
srpStep - The new SRP step.NullPointerException - if srpStep == null.getSrpStep(),
SrpStep© Copyright 2014 - 2019 Digi International Inc. All rights reserved.