Skip to content

Commit 1548744

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Remove emberAfSendDefaultResponse. (#25080)
* 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.
1 parent 2f74ecc commit 1548744

File tree

19 files changed

+0
-300
lines changed

19 files changed

+0
-300
lines changed

examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
176176
exit:
177177
return;
178178
}
179-
180-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
181-
{
182-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
183-
return true;
184-
}

examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,3 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint)
8181
{
8282
// TODO: implement any additional Cluster Server init actions
8383
}
84-
85-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
86-
{
87-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
88-
return true;
89-
}

examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,6 @@ void AppDeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpoi
205205
}
206206
}
207207

208-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
209-
{
210-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
211-
return true;
212-
}
213-
214208
void AppDeviceCallbacksDelegate::OnIPv4ConnectivityEstablished()
215209
{
216210
wifiLED.Set(true);

examples/all-clusters-app/linux/main-common.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ chip::app::Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManage
6262

6363
} // namespace
6464

65-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
66-
{
67-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
68-
return true;
69-
}
70-
7165
void OnIdentifyStart(::Identify *)
7266
{
7367
ChipLogProgress(Zcl, "OnIdentifyStart");

examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
149149
exit:
150150
return;
151151
}
152-
153-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
154-
{
155-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
156-
return true;
157-
}

examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,3 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint)
8181
{
8282
// TODO: implement any additional Cluster Server init actions
8383
}
84-
85-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
86-
{
87-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
88-
return true;
89-
}

examples/all-clusters-minimal-app/esp32/main/DeviceCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,6 @@ void AppDeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpoi
201201
}
202202
}
203203

204-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
205-
{
206-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
207-
return true;
208-
}
209-
210204
void AppDeviceCallbacksDelegate::OnIPv4ConnectivityEstablished()
211205
{
212206
wifiLED.Set(true);

examples/all-clusters-minimal-app/linux/main-common.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ namespace {
4242
static LowPowerManager lowPowerManager;
4343
} // namespace
4444

45-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
46-
{
47-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
48-
return true;
49-
}
50-
5145
void OnIdentifyStart(::Identify *)
5246
{
5347
ChipLogProgress(Zcl, "OnIdentifyStart");

examples/chef/ameba/main/DeviceCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
172172
exit:
173173
return;
174174
}
175-
176-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
177-
{
178-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
179-
return true;
180-
}

examples/light-switch-app/ameba/main/DeviceCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
165165
exit:
166166
return;
167167
}
168-
169-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
170-
{
171-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
172-
return true;
173-
}

examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,3 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
172172
exit:
173173
return;
174174
}
175-
176-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
177-
{
178-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
179-
return true;
180-
}

examples/thermostat/linux/main.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0, &s
3636
} // namespace
3737
#endif
3838

39-
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
40-
{
41-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
42-
return true;
43-
}
44-
4539
void OnIdentifyStart(Identify *)
4640
{
4741
ChipLogProgress(Zcl, "OnIdentifyStart");

examples/tv-app/linux/main.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ using namespace chip::DeviceLayer;
5050
using namespace chip::AppPlatform;
5151
using namespace chip::app::Clusters;
5252

53-
bool emberAfBasicClusterMfgSpecificPingCallback(app::CommandHandler * commandObj)
54-
{
55-
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
56-
return true;
57-
}
58-
5953
namespace {
6054
static AccountLoginManager accountLoginManager;
6155
static ApplicationBasicManager applicationBasicManager;

src/app/clusters/scenes-client/scenes-client.cpp

-141
This file was deleted.

src/app/clusters/scenes-client/scenes-client.h

-30
This file was deleted.

src/app/util/af.h

-18
Original file line numberDiff line numberDiff line change
@@ -502,24 +502,6 @@ EmberStatus emberEventControlSetDelayMS(EmberEventControl * control, uint32_t de
502502
/** @name Messaging */
503503
// @{
504504

505-
/**
506-
* @brief Sends a default response to a cluster command.
507-
*
508-
* This function is used to prepare and send a default response to a cluster
509-
* command.
510-
*
511-
* @param cmd The cluster command to which to respond.
512-
* @param status Status code for the default response command.
513-
* @return An ::EmberStatus value that indicates the success or failure of
514-
* sending the response.
515-
*/
516-
EmberStatus emberAfSendDefaultResponse(const EmberAfClusterCommand * cmd, EmberAfStatus status);
517-
518-
/**
519-
* @brief Access to client API APS frame.
520-
*/
521-
EmberApsFrame * emberAfGetCommandApsFrame(void);
522-
523505
/**
524506
* @brief Set the source and destination endpoints in the client API APS frame.
525507
*/

src/app/util/ember-compatibility-functions.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -174,21 +174,6 @@ void SetupEmberAfCommandHandler(CommandHandler * command, const ConcreteCommandP
174174
currentCommandObject = command;
175175
}
176176

177-
bool IMEmberAfSendDefaultResponseWithCallback(EmberAfStatus status)
178-
{
179-
if (currentCommandObject == nullptr)
180-
{
181-
// We have no idea what we're supposed to respond to.
182-
return false;
183-
}
184-
185-
chip::app::ConcreteCommandPath commandPath(imCompatibilityEmberApsFrame.destinationEndpoint,
186-
imCompatibilityEmberApsFrame.clusterId, imCompatibilityEmberAfCluster.commandId);
187-
188-
CHIP_ERROR err = currentCommandObject->AddStatus(commandPath, ToInteractionModelStatus(status));
189-
return CHIP_NO_ERROR == err;
190-
}
191-
192177
void ResetEmberAfObjects()
193178
{
194179
emAfCurrentCommand = nullptr;

src/app/util/ember-compatibility-functions.h

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ namespace app {
3333
namespace Compatibility {
3434

3535
void SetupEmberAfCommandHandler(CommandHandler * command, const ConcreteCommandPath & commandPath);
36-
bool IMEmberAfSendDefaultResponseWithCallback(EmberAfStatus status);
3736
void ResetEmberAfObjects();
3837

3938
} // namespace Compatibility

src/app/util/util.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -334,23 +334,6 @@ void emAfApplyDisableDefaultResponse(uint8_t * frame_control)
334334
}
335335
}
336336

337-
EmberStatus emberAfSendDefaultResponse(const EmberAfClusterCommand * cmd, EmberAfStatus status)
338-
{
339-
// Default Response commands are only sent in response to unicast commands.
340-
if (cmd->type != EMBER_INCOMING_UNICAST && cmd->type != EMBER_INCOMING_UNICAST_REPLY)
341-
{
342-
return EMBER_SUCCESS;
343-
}
344-
345-
if (!chip::app::Compatibility::IMEmberAfSendDefaultResponseWithCallback(status))
346-
{
347-
// Caller is not responding to anything!
348-
return EMBER_ERR_FATAL;
349-
}
350-
351-
return EMBER_SUCCESS;
352-
}
353-
354337
void emberAfCopyInt16u(uint8_t * data, uint16_t index, uint16_t x)
355338
{
356339
data[index] = (uint8_t)(((x)) & 0xFF);

0 commit comments

Comments
 (0)