3.2 Server Details

The role of the server in the Bluetooth pairing process is as follows:

  1. The server creates an RFCOMM port and waits for clients to connect by using an unauthenticated RFCOMM connection to execute the Automatic Bluetooth Pairing Protocol.

  2. The server executes a strict state machine to authenticate the Bluetooth pairing.

  3. When a client has connected, the server waits for the client to send a PairingRequired message (section 2.2.3.2). When this message is received, the server responds by sending a ReadyToPair message (section 2.2.3.4) to the client and waits for the client to initiate the Bluetooth pairing with a numeric comparison procedure.

  4. After the pairing has been initiated and the numeric value to authenticate the pairing is available, the server initiates challenge/response authentication by generating a random challenge value and sending it to the client by using a Challenge message (section 2.2.3.1). The server then waits for the client to return a Response message (section 2.2.3.5).

  5. After receiving the Response message, the server validates the response value. If the validation succeeds, the server completes the pairing with the client.

  6. The server waits for the client to perform challenge/response authentication by the client sending a Challenge message to the server. Upon receiving the Challenge message from the client, the server computes the corresponding response value and returns the value to the client by sending a Response message.

  7. The server then waits for the client to disconnect.

The server MAY handle multiple clients simultaneously by having an instance of the server role for each connected client.

Server state diagram

Figure 3: Server state diagram