diff --git a/examples/lighting-app/python/lighting.py b/examples/lighting-app/python/lighting.py index 50e4d71498ccbe..a10fbbddf14e35 100644 --- a/examples/lighting-app/python/lighting.py +++ b/examples/lighting-app/python/lighting.py @@ -177,7 +177,6 @@ def attributeChangeCallback( endpoint: int, clusterId: int, attributeId: int, - manufacturerCode: int, xx_type: int, size: int, value: bytes, diff --git a/src/controller/python/chip/server/ServerInit.cpp b/src/controller/python/chip/server/ServerInit.cpp index a694698b6e43b0..daedbb3850774a 100644 --- a/src/controller/python/chip/server/ServerInit.cpp +++ b/src/controller/python/chip/server/ServerInit.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -29,6 +30,8 @@ #include #include +#include + // #include // #include @@ -98,8 +101,8 @@ static bool EnsureWiFiIsStarted() } #endif -using PostAttributeChangeCallback = void (*)(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, - uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); +using PostAttributeChangeCallback = void (*)(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t type, + uint16_t size, uint8_t * value); class PythonServerDelegate // : public ServerDelegate { @@ -138,6 +141,9 @@ void pychip_server_native_init() ChipLogError(DeviceLayer, "Failed to initialize CHIP stack: platform init failed: %s", chip::ErrorStr(err)); } + static chip::DeviceLayer::TestOnlyCommissionableDataProvider TestOnlyCommissionableDataProvider; + chip::DeviceLayer::SetCommissionableDataProvider(&TestOnlyCommissionableDataProvider); + ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); @@ -177,7 +183,7 @@ void pychip_server_native_init() chip::Server::GetInstance().Init(initParams); // Initialize device attestation config - // SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + SetDeviceAttestationCredentialsProvider(chip::Credentials::Examples::GetExampleDACProvider()); result = pthread_create(&sPlatformMainThread, nullptr, PlatformMainLoop, nullptr); tmpErrno = errno; @@ -191,14 +197,15 @@ void pychip_server_native_init() } } -void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) { // ChipLogProgress(NotSpecified, "emberAfPostAttributeChangeCallback()"); if (gPythonServerDelegate.mPostAttributeChangeCallback != nullptr) { // ChipLogProgress(NotSpecified, "callback %p", gPythonServerDelegate.mPostAttributeChangeCallback); - gPythonServerDelegate.mPostAttributeChangeCallback(endpoint, clusterId, attributeId, manufacturerCode, type, size, value); + gPythonServerDelegate.mPostAttributeChangeCallback(attributePath.mEndpointId, attributePath.mClusterId, + attributePath.mAttributeId, type, size, value); } else { diff --git a/src/controller/python/chip/server/types.py b/src/controller/python/chip/server/types.py index 9aaeb60e10c8ea..ec5c13d462ff7e 100644 --- a/src/controller/python/chip/server/types.py +++ b/src/controller/python/chip/server/types.py @@ -8,7 +8,5 @@ c_uint16, c_uint8, c_uint16, - c_uint8, - c_uint16, c_char_p, )