Apply known-peer policy to desktop BLE while keeping explicit hardware probes

This commit is contained in:
evgeny committed 2026-10-30 22:40:16 +01:00
1 parent 612b263891
commit ed98ce169e
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -175,7 +175,7 @@ static void service_link(struct ble_etcp_link* c) {
fail(c, "invitation-only connection expired");
}
}
if (!c->closed && !c->key_received && get_time_us() >= c->deadline) fail(c, "key exchange timeout");
if (!c->closed && !c->key_received && !c->invitation_only && get_time_us() >= c->deadline) fail(c, "key exchange timeout");
if (c->closed) {
changed(c);
if (!c->bound) destroy_link(c);
+1 -1
View File
@@ -105,7 +105,7 @@ int main(int argc, char** argv) {
}
struct ble_config c = {.node_id = instance->node_id, .company_id = 0xffff};
c.callbacks.status = status; c.callbacks.connection = connection;
driver = ble_etcp_create(ua, instance, &c);
driver = ble_etcp_create(ua, instance, &c, 0); /* Изолированная аппаратная проба без таблицы участников. */
if (!driver || etcp_bind(instance, ETCP_ID_BLE_PROBE, receive) || ble_start(ble_etcp_radio(driver))) failed = 1;
uint64_t end = get_time_us() + (uint64_t)seconds * 1000000, peer = 0, retry = 0, next_send = 0;
unsigned sent = 0;
+2 -2
View File
@@ -65,7 +65,7 @@ void DesktopBle::apply(int flags, const char* name) {
DEBUG_INFO(DEBUG_CATEGORY_DISCOVERY, "BLE desktop advertising=%d reason=%s", state, reason);
};
config.callbacks.validate = [](void*, ble_link_id link, uint64_t node) {
DEBUG_INFO(DEBUG_CATEGORY_DISCOVERY, "BLE desktop validation allow link=%llu node=%016llx",
DEBUG_INFO(DEBUG_CATEGORY_DISCOVERY, "BLE desktop GATT identity received link=%llu node=%016llx; ETCP admission pending",
(unsigned long long)link, (unsigned long long)node);
return 1;
};
@@ -77,7 +77,7 @@ void DesktopBle::apply(int flags, const char* name) {
(unsigned long long)link, (unsigned long long)node, state, reason);
};
m_snapshot.state = BLE_STARTING; m_snapshot.reason.clear();
m_driver = ble_etcp_create(m_ua, m_instance, &config);
m_driver = ble_etcp_create(m_ua, m_instance, &config, 1);
m_transport = ble_etcp_radio(m_driver);
if (!m_transport) {
m_snapshot.state = BLE_CLOSED; m_snapshot.reason = QStringLiteral("Could not create Bluetooth transport");