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

Use CHIPDeviceController::ServiceEvents into the iOS app #1401

Conversation

vivien-apple
Copy link
Contributor

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

  • replace the code inside _serviceEvents by a call to an equivalent platform code inside CHIPDeviceController::ServiceEvents.

@pullapprove pullapprove bot requested a review from woody-apple July 1, 2020 16:12
@chip-bot
Copy link

chip-bot commented Jul 1, 2020

Size increase report for "Build Examples [nRF]"

File Section File VM
Full report output
Bloat report for job 'Build Examples [nRF]'

Files found only in the baseline:
    bloat_report.txt

Comparing master_binaries/nrf-build/chip-nrf52840-lock-example.out and example_binaries/nrf-build/chip-nrf52840-lock-example.out:

sections,vmsize,filesize


@chip-bot
Copy link

chip-bot commented Jul 1, 2020

Size increase report for "Build Examples [ESP32]"

File Section File VM
chip-wifi-echo.elf .dram0.bss 0 8
chip-wifi-echo.elf .flash.rodata -8 -8
chip-wifi-echo.elf .flash.text -48 -48
Full report output
Bloat report for job 'Build Examples [ESP32]'

Files found only in the baseline:
    bloat_report.txt

Comparing master_binaries/esp32-build/chip-wifi-echo.elf and example_binaries/esp32-build/chip-wifi-echo.elf:

sections,vmsize,filesize
.dram0.bss,8,0
[Unmapped],0,8
.flash.rodata,-8,-8
.flash.text,-48,-48


@chip-bot
Copy link

chip-bot commented Jul 1, 2020

Size increase report for "Build Examples [main-build]"

File Section File VM
Full report output
Bloat report for job 'Build Examples [main-build]'

Files found only in the baseline:
    bloat_report.txt

Comparing master_binaries/main-build/chip-standalone-demo.out and example_binaries/main-build/chip-standalone-demo.out:

sections,vmsize,filesize


@woody-apple woody-apple merged commit 3da1254 into project-chip:master Jul 1, 2020
if (inetLayer != NULL && inetLayer->State == chip::Inet::InetLayer::kState_Initialized) {
inetLayer->HandleSelectResult(selectRes, &readFDs, &writeFDs, &exceptFDs);
}
self.cppController->ServiceEvents();
Copy link
Contributor

@sagar-apple sagar-apple Jul 1, 2020

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).

Copy link
Contributor Author

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.

Copy link
Contributor

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. :)

Copy link
Contributor Author

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.

Copy link
Contributor

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! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants