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

[example] Linux Example App - Light #2365

Merged
merged 1 commit into from
Sep 11, 2020

Conversation

erjiaqing
Copy link
Contributor

@erjiaqing erjiaqing commented Aug 28, 2020

Problem

Currently, there is a chip-server in chip-tool acts as a lighting app for testing use comes with the initial PR with cirque tests, which is a bit hack, and unclean. Also we need a Lighting app for linux as a example, it is clear that merge the two app into one will be better.

Summary of Changes

  1. Move old chip-server in chip-tools to lighting-app/linux
  2. Refine chip-tools and update cirque test

Note

  1. After [example-apps] Extract platform independent server init and datamodel #2367 is merged, there will be another PR (or rebase this one if not merged) to reduce the dublicate code between multiple platforms.

issue #2302
fix #1761

@erjiaqing erjiaqing changed the title [example] Linux chip lighting demo [example] Linux Light Example App Aug 28, 2020
@erjiaqing erjiaqing changed the title [example] Linux Light Example App [example] Linux Example App - Light Aug 28, 2020
Copy link
Contributor

@bukepo bukepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:+1:


if (waitingForResponse)
std::unique_lock<std::mutex> lk(cvWaitingForResponseMutex);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bzbarsky-apple will you have a look here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part looks fine to me, given that we set waitingForResponse to true before we call SendMessage, so even a sync callback under there will do the right thing.


include_dirs = [
".",
"${chip_root}/src/app/util",
Copy link
Contributor

@rwalker-apple rwalker-apple Aug 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer that we used #include <app/util/XXX.h> in source files and and have -I${chip_root}/src if possible. if there's an issue with a file in gen/ that makes this pattern untenable, lemme know

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of includes in gen files of af.h, af-types.h, util.h. More importantly, there are includes like that in the non-gen files too. We could fix that by adding ${chip_root}/src to the include path for all the apps involved, then changing the non-gen files, then changing the various gen files in the apps, then removing ${chip_root}/src/app/util from the include paths...

I would argue for not trying to do that as part of this PR and doing a followup instead.

@@ -53,33 +55,37 @@
using namespace ::chip;
using namespace ::chip::Inet;

namespace {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@rwalker-apple
Copy link
Contributor

Problem

Summary of Changes

  1. Move old chip-server in chip-tools to lighting-app/linux
  2. Refine chip-tools and update cirque test

issue #2302
fix #1761

@erjiaqing can you please phrase a problem for this PR?

examples/chip-tool/main.cpp Outdated Show resolved Hide resolved
examples/chip-tool/main.cpp Outdated Show resolved Hide resolved
@rwalker-apple
Copy link
Contributor

@saurabhst @hawk248 @jelderton ?

examples/chip-tool/main.cpp Outdated Show resolved Hide resolved
examples/chip-tool/main.cpp Outdated Show resolved Hide resolved
@mspang
Copy link
Contributor

mspang commented Sep 8, 2020

@saurabhst

@rwalker-apple
Copy link
Contributor

@erjiaqing need conflicts addressed

[examples] Initial lighting app on linux platform

nit

address comments

move cv outside the lock scope

Followup project-chip#2413

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

Successfully merging this pull request may close these issues.

[Linux Platform Example] Virtual Devices - Light
6 participants