mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	other way
This commit is contained in:
		| @@ -65,6 +65,12 @@ void BluetoothConnection::send_service_for_discovery_() { | |||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   // Early return if no API connection | ||||||
|  |   auto *api_conn = this->proxy_->get_api_connection(); | ||||||
|  |   if (api_conn == nullptr) { | ||||||
|  |     return; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   // Send next service |   // Send next service | ||||||
|   esp_gattc_service_elem_t service_result; |   esp_gattc_service_elem_t service_result; | ||||||
|   uint16_t service_count = 1; |   uint16_t service_count = 1; | ||||||
| @@ -174,10 +180,8 @@ void BluetoothConnection::send_service_for_discovery_() { | |||||||
|   } |   } | ||||||
|   resp.services.push_back(std::move(service_resp)); |   resp.services.push_back(std::move(service_resp)); | ||||||
|  |  | ||||||
|   auto *api_conn = this->proxy_->get_api_connection(); |   // Send the message (we already checked api_conn is not null at the beginning) | ||||||
|   if (api_conn != nullptr) { |   api_conn->send_message(resp, api::BluetoothGATTGetServicesResponse::MESSAGE_TYPE); | ||||||
|     api_conn->send_message(resp, api::BluetoothGATTGetServicesResponse::MESSAGE_TYPE); |  | ||||||
|   } |  | ||||||
| } | } | ||||||
|  |  | ||||||
| bool BluetoothConnection::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, | bool BluetoothConnection::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user