Skip to content

Commit

Permalink
Add network-manager example app skeleton and NIM device type placehol…
Browse files Browse the repository at this point in the history
…der (project-chip#30574)

* Add Matter Network Infrastructure Manager device type

Note: Using a vendor-specific id as a placeholder

* Add network-manager example app skeleton
  • Loading branch information
ksperling-apple authored Nov 29, 2023
1 parent 8fbc294 commit e80b184
Show file tree
Hide file tree
Showing 18 changed files with 4,867 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,12 @@ rvc-app/README
air-purifier-app/**/README
```

## Network Infrastructure Manager example

```{toctree}
:glob:
:maxdepth: 1
network-manager-app/README
```
1 change: 0 additions & 1 deletion examples/build_overrides/pigweed_environment.gni
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@
_bootstrap_root = "//third_party/connectedhomeip"

import("${_bootstrap_root}/build_overrides/pigweed_environment.gni")

4 changes: 4 additions & 0 deletions examples/network-manager-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# network-manager-app

This is a reference application that implements the Network Infrastructure
Manager device type.
25 changes: 25 additions & 0 deletions examples/network-manager-app/linux/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
import("//args.gni")
}
40 changes: 40 additions & 0 deletions examples/network-manager-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

executable("network-manager-app") {
sources = [
"include/CHIPProjectAppConfig.h",
"main.cpp",
]

deps = [
"${chip_root}/examples/network-manager-app/network-manager-common",
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/lib",
]

include_dirs = [ "include" ]
output_dir = root_out_dir
}

group("linux") {
deps = [ ":network-manager-app" ]
}

group("default") {
deps = [ ":linux" ]
}
24 changes: 24 additions & 0 deletions examples/network-manager-app/linux/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")

chip_project_config_include = "<CHIPProjectAppConfig.h>"
chip_project_config_include_dirs = [
"//include",
"${chip_root}/config/standalone",
]

chip_config_network_layer_ble = false
1 change: 1 addition & 0 deletions examples/network-manager-app/linux/build_overrides
25 changes: 25 additions & 0 deletions examples/network-manager-app/linux/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
*
* Copyright (c) 2023 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 0xFFF10010 // TODO: ID-TBD
#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Network Infrastructure Manager"

// Inherit defaults from config/standalone/CHIPProjectConfig.h
#include <CHIPProjectConfig.h>
35 changes: 35 additions & 0 deletions examples/network-manager-app/linux/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2023 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <AppMain.h>

using namespace chip;
using namespace chip::app;

void ApplicationInit() {}
void ApplicationShutdown() {}

int main(int argc, char * argv[])
{
if (ChipLinuxAppInit(argc, argv) != 0)
{
return -1;
}

ChipLinuxAppMainLoop();
return 0;
}
24 changes: 24 additions & 0 deletions examples/network-manager-app/network-manager-common/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/src/app/chip_data_model.gni")

chip_data_model("network-manager-common") {
zap_file = "network-manager-app.zap"

zap_pregenerated_dir =
"${chip_root}/zzz_generated/network-manager-app/zap-generated"
is_server = true
}
Loading

0 comments on commit e80b184

Please sign in to comment.