Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Fix OnRead[Event|Attribute]DataCallback for Arm64 Apple Patform devices #33178

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/controller/python/chip/clusters/attribute.cpp
Original file line number Diff line number Diff line change
@@ -71,10 +71,10 @@ struct __attribute__((packed)) DataVersionFilter
using OnReadAttributeDataCallback = void (*)(PyObject * appContext, chip::DataVersion version, chip::EndpointId endpointId,
chip::ClusterId clusterId, chip::AttributeId attributeId,
std::underlying_type_t<Protocols::InteractionModel::Status> imstatus, uint8_t * data,
uint32_t dataLen);
size_t dataLen);
using OnReadEventDataCallback = void (*)(PyObject * appContext, chip::EndpointId endpointId, chip::ClusterId clusterId,
chip::EventId eventId, chip::EventNumber eventNumber, uint8_t priority, uint64_t timestamp,
uint8_t timestampType, uint8_t * data, uint32_t dataLen,
uint8_t timestampType, uint8_t * data, size_t dataLen,
std::underlying_type_t<Protocols::InteractionModel::Status> imstatus);
using OnSubscriptionEstablishedCallback = void (*)(PyObject * appContext, SubscriptionId subscriptionId);
using OnResubscriptionAttemptedCallback = void (*)(PyObject * appContext, PyChipError aTerminationCause,
@@ -114,7 +114,7 @@ class ReadClientCallback : public ReadClient::Callback
VerifyOrDie(!aPath.IsListItemOperation());
size_t bufferLen = (apData == nullptr ? 0 : apData->GetRemainingLength() + apData->GetLengthRead());
std::unique_ptr<uint8_t[]> buffer = std::unique_ptr<uint8_t[]>(apData == nullptr ? nullptr : new uint8_t[bufferLen]);
uint32_t size = 0;
size_t size = 0;
// When the apData is nullptr, means we did not receive a valid attribute data from server, status will be some error
// status.
if (apData != nullptr)
@@ -166,7 +166,7 @@ class ReadClientCallback : public ReadClient::Callback
void OnEventData(const EventHeader & aEventHeader, TLV::TLVReader * apData, const StatusIB * apStatus) override
{
uint8_t buffer[CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE];
uint32_t size = 0;
size_t size = 0;
CHIP_ERROR err = CHIP_NO_ERROR;
// When the apData is nullptr, means we did not receive a valid event data from server, status will be some error
// status.
Loading