Skip to content

Commit

Permalink
Rename network-commissioning -> network-commissioning-old in existing…
Browse files Browse the repository at this point in the history
… apps
  • Loading branch information
erjiaqing committed Dec 14, 2021
1 parent 18ce163 commit 1e286fd
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 39 deletions.
2 changes: 1 addition & 1 deletion examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/barrier-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/window-covering-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/color-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/content-launch-server"
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ target_sources(${APP_TARGET} PRIVATE
${APP_CLUSTERS}/media-input-server/media-input-server.cpp
${APP_CLUSTERS}/media-playback-server/media-playback-server.cpp
${APP_CLUSTERS}/mode-select-server/mode-select-server.cpp
${APP_CLUSTERS}/network-commissioning/network-commissioning-ember.cpp
${APP_CLUSTERS}/network-commissioning/network-commissioning.cpp
${APP_CLUSTERS}/network-commissioning-old/network-commissioning-ember.cpp
${APP_CLUSTERS}/network-commissioning-old/network-commissioning-old.cpp
${APP_CLUSTERS}/on-off-server/on-off-server.cpp
${APP_CLUSTERS}/ota-provider/ota-provider.cpp
${APP_CLUSTERS}/scenes/scenes.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ target_sources(${APP_TARGET} PRIVATE
${CHIP_ROOT}/src/app/clusters/level-control/level-control.cpp
${CHIP_ROOT}/src/app/clusters/color-control-server/color-control-server.cpp
${CHIP_ROOT}/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp
)

target_link_libraries(${APP_TARGET} mbed-os-posix-socket mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip)
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/clusters/level-control/level-control.cpp
${CHIP_ROOT}/src/app/clusters/color-control-server/color-control-server.cpp
${CHIP_ROOT}/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp
)
4 changes: 2 additions & 2 deletions examples/lock-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ idf_component_register(INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
Expand Down Expand Up @@ -141,7 +141,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
Expand Down
4 changes: 2 additions & 2 deletions examples/lock-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ target_sources(${APP_TARGET} PRIVATE
${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp
${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp
${CHIP_ROOT}/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/ota-provider-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-provider"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common"
Expand Down
2 changes: 1 addition & 1 deletion examples/ota-requestor-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-requestor-app/ota-requestor-common"
EXCLUDE_SRCS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook"
PRIV_REQUIRES chip QRCode bt)
Expand Down
7 changes: 3 additions & 4 deletions src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ template("chip_data_model") {
foreach(cluster, _cluster_sources) {
if (cluster == "door-lock-server") {
sources += [ "${_app_root}/clusters/${cluster}/door-lock-server.cpp" ]
} else if (cluster == "network-commissioning") {
} else if (cluster == "network-commissioning-old") {
sources += [
"${_app_root}/clusters/${cluster}-old/${cluster}-ember.cpp",
"${_app_root}/clusters/${cluster}-old/${cluster}.cpp",
"${_app_root}/clusters/${cluster}/${cluster}.cpp",
"${_app_root}/clusters/${cluster}/network-commissioning-ember.cpp",
"${_app_root}/clusters/${cluster}/network-commissioning-old.cpp",
]
} else if (cluster == "mode-select-server") {
sources += [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ namespace {
NetworkInfo sNetworks[kMaxNetworks];
} // namespace

void OnAddThreadNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, const app::ConcreteCommandPath & commandPath,
ByteSpan operationalDataset, uint64_t breadcrumb, uint32_t timeoutMs)
void OnAddOrUpdateThreadNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler,
const app::ConcreteCommandPath & commandPath, ByteSpan operationalDataset,
uint64_t breadcrumb, uint32_t timeoutMs)
{
Commands::NetworkConfigResponse::Type response;
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
Expand Down Expand Up @@ -146,18 +147,19 @@ void OnAddThreadNetworkCommandCallbackInternal(app::CommandHandler * apCommandHa
exit:
// TODO: We should encode response command here.

ChipLogDetail(Zcl, "AddThreadNetwork: %" PRIu8, to_underlying(err));
ChipLogDetail(Zcl, "AddOrUpdateThreadNetwork: %" PRIu8, to_underlying(err));
response.networkingStatus = err;
#else
// The target does not supports ThreadNetwork. We should not add AddThreadNetwork command in that case then the upper layer will
// return "Command not found" error.
// The target does not supports ThreadNetwork. We should not add AddOrUpdateThreadNetwork command in that case then the upper
// layer will return "Command not found" error.
response.networkingStatus = NetworkCommissioningStatus::kUnknownError;
#endif
apCommandHandler->AddResponseData(commandPath, response);
}

void OnAddWiFiNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, const app::ConcreteCommandPath & commandPath,
ByteSpan ssid, ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs)
void OnAddOrUpdateWiFiNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler,
const app::ConcreteCommandPath & commandPath, ByteSpan ssid,
ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs)
{
Commands::NetworkConfigResponse::Type response;
#if defined(CHIP_DEVICE_LAYER_TARGET)
Expand Down Expand Up @@ -203,7 +205,7 @@ void OnAddWiFiNetworkCommandCallbackInternal(app::CommandHandler * apCommandHand
exit:
// TODO: We should encode response command here.

ChipLogDetail(Zcl, "AddWiFiNetwork: %" PRIu8, to_underlying(err));
ChipLogDetail(Zcl, "AddOrUpdateWiFiNetwork: %" PRIu8, to_underlying(err));
response.networkingStatus = err;
#else
// The target does not supports WiFiNetwork.
Expand All @@ -214,7 +216,7 @@ void OnAddWiFiNetworkCommandCallbackInternal(app::CommandHandler * apCommandHand
}

namespace {
CHIP_ERROR DoEnableNetwork(NetworkInfo * network)
CHIP_ERROR DoConnectNetwork(NetworkInfo * network)
{
switch (network->mNetworkType)
{
Expand Down Expand Up @@ -255,8 +257,8 @@ CHIP_ERROR DoEnableNetwork(NetworkInfo * network)
}
} // namespace

void OnEnableNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, const app::ConcreteCommandPath & commandPath,
ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs)
void OnConnectNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, const app::ConcreteCommandPath & commandPath,
ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs)
{
Commands::ConnectNetworkResponse::Type response;
size_t networkSeq;
Expand All @@ -270,15 +272,16 @@ void OnEnableNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandl
{
// TODO: Currently, we cannot figure out the detailed error from network provisioning on DeviceLayer, we should
// implement this in device layer.
VerifyOrExit(DoEnableNetwork(&sNetworks[networkSeq]) == CHIP_NO_ERROR, err = NetworkCommissioningStatus::kUnknownError);
VerifyOrExit(DoConnectNetwork(&sNetworks[networkSeq]) == CHIP_NO_ERROR,
err = NetworkCommissioningStatus::kUnknownError);
ExitNow(err = NetworkCommissioningStatus::kSuccess);
}
}
// TODO: We should encode response command here.
exit:
if (err == NetworkCommissioningStatus::kSuccess)
{
DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().EnableNetworkForOperational(networkID);
DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().ConnectNetworkForOperational(networkID);
}
response.networkingStatus = err;
apCommandHandler->AddResponseData(commandPath, response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ namespace chip {
namespace app {
namespace Clusters {
namespace NetworkCommissioning {
void OnAddThreadNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath,
ByteSpan operationalDataset, uint64_t breadcrumb, uint32_t timeoutMs);
void OnAddWiFiNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, ByteSpan ssid,
ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs);
void OnEnableNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, ByteSpan networkID,
uint64_t breadcrumb, uint32_t timeoutMs);
void OnAddOrUpdateThreadNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath,
ByteSpan operationalDataset, uint64_t breadcrumb, uint32_t timeoutMs);
void OnAddOrUpdateWiFiNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath,
ByteSpan ssid, ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs);
void OnConnectNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath,
ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs);
} // namespace NetworkCommissioning

} // namespace Clusters
Expand Down
3 changes: 2 additions & 1 deletion src/app/zap_cluster_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
'MEDIA_INPUT_CLUSTER': ['media-input-server'],
'MEDIA_PLAYBACK_CLUSTER': ['media-playback-server'],
'MODE_SELECT_CLUSTER': ['mode-select-server'],
'NETWORK_COMMISSIONING_CLUSTER': ['network-commissioning'],
# network-commissioning-old is the old, not spec compliant implementation.
'NETWORK_COMMISSIONING_CLUSTER': ['network-commissioning', 'network-commissioning-old'],
'OCCUPANCY_SENSING_CLUSTER': ['occupancy-sensor-server'],
'ON_OFF_CLUSTER': ['on-off-server'],
'ON_OFF_SWITCH_CONFIG_CLUSTER': [],
Expand Down

0 comments on commit 1e286fd

Please sign in to comment.