Skip to content

Commit

Permalink
Move Network Commissioning driver source includes into app projects
Browse files Browse the repository at this point in the history
Network commissioning source is unconditionally included in the Linux
platform.  But this only makes sense for commissionable apps that
actually use this code.

This commit moves these source includes to the apps and also fixes a
build error that is arising from blindly assigning size_t to a uint8_t.
  • Loading branch information
msandstedt committed Jul 6, 2022
1 parent 2e026cc commit f89243e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/src/platform/Linux/NetworkCommissioningDriver.h",
"${chip_root}/src/platform/Linux/NetworkCommissioningEthernetDriver.cpp",
"AppOptions.cpp",
"include/tv-callbacks.cpp",
"include/tv-callbacks.h",
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-minimal-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/src/platform/Linux/NetworkCommissioningDriver.h",
"${chip_root}/src/platform/Linux/NetworkCommissioningEthernetDriver.cpp",
"AppOptions.cpp",
"include/tv-callbacks.cpp",
"include/tv-callbacks.h",
Expand Down
2 changes: 2 additions & 0 deletions examples/ota-requestor-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ executable("chip-ota-requestor-app") {
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/app/server",
"${chip_root}/src/lib",
"${chip_root}/src/platform/Linux/NetworkCommissioningDriver.h",
"${chip_root}/src/platform/Linux/NetworkCommissioningEthernetDriver.cpp",
]

cflags = [ "-Wconversion" ]
Expand Down
2 changes: 1 addition & 1 deletion src/include/platform/NetworkCommissioning.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Iterator
struct Network
{
uint8_t networkID[kMaxNetworkIDLen];
uint8_t networkIDLen;
size_t networkIDLen;
bool connected;
};

Expand Down
2 changes: 0 additions & 2 deletions src/platform/Linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ static_library("Linux") {
"KeyValueStoreManagerImpl.cpp",
"KeyValueStoreManagerImpl.h",
"Logging.cpp",
"NetworkCommissioningDriver.h",
"NetworkCommissioningEthernetDriver.cpp",
"PlatformManagerImpl.cpp",
"PlatformManagerImpl.h",
"PosixConfig.cpp",
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/NetworkCommissioningDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class LinuxEthernetDriver final : public EthernetDriver

// Public, but cannot be accessed via NetworkIterator interface.
uint8_t interfaceName[kMaxNetworkIDLen];
uint8_t interfaceNameLen = 0;
size_t interfaceNameLen = 0;
bool exhausted = false;
};

Expand Down

0 comments on commit f89243e

Please sign in to comment.