-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Android] Implement Event path command #20198
[Android] Implement Event path command #20198
Conversation
@yunhanw-google I request to update about event path (#19437 ). Please check about this. |
PR #20198: Size comparison from 6c6dca3 to 44026cf Increases (4 builds for cc13x2_26x2, telink)
Decreases (3 builds for cc13x2_26x2, cyw30739)
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
PR #20198: Size comparison from 6c6dca3 to d9e3539 Increases (3 builds for cc13x2_26x2, telink)
Decreases (4 builds for cc13x2_26x2, cyw30739, telink)
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
Fast tracking platform changes. |
readerForJavaTLV.Init(*apData); | ||
readerForJson.Init(*apData); | ||
|
||
jobject value = DecodeEventValue(aEventHeader.mPath, readerForJavaObject, &err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should pass the whole eventHeader to android application where it not only has the path, but it has event meta data info, like EventNumber, Priority. Timestamp=timestamp, TimestampType. for example, we may receive a burst of open-close events with short period, which has the same event path, and they have different event number and timestamp, the application would be able to consume/parse them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one python event header example is here, https://github.com/project-chip/connectedhomeip/blob/master/src/controller/python/chip/clusters/Attribute.py#L819
please follow-up this @joonhaengHeo, thanks
@@ -0,0 +1,77 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the file naming, please consider to remove Chip Prefix since current project is called matter.
private ChipEventPath(ChipPathId endpointId, ChipPathId clusterId, ChipPathId eventId) { | ||
this.endpointId = endpointId; | ||
this.clusterId = clusterId; | ||
this.eventId = eventId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have urgent boolean here. in spec, we have record the urgent flag inside path.
https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/data_model/Encoding-Specification.adoc#encoding-EventPathIB
listOf(attributePath), | ||
minInterval, | ||
maxInterval) | ||
} else if (type == EVENT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we really should consider to support event and attribute at the same time, in real situation, the chance is to subscribe/read wildcard attribute and event path. Particularly the number of supported subscription for each device is very limited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Platform::New<app::ReadClient>(app::InteractionModelEngine::GetInstance(), device->GetExchangeManager(), | ||
callback->mBufferedReadAdapter, app::ReadClient::InteractionType::Subscribe); | ||
|
||
err = readClient->SendAutoResubscribeRequest(std::move(params)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also consider to update attribute with SendAutoResubscribeRequest
jobject eventIdObj = env->CallObjectMethod(eventPath, getEventIdMethod); | ||
VerifyOrReturnError(eventIdObj != nullptr, CHIP_ERROR_INCORRECT_STATE); | ||
|
||
uint32_t endpointId = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endpointid is uint16_t
} | ||
|
||
// This will overwrite previous events. | ||
clusterState.getEventStates().put(eventId, eventStateToAdd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
events should be stored in array. in real user scenario, you may receive a burst of events, for example, lock/unlock, we would like to record all events.
Problem
What is being fixed? Examples:
#19665
Change overview
Add subscribeToEventPath and readEventPath API in Android Platform.
Testing
How was this tested? (at least one bullet point required)