Skip to content

Commit

Permalink
Python: use MatterPostAttributeChangeCallback (instead of emberAfPost…
Browse files Browse the repository at this point in the history
…AttributeChangeCallback)
  • Loading branch information
sandeepmistry committed Sep 16, 2022
1 parent 5f3f72c commit 0feaf9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion examples/lighting-app/python/lighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def attributeChangeCallback(
endpoint: int,
clusterId: int,
attributeId: int,
manufacturerCode: int,
xx_type: int,
size: int,
value: bytes,
Expand Down
9 changes: 5 additions & 4 deletions src/controller/python/chip/server/ServerInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ 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);
uint8_t type, uint16_t size, uint8_t * value);

class PythonServerDelegate // : public ServerDelegate
{
Expand Down Expand Up @@ -197,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
{
Expand Down
2 changes: 0 additions & 2 deletions src/controller/python/chip/server/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
c_uint16,
c_uint8,
c_uint16,
c_uint8,
c_uint16,
c_char_p,
)

0 comments on commit 0feaf9c

Please sign in to comment.