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

[Darwin] Implement multiple read and subscribe #25840

Merged
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
23dc3a6
Implement darwin multiple attribute, event read / subscribe
joonhaengHeo Mar 17, 2023
fce7525
restyle
joonhaengHeo Mar 17, 2023
46ffc58
Merge branch 'master' of github.com:joonhaengHeo/connectedhomeip into…
joonhaengHeo Mar 24, 2023
4b84448
Merge branch 'implement_darwin_multiple_read_subscribe' of github.com…
joonhaengHeo Mar 24, 2023
bc5eeb3
Merge branch 'master' of github.com:joonhaengHeo/connectedhomeip into…
joonhaengHeo Mar 25, 2023
a36a2e9
Add Exception check
joonhaengHeo Mar 27, 2023
5be3414
Remove unused code
joonhaengHeo Mar 27, 2023
2e7495e
Restyle
joonhaengHeo Mar 27, 2023
4488b7e
Merge branch 'master' into implement_darwin_multiple_read_subscribe
joonhaengHeo Mar 27, 2023
69548b2
Modify from comment
joonhaengHeo Mar 28, 2023
51c8670
Restyle
joonhaengHeo Mar 28, 2023
f8d8c69
Add MTRAttributeRequestPath, EventRequestPath
joonhaengHeo Apr 7, 2023
09d9521
restyle
joonhaengHeo Apr 7, 2023
d9c09b0
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
4b65716
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
5c4302f
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
bfc594a
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
23bdf38
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
e5d6acb
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
b084dc9
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
392e276
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
3d01392
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
00831ca
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
d4a25dc
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
9a11f72
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
4131e35
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
fc27a7c
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
d6ff44c
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
dd9dfda
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
b05f10e
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
465963a
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
287d75d
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 8, 2023
574120f
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
b8cb57d
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
39978a5
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
95ec85b
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
cae5d81
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
1160cf8
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
374845b
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
ec0434a
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
5981cbd
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 8, 2023
ebfbfce
fix build error
joonhaengHeo Apr 9, 2023
a26987a
restyle
joonhaengHeo Apr 9, 2023
dca26f6
Add set null eventPath
joonhaengHeo Apr 9, 2023
d6027d0
Merge branch 'implement_darwin_multiple_read_subscribe' of github.com…
joonhaengHeo Apr 9, 2023
6267b37
Modify memort allocation
joonhaengHeo Apr 11, 2023
e77bd17
restyle
joonhaengHeo Apr 11, 2023
cc4f374
Modify delete -> memoryfree
joonhaengHeo Apr 11, 2023
7144454
Update code
joonhaengHeo Apr 12, 2023
32cc8ce
remove unused code
joonhaengHeo Apr 12, 2023
7eb0bbb
restyle
joonhaengHeo Apr 12, 2023
5c9d323
Merge branch 'master' into implement_darwin_multiple_read_subscribe
joonhaengHeo Apr 12, 2023
12373e9
Fix crash in Test
joonhaengHeo Apr 12, 2023
0d0de78
Add TestCases, modify some issues
joonhaengHeo Apr 12, 2023
3adafc0
restyle
joonhaengHeo Apr 12, 2023
069c9ee
Add comment, modify testcase
joonhaengHeo Apr 12, 2023
a1cd0cc
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 12, 2023
debd9aa
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 12, 2023
ac6a7ab
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 12, 2023
580746f
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 12, 2023
bd0ff2a
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 12, 2023
3212054
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 12, 2023
48e88fd
Update src/darwin/Framework/CHIP/MTRBaseDevice.h
joonhaengHeo Apr 12, 2023
85aac30
modify code location, add some patch
joonhaengHeo Apr 12, 2023
3c7b624
modify typo
joonhaengHeo Apr 12, 2023
477a88e
Add assert code
joonhaengHeo Apr 12, 2023
c83dfd5
restyle
joonhaengHeo Apr 12, 2023
e442c8c
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 13, 2023
dd40779
Update src/darwin/Framework/CHIP/MTRBaseDevice.mm
joonhaengHeo Apr 13, 2023
994c73e
Add subscribe null check
joonhaengHeo Apr 13, 2023
3619342
Merge branch 'master' into implement_darwin_multiple_read_subscribe
joonhaengHeo Apr 13, 2023
c97da79
modify
joonhaengHeo Apr 14, 2023
40eca60
Modify using uniqur_ptr
joonhaengHeo Apr 17, 2023
f855ea5
restyle
joonhaengHeo Apr 17, 2023
fb12a69
Revert "restyle"
joonhaengHeo Apr 18, 2023
5428b0a
Revert "Modify using uniqur_ptr"
joonhaengHeo Apr 18, 2023
b8cdaf1
modify using scopeBuffer
joonhaengHeo Apr 18, 2023
d493f31
restyle
joonhaengHeo Apr 18, 2023
995d77f
Dispatch resubscription callback to the right queue.
bzbarsky-apple Apr 18, 2023
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
24 changes: 13 additions & 11 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,13 @@ - (void)readAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullable)attri
size_t count = 0;
eventPathParamsList
= static_cast<EventPathParams *>(Platform::MemoryCalloc([events count], sizeof(EventPathParams)));
VerifyOrReturnError(eventPathParamsList != nullptr, CHIP_ERROR_NO_MEMORY);
if (eventPathParamsList == nullptr) {
if (attributePathParamsList != nullptr) {
Platform::MemoryFree(attributePathParamsList);
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
attributePathParamsList = nullptr;
}
return CHIP_ERROR_NO_MEMORY;
}
for (MTREventRequestPath * event in events) {
[event convertToEventPathParams:eventPathParamsList[count++]];
}
Expand Down Expand Up @@ -1396,11 +1402,9 @@ - (void)subscribeToAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullabl
container.pathParams = static_cast<AttributePathParams *>(
Platform::MemoryCalloc([attributes count], sizeof(AttributePathParams)));
joonhaengHeo marked this conversation as resolved.
Show resolved Hide resolved
if (container.pathParams == nullptr) {
if (reportHandler) {
dispatch_async(queue, ^{
reportHandler(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_NO_MEMORY]);
});
}
dispatch_async(queue, ^{
reportHandler(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_NO_MEMORY]);
});
return;
}
for (MTRAttributeRequestPath * attribute in attributes) {
Expand All @@ -1412,11 +1416,9 @@ - (void)subscribeToAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullabl
container.eventPathParams
= static_cast<EventPathParams *>(Platform::MemoryCalloc([events count], sizeof(EventPathParams)));
joonhaengHeo marked this conversation as resolved.
Show resolved Hide resolved
if (container.eventPathParams == nullptr) {
if (reportHandler) {
dispatch_async(queue, ^{
reportHandler(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_NO_MEMORY]);
});
}
dispatch_async(queue, ^{
reportHandler(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_NO_MEMORY]);
});
return;
}
for (MTREventRequestPath * event in events) {
Expand Down