Commit Graph

25 Commits

Author SHA1 Message Date
J. Nick Koston e6834f25ed Fix bulk and single Bluetooth parser coexistence (#5073) 2023-07-10 09:08:46 +12:00
Jesse Hills ce13979690 Bluetooth Proxy: Raw bundled advertisements (#4924) 2023-06-09 07:41:09 +12:00
J. Nick Koston 9ee661c1e4 Add ability to clear the gatt cache (#4621)
* Add ability to clear the gatt cache

With BlueZ we can fully clear the cache when something goes wrong with the services, however since this is also a cache on the ESP32 we need to be able to clear the on device cache as well for the proxies since if something goes wrong with the service resolution it can cache the bad resolution on NVS forever.

Our current client implementation is limited to clearing the memory cache in Home Assistant https://github.com/home-assistant/core/blob/89355e087952417a6824507fd3b197f9d0520e19/homeassistant/components/esphome/bluetooth/client.py#L512

related issue https://github.com/esphome/issues/issues/4156

https://github.com/esphome/aioesphomeapi/pull/410

* naming

* lint

* lint

* naming

* naming

* naming

* 88 now that 87 is taken

* make const

* Update esphome/components/api/api_frame_helper.cpp
2023-03-26 21:48:56 +00:00
Fredrik Gustafsson 29571a1acd implement pairing for bluetooth proxy (#4475)
* default to just-works encryption

This patch will turn on encryption when making active connections in order to comply with just-works BLE encryption.

* Revert "default to just-works encryption"

This reverts commit 05bc9e9f1cca9c41cbc7434379cbd5eb6dbb1034.

* implement pair method

* adhere to clang formatter

* fix oopsie

* bump bluetooth_proxy_version

* add auth callback

* generate new protos

* fix another oopsie

* add pairing status to connection

* clear paired on connect()

* lint

* add unpair ("forget") ble method

* compile protos

* fix oopsie

* add missing unpairing method

* add unpairing

* fix get_paired return type

* remove unused memcpy

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

* change to is_paired

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

* Update bluetooth_proxy.cpp

* actually add missing method

* send auth cb on set_encryption failure

* cleanup from havin the worst test setup

* lint

* match auth events to bd_addr

* add second addr check to auth cb

* add addr check to third auth cb

---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-03-06 18:04:35 +00:00
J. Nick Koston c47dc09d34 Speed up bluetooth proxy connections when using esp-idf (#4171) 2022-12-13 13:57:12 +13:00
J. Nick Koston 027284c29c Speed up uuid parsing when fetching the service list (#4121) 2022-11-30 10:11:48 +13:00
J. Nick Koston a59ce7bfa2 Avoid parsing services with v3 connections without cache (#4117)
Co-authored-by: Daniel Cousens <413395+dcousens@users.noreply.github.com>
Co-authored-by: Maurice Makaay <account+github@makaay.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-11-30 09:40:31 +13:00
J. Nick Koston 8414bb9a7a Active BLE connection v3 (#4113)
Co-authored-by: Daniel Cousens <413395+dcousens@users.noreply.github.com>
Co-authored-by: Maurice Makaay <account+github@makaay.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-11-30 07:53:32 +13:00
J. Nick Koston ccef7c322f Remove uuid lookups from BLE read/write/notify characteristics (#4102)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-11-29 17:30:19 +13:00
Jesse Hills 120327866f Send device address type alongside ble advertisements (#4115) 2022-11-29 17:24:21 +13:00
J. Nick Koston bc5c2d4eb4 Avoid parsing characteristics and descriptors to reduce memory pressure (#4109) 2022-11-29 17:16:25 +13:00
J. Nick Koston d5ff8f6117 Reduce memory needed to send the services list (#4110) 2022-11-29 17:14:29 +13:00
J. Nick Koston 873de13b3d Fix bluetooth_gatt_write_descriptor never getting a response (#4112) 2022-11-29 17:10:02 +13:00
J. Nick Koston 73c82862cf Improve reliability of bluetooth active connections (#4049)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-11-29 08:15:40 +13:00
J. Nick Koston 75573a3ed1 Fix descriptors not being deleted (#4104) 2022-11-29 07:49:41 +13:00
J. Nick Koston ac112a32c9 Add logging for BLE connection slots (#4098) 2022-11-28 13:39:35 +13:00
J. Nick Koston 9052947a71 Speed up BLE connections (#4093) 2022-11-28 13:30:05 +13:00
J. Nick Koston 53e0af18fb Make parse_characteristics and parse_descriptors lazy to reduce memory pressure (#4063) 2022-11-28 13:28:02 +13:00
Jesse Hills 9273e3775b Add vector includes (#4080) 2022-11-24 13:12:55 +13:00
Jesse Hills 0e66c899ce Allow multiple bluetooth proxy connections (#3971) 2022-11-02 23:02:33 +13:00
Jesse Hills 22e0a944c8 Update bluetooth proxy limit as soon as connection requested (#3935) 2022-10-25 12:54:10 +13:00
Jesse Hills 8bb670521d Remove address type map from bluetooth proxy (#3905) 2022-10-15 08:35:35 +13:00
Jesse Hills b34d24735a Send GATT error events to HA (#3884) 2022-10-12 22:22:07 +13:00
Jesse Hills ed443c6153 Bluetooth Proxy active connections (#3817) 2022-10-04 10:45:06 +13:00
Jesse Hills b854e17995 Initial bluetooth_proxy support (#3736) 2022-08-25 07:13:44 +12:00