Submodule: Update connectedhomeip submodule to current master(06457aea2d)

This commit is contained in:
WanqQixiang
2022-08-17 12:30:53 +08:00
parent 3bffdb5ec1
commit ec0fdec8f3
15 changed files with 591 additions and 476 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ git clone --recursive https://github.com/espressif/esp-matter.git
## Supported ESP-IDF and connectedhomeip versions
- ESP Matter currently works with [commit ae4e105](https://github.com/project-chip/connectedhomeip/tree/ae4e105) of connectedhomeip.
- For Wi-Fi devices (ESP32, ESP32-C3, ESP32-S3), ESP-IDF [v4.4.1 release](https://github.com/espressif/esp-idf/releases/tag/v4.4.1) is required.
- ESP Matter currently works with [commit 06457ae](https://github.com/project-chip/connectedhomeip/tree/06457ae) of connectedhomeip.
- For Wi-Fi devices (ESP32, ESP32-C3, ESP32-S3), ESP-IDF [v4.4.2 release](https://github.com/espressif/esp-idf/releases/tag/v4.4.2) is required.
- For Thread devices (ESP32-H2), ESP-IDF master branch at [commit 047903c](https://github.com/espressif/esp-idf/commit/047903c) should be used.
@@ -655,9 +655,9 @@ attribute_t *create_security_policy(cluster_t *cluster, uint8_t *value, uint16_t
ATTRIBUTE_FLAG_NONE, esp_matter_array(value, length, count));
}
attribute_t *create_channel_mask(cluster_t *cluster, uint8_t *value, uint16_t length)
attribute_t *create_channel_page0_mask(cluster_t *cluster, uint8_t *value, uint16_t length)
{
return esp_matter::attribute::create(cluster, ThreadNetworkDiagnostics::Attributes::ChannelMask::Id,
return esp_matter::attribute::create(cluster, ThreadNetworkDiagnostics::Attributes::ChannelPage0Mask::Id,
ATTRIBUTE_FLAG_NONE, esp_matter_octet_str(value, length));
}
+1 -1
View File
@@ -185,7 +185,7 @@ attribute_t *create_data_version(cluster_t *cluster, uint8_t value);
attribute_t *create_stable_data_version(cluster_t *cluster, uint8_t value);
attribute_t *create_leader_router_id(cluster_t *cluster, uint8_t value);
attribute_t *create_security_policy(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
attribute_t *create_channel_mask(cluster_t *cluster, uint8_t *value, uint16_t length);
attribute_t *create_channel_page0_mask(cluster_t *cluster, uint8_t *value, uint16_t length);
attribute_t *create_operational_dataset_components(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
attribute_t *create_active_network_faults(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
} /* attribute */
+29 -43
View File
@@ -24,7 +24,11 @@ using chip::DeviceProxy;
using chip::FabricInfo;
using chip::kInvalidEndpointId;
using chip::OperationalDeviceProxy;
using chip::PeerId;
using chip::OperationalSessionSetup;
using chip::SessionHandle;
using chip::ScopedNodeId;
using chip::Server;
using chip::Messaging::ExchangeManager;
using chip::Callback::Callback;
static const char *TAG = "esp_matter_client";
@@ -45,50 +49,32 @@ esp_err_t set_command_callback(command_callback_t callback, void *priv_data)
/** TODO: Change g_remote_endpoint_id to something better. */
uint16_t g_remote_endpoint_id = kInvalidEndpointId;
void esp_matter_new_connection_success_callback(void *context, OperationalDeviceProxy *peer_device)
void esp_matter_connection_success_callback(void *context, ExchangeManager & exchangeMgr, SessionHandle & sessionHandle)
{
ESP_LOGI(TAG, "New connection success");
if (client_command_callback) {
client_command_callback(peer_device, g_remote_endpoint_id, client_command_callback_priv_data);
OperationalDeviceProxy device(&exchangeMgr, sessionHandle);
client_command_callback(&device, g_remote_endpoint_id, client_command_callback_priv_data);
}
}
void esp_matter_new_connection_failure_callback(void *context, PeerId peerId, CHIP_ERROR error)
void esp_matter_connection_failure_callback(void *context, const ScopedNodeId & peerId, CHIP_ERROR error)
{
ESP_LOGI(TAG, "New connection failure");
}
esp_err_t connect(uint8_t fabric_index, uint64_t node_id, uint16_t remote_endpoint_id)
{
/* Get info */
const FabricInfo *fabric_info = chip::Server::GetInstance().GetFabricTable().FindFabricWithIndex(fabric_index);
if (!fabric_info) {
ESP_LOGE(TAG, "Couldn't find fabric info");
return ESP_FAIL;
}
PeerId peer_id = fabric_info->GetPeerIdForNode(node_id);
/* Find existing */
DeviceProxy *peer_device = chip::Server::GetInstance().GetCASESessionManager()->FindExistingSession(peer_id);
if (peer_device) {
/* Callback if found */
if (client_command_callback) {
client_command_callback(peer_device, remote_endpoint_id, client_command_callback_priv_data);
}
return ESP_OK;
}
/* Create new connection */
static Callback<chip::OnDeviceConnected> success_callback(esp_matter_connection_success_callback, NULL);
static Callback<chip::OnDeviceConnectionFailure> failure_callback(esp_matter_connection_failure_callback, NULL);
Server * server = &(chip::Server::GetInstance());
g_remote_endpoint_id = remote_endpoint_id;
static Callback<chip::OnDeviceConnected> success_callback(esp_matter_new_connection_success_callback, NULL);
static Callback<chip::OnDeviceConnectionFailure> failure_callback(esp_matter_new_connection_failure_callback, NULL);
chip::Server::GetInstance().GetCASESessionManager()->FindOrEstablishSession(peer_id, &success_callback,
&failure_callback);
server->GetCASESessionManager()->FindOrEstablishSession(ScopedNodeId(node_id, fabric_index), &success_callback,
&failure_callback);
return ESP_OK;
}
static void esp_matter_command_client_binding_callback(const EmberBindingTableEntry &binding, DeviceProxy *peer_device,
static void esp_matter_command_client_binding_callback(const EmberBindingTableEntry &binding, OperationalDeviceProxy *peer_device,
void *context)
{
if (client_command_callback) {
@@ -182,9 +168,9 @@ esp_err_t send_move(peer_device_t *remote_device, uint16_t remote_endpoint_id, u
{
LevelControl::Commands::Move::Type command_data;
command_data.moveMode = (LevelControl::MoveMode)move_mode;
command_data.rate = rate;
command_data.optionMask = option_mask;
command_data.optionOverride = option_override;
command_data.rate.Value(rate);
command_data.optionsMask = option_mask;
command_data.optionsOverride = option_override;
chip::Controller::LevelControlCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id);
cluster.InvokeCommand(command_data, NULL, send_command_success_callback, send_command_failure_callback);
@@ -196,9 +182,9 @@ esp_err_t send_move_to_level(peer_device_t *remote_device, uint16_t remote_endpo
{
LevelControl::Commands::MoveToLevel::Type command_data;
command_data.level = level;
command_data.transitionTime = transition_time;
command_data.optionMask = option_mask;
command_data.optionOverride = option_override;
command_data.transitionTime.Value(transition_time);
command_data.optionsMask = option_mask;
command_data.optionsOverride = option_override;
chip::Controller::LevelControlCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id);
cluster.InvokeCommand(command_data, NULL, send_command_success_callback, send_command_failure_callback);
@@ -210,7 +196,7 @@ esp_err_t send_move_to_level_with_on_off(peer_device_t *remote_device, uint16_t
{
LevelControl::Commands::MoveToLevelWithOnOff::Type command_data;
command_data.level = level;
command_data.transitionTime = transition_time;
command_data.transitionTime.Value(transition_time);
chip::Controller::LevelControlCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id);
cluster.InvokeCommand(command_data, NULL, send_command_success_callback, send_command_failure_callback);
@@ -222,7 +208,7 @@ esp_err_t send_move_with_on_off(peer_device_t *remote_device, uint16_t remote_en
{
LevelControl::Commands::MoveWithOnOff::Type command_data;
command_data.moveMode = (LevelControl::MoveMode)move_mode;
command_data.rate = rate;
command_data.rate.Value(rate);
chip::Controller::LevelControlCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id);
cluster.InvokeCommand(command_data, NULL, send_command_success_callback, send_command_failure_callback);
@@ -235,9 +221,9 @@ esp_err_t send_step(peer_device_t *remote_device, uint16_t remote_endpoint_id, u
LevelControl::Commands::Step::Type command_data;
command_data.stepMode = (LevelControl::StepMode)step_mode;
command_data.stepSize = step_size;
command_data.transitionTime = transition_time;
command_data.optionMask = option_mask;
command_data.optionOverride = option_override;
command_data.transitionTime.Value(transition_time);
command_data.optionsMask = option_mask;
command_data.optionsOverride = option_override;
chip::Controller::LevelControlCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id);
cluster.InvokeCommand(command_data, NULL, send_command_success_callback, send_command_failure_callback);
@@ -250,7 +236,7 @@ esp_err_t send_step_with_on_off(peer_device_t *remote_device, uint16_t remote_en
LevelControl::Commands::StepWithOnOff::Type command_data;
command_data.stepMode = (LevelControl::StepMode)step_mode;
command_data.stepSize = step_size;
command_data.transitionTime = transition_time;
command_data.transitionTime.Value(transition_time);
chip::Controller::LevelControlCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id);
cluster.InvokeCommand(command_data, NULL, send_command_success_callback, send_command_failure_callback);
@@ -261,8 +247,8 @@ esp_err_t send_stop(peer_device_t *remote_device, uint16_t remote_endpoint_id, u
uint8_t option_override)
{
LevelControl::Commands::Stop::Type command_data;
command_data.optionMask = option_mask;
command_data.optionOverride = option_override;
command_data.optionsMask = option_mask;
command_data.optionsOverride = option_override;
chip::Controller::LevelControlCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id);
cluster.InvokeCommand(command_data, NULL, send_command_success_callback, send_command_failure_callback);
+1 -1
View File
@@ -686,7 +686,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
attribute::create_stable_data_version(cluster, 0);
attribute::create_leader_router_id(cluster, 0);
attribute::create_security_policy(cluster, NULL, 0, 0);
attribute::create_channel_mask(cluster, NULL, 0);
attribute::create_channel_page0_mask(cluster, NULL, 0);
attribute::create_operational_dataset_components(cluster, NULL, 0, 0);
attribute::create_active_network_faults(cluster, NULL, 0, 0);
File diff suppressed because it is too large Load Diff
@@ -185,6 +185,7 @@
#define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in target navigator
#define EMBER_AF_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in wake on lan
#define EMBER_AF_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in window covering
#define EMBER_AF_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in door lock
#define MATTER_SCENES_TABLE_SIZE 3 // used in scenes // TODO: check this again
@@ -19,6 +19,13 @@ import("${chip_root}/src/platform/device.gni")
chip_enable_wifi = true
declare_args() {
# By default use default/example implementation of CommissionableDataProvider,
# DeviceAttestationCredentialsProvider and DeviceInstanceInforProvider
chip_use_factory_data_provider = false
chip_use_device_info_provider = false
}
config("ESP32_custom_include") {
include_dirs = [ "../../" ]
}
@@ -73,16 +80,12 @@ static_library("ESP32_custom") {
"ConfigurationManagerImpl.h",
"ConnectivityManagerImpl.cpp",
"ConnectivityManagerImpl.h",
"DeviceInfoProviderImpl.cpp",
"DeviceInfoProviderImpl.h",
"DeviceNetworkProvisioningDelegateImpl.cpp",
"DeviceNetworkProvisioningDelegateImpl.h",
"DiagnosticDataProviderImpl.cpp",
"DiagnosticDataProviderImpl.h",
"ESP32Config.cpp",
"ESP32Config.h",
"ESP32FactoryDataProvider.cpp",
"ESP32FactoryDataProvider.h",
"ESP32Utils.cpp",
"ESP32Utils.h",
"KeyValueStoreManagerImpl.cpp",
@@ -134,4 +137,18 @@ static_library("ESP32_custom") {
]
}
}
if (chip_use_factory_data_provider) {
sources += [
"ESP32FactoryDataProvider.cpp",
"ESP32FactoryDataProvider.h",
]
}
if (chip_use_device_info_provider) {
sources += [
"ESP32DeviceInfoProvider.cpp",
"ESP32DeviceInfoProvider.h",
]
}
}
@@ -1 +0,0 @@
../../../../connectedhomeip/connectedhomeip/src/platform/ESP32/DeviceInfoProviderImpl.cpp
@@ -1 +0,0 @@
../../../../connectedhomeip/connectedhomeip/src/platform/ESP32/DeviceInfoProviderImpl.h
@@ -0,0 +1 @@
../../../../connectedhomeip/connectedhomeip/src/platform/ESP32/ESP32DeviceInfoProvider.cpp
@@ -0,0 +1 @@
../../../../connectedhomeip/connectedhomeip/src/platform/ESP32/ESP32DeviceInfoProvider.h
+2 -2
View File
@@ -71,9 +71,9 @@ esp_err_t app_qrcode_get_payload(char **qrcode_text, char **short_manual_code_te
/* Set details */
payload.version = 0;
payload.discriminator = discriminator;
payload.discriminator.SetLongValue(discriminator);
payload.setUpPINCode = setup_pin_code;
payload.rendezvousInformation = RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE);
payload.rendezvousInformation.SetValue(RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE));
payload.vendorID = vendor_id;
payload.productID = product_id;
+21 -2
View File
@@ -17,6 +17,13 @@ import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/src/platform/device.gni")
declare_args() {
# By default use default/example implementation of CommissionableDataProvider,
# DeviceAttestationCredentialsProvider and DeviceInstanceInforProvider
chip_use_factory_data_provider = false
chip_use_device_info_provider = false
}
config("ESP32_custom_include") {
include_dirs = [ "../../" ]
}
@@ -70,8 +77,6 @@ static_library("ESP32_custom") {
"ConfigurationManagerImpl.h",
"ConnectivityManagerImpl.cpp",
"ConnectivityManagerImpl.h",
"DeviceInfoProviderImpl.cpp",
"DeviceInfoProviderImpl.h",
"DeviceNetworkProvisioningDelegateImpl.cpp",
"DeviceNetworkProvisioningDelegateImpl.h",
"DiagnosticDataProviderImpl.cpp",
@@ -116,4 +121,18 @@ static_library("ESP32_custom") {
"OTAImageProcessorImpl.h",
]
}
if (chip_use_factory_data_provider) {
sources += [
"ESP32FactoryDataProvider.cpp",
"ESP32FactoryDataProvider.h",
]
}
if (chip_use_device_info_provider) {
sources += [
"ESP32DeviceInfoProvider.cpp",
"ESP32DeviceInfoProvider.h",
]
}
}