mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 11:26:39 +00:00
[bluetooth_connection] Explicit pairing for rp2 (#18166)
This commit is contained in:
@@ -46,6 +46,16 @@ class MinimalConnection : public BLEGattConnection {
|
||||
void release_services() override {}
|
||||
};
|
||||
|
||||
TEST(BleGattClientContract, PairingDefaultsAreSafeForNonPairingBackends) {
|
||||
// pair() defaults to not-connected and on_pairing_result() to a no-op, so
|
||||
// a backend without pairing still answers the client through the dispatch.
|
||||
MinimalConnection conn;
|
||||
RecordingListener listener;
|
||||
conn.set_listener(&listener);
|
||||
EXPECT_EQ(conn.pair(), GATT_ERR_NOT_CONNECTED);
|
||||
listener.on_pairing_result(0); // must not crash: default body
|
||||
}
|
||||
|
||||
TEST(BleGattClientContract, MinimalImplementerCompilesAndRoutesEvents) {
|
||||
MinimalConnection connection;
|
||||
RecordingListener listener;
|
||||
|
||||
Reference in New Issue
Block a user