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
pin_code
Pin_code
Return value
- ESP_OK : success - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - other : failed
Examples
esp_bt_gap_set_pin() is referenced by 14 libraries and example projects: