Skip to content

Commit

Permalink
Fix remaining emberAfPostAttributeChangeCallback consumers. (#10749)
Browse files Browse the repository at this point in the history
These were missed in #10315
  • Loading branch information
bzbarsky-apple authored Oct 21, 2021
1 parent 5011c2b commit c4a4361
Show file tree
Hide file tree
Showing 23 changed files with 47 additions and 750 deletions.
7 changes: 4 additions & 3 deletions examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <stdlib.h>

#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
Expand Down Expand Up @@ -74,13 +75,13 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
} // namespace DeviceManager
} // namespace chip

void emberAfPostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t mask, uint8_t type, uint16_t size,
uint8_t * value)
{
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
if (cb != nullptr)
{
cb->PostAttributeChangeCallback(endpointId, clusterId, attributeId, mask, manufacturerCode, type, size, value);
cb->PostAttributeChangeCallback(pathe.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value);
}
}
2 changes: 1 addition & 1 deletion examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
}

void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t type, uint16_t size, uint8_t * value)
{
ChipLogProgress(DeviceLayer,
"[%s] PostAttributeChangeCallback - Cluster ID: 0x%04x, EndPoint ID: 0x%02x, Attribute ID: 0x%04x\r\n", TAG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CHIPDeviceManagerCallbacks
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value)
{}
virtual ~CHIPDeviceManagerCallbacks() {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
public:
void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) override;
void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size,
uint8_t * value) override;
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value) override;

private:
void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
Expand Down
7 changes: 4 additions & 3 deletions examples/all-clusters-app/esp32/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <stdlib.h>

#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
Expand Down Expand Up @@ -95,13 +96,13 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
} // namespace DeviceManager
} // namespace chip

void emberAfPostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t mask, uint8_t type, uint16_t size,
uint8_t * value)
{
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
if (cb != nullptr)
{
cb->PostAttributeChangeCallback(endpointId, clusterId, attributeId, mask, manufacturerCode, type, size, value);
cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value);
}
}
2 changes: 1 addition & 1 deletion examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
}

void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG, "PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: '0x%02x', Attribute ID: '0x%04x'", clusterId,
endpointId, attributeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DLL_EXPORT CHIPDeviceManagerCallbacks
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value)
{}
virtual ~CHIPDeviceManagerCallbacks() {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
public:
virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value);
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value);

private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
Expand Down
7 changes: 4 additions & 3 deletions examples/bridge-app/esp32/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <stdlib.h>

#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
Expand Down Expand Up @@ -99,13 +100,13 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
} // namespace DeviceManager
} // namespace chip

void emberAfPostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t mask, uint8_t type, uint16_t size,
uint8_t * value)
{
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
if (cb != nullptr)
{
cb->PostAttributeChangeCallback(endpointId, clusterId, attributeId, mask, manufacturerCode, type, size, value);
cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value);
}
}
2 changes: 1 addition & 1 deletion examples/bridge-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT));
}
void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG, "PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: '0x%02x', Attribute ID: '0x%04x'", clusterId,
endpointId, attributeId);
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/esp32/main/include/CHIPDeviceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class DLL_EXPORT CHIPDeviceManagerCallbacks
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value)
{}
virtual ~CHIPDeviceManagerCallbacks() {}
};
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/esp32/main/include/DeviceCallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
public:
virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value);
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value);

private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
Expand Down
13 changes: 7 additions & 6 deletions examples/lighting-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@

#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/af-types.h>
#include <app/util/af.h>

using namespace ::chip;
using namespace ::chip::app::Clusters;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t mask, uint8_t type, uint16_t size,
uint8_t * value)
{
if (clusterId != OnOff::Id)
if (path.mClusterId != OnOff::Id)
{
ChipLogProgress(Zcl, "Unknown cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(clusterId));
ChipLogProgress(Zcl, "Unknown cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(path.mClusterId));
return;
}

if (attributeId != OnOff::Attributes::OnOff::Id)
if (path.mAttributeId != OnOff::Attributes::OnOff::Id)
{
ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(attributeId));
ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(path.mAttributeId));
return;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/lock-app/esp32/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
if (cb != nullptr)
{
cb->PostAttributeChangeCallback(attributePath.mEndpointId, attributePath.mClusterId, attributePath.mAttributeId, mask, 0x0,
type, size, value);
cb->PostAttributeChangeCallback(attributePath.mEndpointId, attributePath.mClusterId, attributePath.mAttributeId, mask, type,
size, value);
}
}
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT));
}
void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG, "PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: '0x%02x', Attribute ID: '0x%04x'", clusterId,
endpointId, attributeId);
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/include/CHIPDeviceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DLL_EXPORT CHIPDeviceManagerCallbacks
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value)
{}
virtual ~CHIPDeviceManagerCallbacks() {}
};
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/include/DeviceCallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
public:
virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value);
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value);

private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
Expand Down
13 changes: 7 additions & 6 deletions examples/lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@

#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/af-types.h>
#include <app/util/af.h>

using namespace ::chip;
using namespace ::chip::app::Clusters;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t mask, uint8_t type, uint16_t size,
uint8_t * value)
{
if (clusterId != OnOff::Id)
if (path.mClusterId != OnOff::Id)
{
ChipLogProgress(Zcl, "Unknown cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(clusterId));
ChipLogProgress(Zcl, "Unknown cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(path.mClusterId));
return;
}

if (attributeId != OnOff::Attributes::OnOff::Id)
if (path.mAttributeId != OnOff::Attributes::OnOff::Id)
{
ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(attributeId));
ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(path.mAttributeId));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <stdlib.h>

#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
Expand Down Expand Up @@ -95,13 +96,13 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
} // namespace DeviceManager
} // namespace chip

void emberAfPostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t mask, uint8_t type, uint16_t size,
uint8_t * value)
{
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
if (cb != nullptr)
{
cb->PostAttributeChangeCallback(endpointId, clusterId, attributeId, mask, manufacturerCode, type, size, value);
cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
}

void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG, "PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: '0x%02x', Attribute ID: '0x%04x'", clusterId,
endpointId, attributeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class DLL_EXPORT CHIPDeviceManagerCallbacks
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value)
{}
virtual ~CHIPDeviceManagerCallbacks() {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
public:
virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value);
uint8_t mask, uint8_t type, uint16_t size, uint8_t * value);

private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
Expand Down
Loading

0 comments on commit c4a4361

Please sign in to comment.