Skip to content

Commit

Permalink
Fix LED on/off not work(lighting-app).
Browse files Browse the repository at this point in the history
Reference from c4a4361

Fix remaining emberAfPostAttributeChangeCallback consumers. (project-chip#10749)
  • Loading branch information
hanksuu committed Oct 27, 2021
1 parent c757ee5 commit 199d61f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
9 changes: 6 additions & 3 deletions examples/lighting-app/ambd/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,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 & attributePath, uint8_t mask, uint8_t type, uint16_t size,
uint8_t * value)
{
ChipLogProgress(Zcl, "Cluster callback: %" PRIx32, clusterId);
EndpointId endpointId = attributePath.mEndpointId;
ClusterId clusterId = attributePath.mClusterId;
AttributeId attributeId = attributePath.mAttributeId;

if (clusterId == ZCL_ON_OFF_CLUSTER_ID)
{
if (attributeId != ZCL_ON_OFF_ATTRIBUTE_ID)
Expand Down
10 changes: 5 additions & 5 deletions examples/lighting-app/ambd/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/Command.h>
#include <app/server/Mdns.h>
#include <app/server/Dnssd.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/mdns/Advertiser.h>
#include <lib/dnssd/Advertiser.h>
#include <support/CodeUtils.h>
#include <support/logging/CHIPLogging.h>
#include <support/logging/Constants.h>
Expand Down Expand Up @@ -68,7 +68,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
// will not trigger a 'internet connectivity change' as there is no internet
// connectivity. MDNS still wants to refresh its listening interfaces to include the
// newly selected address.
chip::app::MdnsServer::Instance().StartServer();
chip::app::DnssdServer::Instance().StartServer();
}
break;
}
Expand All @@ -79,7 +79,7 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established)
{
printf("Server ready at: %s:%d", event->InternetConnectivityChange.address, CHIP_PORT);
chip::app::MdnsServer::Instance().StartServer();
chip::app::DnssdServer::Instance().StartServer();
}
else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost)
{
Expand All @@ -88,7 +88,7 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established)
{
printf("IPv6 Server ready...");
chip::app::MdnsServer::Instance().StartServer();
chip::app::DnssdServer::Instance().StartServer();
}
else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost)
{
Expand Down
10 changes: 5 additions & 5 deletions examples/lighting-app/ambd/main/include/CHIPDeviceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@

#pragma once

#include <core/CHIPCore.h>
#include <core/CHIPError.h>
#include <lib/core/CHIPCore.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>

#include <support/DLLUtil.h>
#include <lib/support/DLLUtil.h>

#include <stdarg.h>
#include <stdlib.h>

#include "af-types.h"
#include <app/util/af-types.h>

namespace chip {
namespace DeviceManager {
Expand Down Expand Up @@ -73,7 +73,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

0 comments on commit 199d61f

Please sign in to comment.