The next sections show how to make a P2P connection manually or automatically by profile, and the negotiation method before the WPS connection.
As stated in Section 10.2.3, the negotiation starts according to the intent and negotiation initiator parameters, but other parameters should be configured to finish this step successfully. These parameters influence the negotiation method and are supplied during the manual connection API command that comes from the host or when setting the profile for automatic connection. The negotiation method is done by the device without user interference.
There are two P2P negotiation methods to indicate the WPS phase that follows the negotiation:
- P2P push-button connection – Both sides negotiate with PBC method. Define SL_SEC_TYPE_P2P_PBC.
- P2P pin code connection – Divided to two options. PIN_DISPLAY looks for a pin to be written by its remote P2P. PIN_KEYPAD sends a pin code to its remote P2P.
- Define SL_SEC_TYPE_P2P_PIN_KEYPAD.
- Define SL_SEC_TYPE_P2P_ PIN_DISPLAY.
If no pin code is entered, the NWP auto-generates the pin code from the device MAC using the following method:
- Take the 7 ISB decimal digits in the device MAC address, and add checksum of those 7 digits to the LSB (total 8 digits). For example, if MAC is 03:4A:22:3B:FA:42
- Convert to decimal: ….:059:250:066
- Seven ISB decimal digits are: 9250066
- WPS Pin Checksum digit: 2
- Default pin code for this MAC: 92500662
There are two options to configure the negotiation method:
- Setting the value in secParams struct and sending it as a parameter through the manual connection command.
- For push-button: secParams.Type = SL_SEC_TYPE_P2P_PBC
- For pin code keypad: secParams.Type = SL_SEC_TYPE_ PIN_KEYPAD secParams.Key = 12345670
- For pin code diaplay: secParams.Type = SL_SEC_TYPE_ PIN_ DISPLAY secParams.Key = 12345670
- Sending the negotiation method defines and key as parameters through the P2P profile configuration.