Datasheet

Page 124 of 161
nRF8001 Product Specification
Revision 1.2
24.21 SetKey (0x1A)
SetKey sets the passkey that is used in the pairing procedure. This command should be sent after a Key
Request event has been received.
24.21.1 Functional Description
SetKey command is used only if the security I/O settings (see section 22.4.5 on page 86) are set to
indicate to the peer device that MITM security is required. If MITM is not required then I/O settings should
be set so that the security level is Just Works security.
See the operating mode during which this command can be used in Table 31. on page 92
. The command
will return a command response event with status ACI_STATUS_ERROR_DEVICE_STATE_INVALID
when it is used in the incorrect mode.
24.21.2 Message Format
Table 64. ACI message structure for SetKey
24.21.3 Accepted values
Table 65. Accepted values for parameters, SetKey
24.21.4 Returned events
This command returns a CommandResponseEvent. Data returned in the event is:
Command code:
SetKey
Status: Success / Error code
Response data: None
Message field/
parameter
Value size
(bytes)
Data value Description
Header
Length
1 2, 8, or 18 Packet Length
Command
10x1A
SetKey
Content
KeyType
1
Which key to set
Key 0 or 6
The key to be used in the on-going pairing
process
Parameter Data value Description
KeyType
0x00 Invalid key: Reject key request
0x01 Passkey, 6 byte
Key If KeyType == 0x00
N/A (field not present)
If
KeyType == 0x01
Fixed 6 byte ASCII string representing the
passkey (no NULL termination, '0'-'9' digits
only) Examples: "000123", "999999