controller: add matter controller cluster

This commit is contained in:
WanqQixiang
2023-07-26 19:53:39 +08:00
parent 0570e84a28
commit 2a2122e9e5
16 changed files with 1926 additions and 19 deletions
+5 -1
View File
@@ -14,13 +14,17 @@ No additional setup is required.
See the [docs](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html#controller-example) for more information
about pairing and controling an end-device using this example
## 3. Controller in Rainmaker Fabric
Matter Controller in Rainmaker Fabric will be soon avaliable in [Rainmaker Matter Examples](https://github.com/espressif/esp-rainmaker/tree/master/examples/matter)
## A2 Appendix FAQs
### A2.1 Pairing Command Failed
I cannot finish the commissioning on the controller example:
- Currently this example only supports onnetwork pairing, so please make sure that the end-device and the controller are on the same IP-network.
- For onnetwork pairing, please make sure that the end-device and the controller are on the same IP-network.
- The controller uses the hard-code test PAA certification so the PAI and DAC on the end-device should be generated by the [test cert](https://github.com/espressif/connectedhomeip/blob/4f7669b052b16bd054227376e1bbadac85419793/credentials/test/attestation/Chip-Test-PAA-NoVID-Cert.pem) and the [test key](https://github.com/espressif/connectedhomeip/blob/4f7669b052b16bd054227376e1bbadac85419793/credentials/test/attestation/Chip-Test-PAA-NoVID-Key.pem)
- If you are still facing issues, reproduce the issue on the default example for the device and then raise an [issue](https://github.com/espressif/esp-matter/issues). Make sure to share these:
- The complete device logs for both the devices taken over UART.
+11 -1
View File
@@ -12,12 +12,16 @@
#include <esp_matter.h>
#include <esp_matter_commissioner.h>
#include <esp_matter_controller_utils.h>
#include <esp_matter_console.h>
#include <esp_matter_controller_console.h>
#include <esp_matter_ota.h>
#include <app_reset.h>
#include <app/server/Server.h>
#include <credentials/FabricTable.h>
static const char *TAG = "app_main";
uint16_t switch_endpoint_id = 0;
@@ -31,7 +35,13 @@ static void app_event_cb(const ChipDeviceEvent *event, intptr_t arg)
case chip::DeviceLayer::DeviceEventType::PublicEventTypes::kInterfaceIpAddressChanged:
ESP_LOGI(TAG, "Interface IP Address changed");
break;
#if !CONFIG_ESP_MATTER_COMMISSIONER_ENABLE
case chip::DeviceLayer::DeviceEventType::kFabricCommitted:
if (chip::Server::GetInstance().GetFabricTable().FindFabricWithIndex(1)) {
esp_matter::controller::set_fabric_index(1);
}
break;
#endif
default:
break;
}