-
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
Use CHIPDeviceController::ServiceEvents into the iOS app #1401
Use CHIPDeviceController::ServiceEvents into the iOS app #1401
Conversation
Size increase report for "Build Examples [nRF]"
Full report output
|
Size increase report for "Build Examples [ESP32]"
Full report output
|
Size increase report for "Build Examples [main-build]"
Full report output
|
if (inetLayer != NULL && inetLayer->State == chip::Inet::InetLayer::kState_Initialized) { | ||
inetLayer->HandleSelectResult(selectRes, &readFDs, &writeFDs, &exceptFDs); | ||
} | ||
self.cppController->ServiceEvents(); |
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.
@vivien-apple this was structured in the way it was for a specific reason. We don't want to hold the lock for the entire select
duration.
So the code was structured to grab the chip locks for a short time before going and waiting(calling select on the fds) inside the selectQueue (the current queue this block is executing on).
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.
Ah right. I guess I will have to add it back with some #ifdef and a comment then. Sorry for the noise.
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.
Why the #ifdef, sorry I might be missing some context too. :)
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 am trying to enable the NW.Framework backend in the demo app.
But PrepareSelect/HandleSelectResult are guarded by CHIP_SYSTEM_CONFIG_USE_SOCKETS
I'm working on a patch to fix that on the platform side (since I need parts of ServiceEvents since system timers like the secure session expiry relies on it if I'm correct) but in the meantime I was hoping to have a version of the iOS demo app that I can use as if, compatible with the sockets backend and the NW backend.
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.
Okay yeah i suspected as much. Makes sense! 😄
Problem
The _serviceEvents code in the iOS app do the same thing than CHIPDeviceController::ServiceEvents except that it assumes that SystemLayer and InetLayer have some methods expose only with CHIP_SYSTEM_CONFIG_USE_SOCKETS is defined.
Summary of Changes