User's Manual

Enhanced Class 1 Bluetooth v2.1 Module
User’s Guide
Americas: +1-800-492-2320 Option 2
Europe: +44-1628-858-940
Hong Kong: +852-2923-0610
www.lairdtech.com/wireless
179
CONN-GUIDE-BT740_v0.2
As you can see, the host is able to determine if SSP or legacy pairing is in progress because in the
former the challenge message is “PASSKEY?” whereas in the latter it is “PIN ?”. In the ‘just works’
scenario the PAIR 0 message informs the host that a pairing is complete.
14.7.4.4 Host processing of the “PASSKEY? N” response
The full format of the PASSKEY? message to the host is:
PASSKEY? N <bd_addr>[,passcode]
N is 1, 2, or 3 and “,passcode” is not present when N=3.
When N=1, this message requires the host to just display the passcode. The module does not expect any
confirmation from the host.
When N=2, this message requires the host to display the passcode so that the user can accept or reject
the pairing. The host sends the AT+BTKY command to accept the pairing, and to reject it sends
AT+BTKN.
When N=3, the passcode is not provided and the host submits the AT+BTK=”passcode” command. To
reject, it can send any value not matching the passcode displayed at the remote end OR send
AT+BTK=””.
In the case of pairing where the I/O capability is none, the pairing occurs with ‘just works’ procedure
where both ends automatically accept the pairing. In this case the module becomes aware that the pairing
happened when it receives the “PAIR N <bd_addr>” response.
14.7.4.5 GPIO Access via SReg 619 and 620
The GPIO can be read and written to in AT mode via S registers 619 and 620.
SReg 620 reads the current states of all GPIO pins and displays as hex value with a ‘&’ prefix.
To write to output pins, a nonzero mask MUST first write to S register 619.
Subsequently, any value written to S Reg 620 only affects GPIO pins which have a corresponding bit in S
Reg 619 set to 1.
14.7.5 GPIO Exchange via RFCOMM Modem Signalling
There is a modem signalling message in an SPP connection that exchanges between peers. It conveys
the status of 4 bits called RTR, RTC, DV, and IC, which normally map to DTR/DSR, RTS/CTS, DCD and
RI respectively. This on-air message is transparent and happens in the ‘background’ as and when
required.
The firmware in the module allows GPIO to map to those 4 bits. In total 8 GPIO pins can be mapped: 4
for inputs mapped to the bits that are sent to the peer, and 4 for outputs updated when a modem
signalling message arrives from the peer.
It is not necessary to map all 8 bits and it is perfectly acceptable to have no pins mapped (which is the
default).
S Registers 651 to 654 inclusive specify OUTPUT pins which update when a modem signal message
arrives from a peer.
S Registers 661 to 664 inclusive specify INPUT pins which are monitored for changes of state, and when
detected result in a modem signal to be sent to the peer.