esp_bt_gap_set_pin() function
Set pin type and default pin code for legacy pairing.
Arguments
pin_type
Use variable or fixed pin. If pin_type is ESP_BT_PIN_TYPE_VARIABLE, pin_code and pin_code_len will be ignored, and ESP_BT_GAP_PIN_REQ_EVT will come when control requests for pin code. Else, will use fixed pin code and not callback to users.
pin_code_len
Length of pin_code
Return value
- ESP_OK : success - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - other : failed
![]()
esp_err_t esp_bt_gap_set_pin(esp_bt_pin_type_t pin_type, uint8_t pin_code_len, esp_bt_pin_code_t pin_code)
esp_bt_gap_set_pin() calls 2 functions:
![]()
esp_bt_gap_set_pin()
esp_bt_gap_set_pin() reads 10 variables and writes 5 variables:
![]()
esp_bt_gap_set_pin()