esp_ble_gatts_create_service() function
Create a GATT Server service
Arguments
gatts_if
GATT Server access interface
service_id
The pointer to the Service ID
num_handle
The number of handles requested for this service.
Return value
- ESP_OK: Success - ESP_FAIL: Failure
Notes
1. This function triggers `ESP_GATTS_CREATE_EVT`. 2. `num_handle` should not be greater than CONFIG_BT_GATT_MAX_SR_ATTRIBUTES.
esp_ble_gatts_create_service() calls 2 functions:
![]()
esp_ble_gatts_create_service()
esp_ble_gatts_create_service() reads 6 variables and writes 5 variables:
![]()
esp_ble_gatts_create_service()