feat(blemesh_manager): add generic BLE Mesh provisioner manager (IEC-555)#763
feat(blemesh_manager): add generic BLE Mesh provisioner manager (IEC-555)#763Junius00 wants to merge 1 commit into
Conversation
| * break unicast sends to provisioned nodes. The commissioning window | ||
| * is gated separately at the beacon-handling layer (see provisioner). */ | ||
| err = esp_ble_mesh_provisioner_prov_enable( | ||
| ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT); |
There was a problem hiding this comment.
False positive. esp_ble_mesh_prov_bearer_t is a flag enum; ESP_BLE_MESH_PROV_ADV (0x1) | ESP_BLE_MESH_PROV_GATT (0x2) = 0x3 is the documented bitmask the ESP-BLE-MESH API expects to enable both provisioning bearers (esp_ble_mesh_provisioner_prov_enable and add_unprov_dev take a bearer bitmask; IDF's own examples pass the same OR). The combined value is intentionally not a named enumerator. Well-defined in C, no behavioral issue.
| if (err != ESP_OK) { | ||
| free(copy); | ||
| } | ||
| return err; |
There was a problem hiding this comment.
False positive. Ownership of copy transfers to the manager-task queue on success: blemesh_post() → xQueueSend() copies the message struct (carrying the copy pointer), and the manager task frees it in free_msg_payload() for BLEMESH_MSG_VENDOR_SEND. The only path where the queue does not take ownership is blemesh_post() != ESP_OK, which frees copy explicitly (L612). Both paths are covered; the analyzer cannot track the ownership transfer across the FreeRTOS queue.
| * here: if the leaf only ever advertises on one of them we still | ||
| * pass through; if it advertises on both we don't spam the log | ||
| * with "Device in queue not support PB-..." every poll. */ | ||
| add.bearer = (esp_ble_mesh_prov_bearer_t) |
There was a problem hiding this comment.
False positive. esp_ble_mesh_prov_bearer_t is a flag enum; ESP_BLE_MESH_PROV_ADV (0x1) | ESP_BLE_MESH_PROV_GATT (0x2) = 0x3 is the documented bitmask the ESP-BLE-MESH API expects to enable both provisioning bearers (esp_ble_mesh_provisioner_prov_enable and add_unprov_dev take a bearer bitmask; IDF's own examples pass the same OR). The combined value is intentionally not a named enumerator. Well-defined in C, no behavioral issue.
4156753 to
84bd30b
Compare
State-oriented facade over ESP-BLE-MESH: nodes + states instead of opcodes/AppKeys/models. NimBLE REPL example, Unity test_apps, and idf-extra-components manifest/CI wiring.
84bd30b to
f226696
Compare
State-oriented facade over ESP-BLE-MESH: nodes + states instead of opcodes/AppKeys/models. NimBLE REPL example, Unity test_apps, and idf-extra-components manifest/CI wiring.
Will be used by both
esp-matterand RMNG, but is technically separate from either project, so it belongs in a repository like this.Checklist
blemesh_manager/LICENSE(Apache-2.0)examples/repl_demo/README.mdurlfield defined.build-test-rules.yml(blemesh_manager/examples/repl_demo+blemesh_manager/test_apps, gatedSOC_BLE_SUPPORTED+ IDF ≥ 5.1); the legacytest_app/CMakeLists.txtpath is not usedtest_apps/(Unity, Composition-Data parsers) +pytest_blemesh_manager.pyChange description
Adds
blemesh_manager, a reusable, host-agnostic BLE Mesh provisioner facade for ESP-IDF. The application drives the mesh in terms of nodes and states (set OnOff on 0x0011 to true) instead of opcodes, AppKeys, model IDs, and publication setup.What it does
on_state_changed; Set→Get confirmation escalation; heartbeat reachability; paced initial-state sync; NVS-restore of provisioned nodes on rebootesp_ble_mesh_*); the example defaults to NimBLE.