Skip to content

Commit

Permalink
Remove emberAfSendDefaultResponse. (#25080)
Browse files Browse the repository at this point in the history
* The various emberAfBasicClusterMfgSpecificPingCallback functions in examples
  all had the wrong signature, so wouldn't be called even if those examples
  enabled that non-standard command.  Which the examples don't.
* scenes-client.h/cpp was dead code, and not really fixable to work with Matter:
  the behavior expected of clients is very different from ZCL, and the code in
  this file would be replaced by a mix of TLV decoding of the ViewScene response
  and bits in CommandSender that already exist.
* The declaration of emberAfGetCommandApsFrame that is being removed does not
  have a corresponding implementation, so it was just dead and misleading code.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Oct 18, 2023
1 parent ed42752 commit 3773962
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 300 deletions.
6 changes: 0 additions & 6 deletions examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
exit:
return;
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,3 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint)
{
// TODO: implement any additional Cluster Server init actions
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}
6 changes: 0 additions & 6 deletions examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,6 @@ void AppDeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpoi
}
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}

void AppDeviceCallbacksDelegate::OnIPv4ConnectivityEstablished()
{
wifiLED.Set(true);
Expand Down
6 changes: 0 additions & 6 deletions examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ chip::app::Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManage

} // namespace

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}

void OnIdentifyStart(::Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStart");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
exit:
return;
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,3 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint)
{
// TODO: implement any additional Cluster Server init actions
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ void AppDeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpoi
}
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}

void AppDeviceCallbacksDelegate::OnIPv4ConnectivityEstablished()
{
wifiLED.Set(true);
Expand Down
6 changes: 0 additions & 6 deletions examples/all-clusters-minimal-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ namespace {
static LowPowerManager lowPowerManager;
} // namespace

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}

void OnIdentifyStart(::Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStart");
Expand Down
6 changes: 0 additions & 6 deletions examples/chef/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
exit:
return;
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}
6 changes: 0 additions & 6 deletions examples/light-switch-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
exit:
return;
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}
6 changes: 0 additions & 6 deletions examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
exit:
return;
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}
6 changes: 0 additions & 6 deletions examples/thermostat/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0, &s
} // namespace
#endif

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}

void OnIdentifyStart(Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStart");
Expand Down
6 changes: 0 additions & 6 deletions examples/tv-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ using namespace chip::DeviceLayer;
using namespace chip::AppPlatform;
using namespace chip::app::Clusters;

bool emberAfBasicClusterMfgSpecificPingCallback(app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
}

namespace {
static AccountLoginManager accountLoginManager;
static ApplicationBasicManager applicationBasicManager;
Expand Down
141 changes: 0 additions & 141 deletions src/app/clusters/scenes-client/scenes-client.cpp

This file was deleted.

30 changes: 0 additions & 30 deletions src/app/clusters/scenes-client/scenes-client.h

This file was deleted.

18 changes: 0 additions & 18 deletions src/app/util/af.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,24 +502,6 @@ EmberStatus emberEventControlSetDelayMS(EmberEventControl * control, uint32_t de
/** @name Messaging */
// @{

/**
* @brief Sends a default response to a cluster command.
*
* This function is used to prepare and send a default response to a cluster
* command.
*
* @param cmd The cluster command to which to respond.
* @param status Status code for the default response command.
* @return An ::EmberStatus value that indicates the success or failure of
* sending the response.
*/
EmberStatus emberAfSendDefaultResponse(const EmberAfClusterCommand * cmd, EmberAfStatus status);

/**
* @brief Access to client API APS frame.
*/
EmberApsFrame * emberAfGetCommandApsFrame(void);

/**
* @brief Set the source and destination endpoints in the client API APS frame.
*/
Expand Down
15 changes: 0 additions & 15 deletions src/app/util/ember-compatibility-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,6 @@ void SetupEmberAfCommandHandler(CommandHandler * command, const ConcreteCommandP
currentCommandObject = command;
}

bool IMEmberAfSendDefaultResponseWithCallback(EmberAfStatus status)
{
if (currentCommandObject == nullptr)
{
// We have no idea what we're supposed to respond to.
return false;
}

chip::app::ConcreteCommandPath commandPath(imCompatibilityEmberApsFrame.destinationEndpoint,
imCompatibilityEmberApsFrame.clusterId, imCompatibilityEmberAfCluster.commandId);

CHIP_ERROR err = currentCommandObject->AddStatus(commandPath, ToInteractionModelStatus(status));
return CHIP_NO_ERROR == err;
}

void ResetEmberAfObjects()
{
emAfCurrentCommand = nullptr;
Expand Down
1 change: 0 additions & 1 deletion src/app/util/ember-compatibility-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace app {
namespace Compatibility {

void SetupEmberAfCommandHandler(CommandHandler * command, const ConcreteCommandPath & commandPath);
bool IMEmberAfSendDefaultResponseWithCallback(EmberAfStatus status);
void ResetEmberAfObjects();

} // namespace Compatibility
Expand Down
17 changes: 0 additions & 17 deletions src/app/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,23 +334,6 @@ void emAfApplyDisableDefaultResponse(uint8_t * frame_control)
}
}

EmberStatus emberAfSendDefaultResponse(const EmberAfClusterCommand * cmd, EmberAfStatus status)
{
// Default Response commands are only sent in response to unicast commands.
if (cmd->type != EMBER_INCOMING_UNICAST && cmd->type != EMBER_INCOMING_UNICAST_REPLY)
{
return EMBER_SUCCESS;
}

if (!chip::app::Compatibility::IMEmberAfSendDefaultResponseWithCallback(status))
{
// Caller is not responding to anything!
return EMBER_ERR_FATAL;
}

return EMBER_SUCCESS;
}

void emberAfCopyInt16u(uint8_t * data, uint16_t index, uint16_t x)
{
data[index] = (uint8_t)(((x)) & 0xFF);
Expand Down

0 comments on commit 3773962

Please sign in to comment.