Skip to content

Commit

Permalink
Introducing ble adaptation for webOS (#18498)
Browse files Browse the repository at this point in the history
* [webOS] Support ble-wifi commissioning for webOS

* Implement the base functions
* Add ble central functionality

* Clean up sources under src/platform/webos

* Wipe out linux legacy left-over
* Remove white space
* Rename CHIPDevicePlatformEvent as *WebOS*
* Change CHIP_DEVICE_LAYER_TARGET from Linux to webos
* Change static library name of src/platform/webos as webos

* Fix build error of webOS platform

* Use resources under src/platform/Linux which is not overriden by webOS
* Remove configurationManagerImple.cpp
* Change CHIP_CONFIG_MDNS_CACHE_SIZE as 0
* Use webos for chip_device_platform

* Fix build error while building webos platform

* Build NetworkCommissioning resources
* Change header name from Linux to webos
* Build openthread to compile NetworkCommissioning resources

* Enable chip_enable_openthread

* Enable chip_enable_openthread as true for webOS build

* Update license

* This commit updates the license of ConenctivityManagerImpl.cpp

* Fix build structure of webos platform

* chip_use_ephemeral_port_for_mdns_unicast_query should be set as true
  for webOS as well.
* chip_enable_openthread should be set as true for webOS as well.
* chip_config_network_layer_ble is removed from gn gen command on scripts/
  examples/webos_example.sh, and will be set as true for default.
  chip_enable_ble will follow the chip_config_network_layer_ble.
* Initialize the result value inside MainLoop::StartLSMainLoop as true.

* [webOS] Remove unused codes in PlatfromManagerImpl

* Remove unused codes in PlatfromManagerImpl.cpp

* Fix build error due to latest upstream

* Compile error due to latest upstreat is fixed.
* Sync up and import missing resources from src/platform/Linux

* Fix build error on webos platform

* Remove type
* Remove unnecessary files for initial commit

* Remove commented line

* Remove garbage on Logging.cpp

* Remove commented linea (cont)

* Remove garbage on Logging.cpp

* Fix build error due to fetch latest upstream

* sysroot_webos variable is changed to webos_sysroot
* Migrate PlatformManagerImpl.cpp from Linux platform

* Restyled by clang-format

* Restyled by gn

* Fix code-lints errors

* Fix code-lints errors

Co-authored-by: sungmok.shin <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Feb 5, 2024
1 parent f88794e commit c73489c
Show file tree
Hide file tree
Showing 53 changed files with 11,844 additions and 179 deletions.
2 changes: 1 addition & 1 deletion build/config/webos/webos_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.

declare_args() {
sysroot_webos = ""
webos_sysroot = ""
}
1 change: 1 addition & 0 deletions build/config/webos/webos_sysroot.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("${build_root}/config/webos/webos_sdk.gni")

sysroot = webos_sysroot
2 changes: 1 addition & 1 deletion scripts/examples/webos_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ echo ""
# Build webos example
echo "##### Build webos example #####"
echo "##### Performing gn gen #####"
gn gen out/host --args="is_debug=false target_os=\"webos\" target_cpu=\"arm\" chip_enable_python_modules=false ar_webos=\"$AR\" cc_webos=\"$CC -Wno-format-security\" cxx_webos=\"$CXX\" sysroot_webos=\"$PKG_CONFIG_SYSROOT_DIR\" chip_build_tests=false enable_syslog=true chip_config_network_layer_ble=false treat_warnings_as_errors=false"
gn gen out/host --args="is_debug=false target_os=\"webos\" target_cpu=\"arm\" chip_enable_python_modules=false ar_webos=\"$AR\" cc_webos=\"$CC -Wno-format-security\" cxx_webos=\"$CXX\" webos_sysroot=\"$PKG_CONFIG_SYSROOT_DIR\" chip_build_tests=false enable_syslog=true treat_warnings_as_errors=false"

echo "##### Building by ninja #####"
ninja -C out/host
1 change: 1 addition & 0 deletions scripts/tools/check_includes_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
'/platform/Tizen/',
'/platform/P6/',
'/platform/bouffalolab/BL602',
'/platform/webos/',
r'POSIX\.h$',
}

Expand Down
3 changes: 2 additions & 1 deletion src/lib/dnssd/minimal_mdns/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ declare_args() {
# payloads) and clients need to allocate more resources for this (need one
# more UDP socket and corresponding code for the unicast query sending)
chip_use_ephemeral_port_for_mdns_unicast_query =
current_os == "mac" || current_os == "linux" || current_os == "android"
current_os == "mac" || current_os == "linux" || current_os == "android" ||
current_os == "webos"

# Be very verbose regarding packet communication. Will spend extra RAM and
# Time to report mdns traffic in terms of sent and seen data.
Expand Down
6 changes: 3 additions & 3 deletions src/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {

if (chip_device_platform == "linux" || chip_device_platform == "darwin" ||
chip_device_platform == "tizen" || chip_device_platform == "android" ||
chip_device_platform == "k32w0") {
chip_device_platform == "k32w0" || chip_device_platform == "webos") {
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ]
}

Expand Down Expand Up @@ -249,7 +249,7 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
} else if (chip_device_platform == "webos") {
defines += [
"CHIP_DEVICE_LAYER_TARGET_WEBOS=1",
"CHIP_DEVICE_LAYER_TARGET=Linux",
"CHIP_DEVICE_LAYER_TARGET=webos",
"CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
]
defines -=
Expand Down Expand Up @@ -351,7 +351,7 @@ if (chip_device_platform != "none") {

# Linux has its own NetworkCommissioningThreadDriver
if (chip_enable_openthread && chip_device_platform != "linux" &&
chip_device_platform != "tizen") {
chip_device_platform != "tizen" && chip_device_platform != "webos") {
sources += [
"OpenThread/GenericNetworkCommissioningThreadDriver.cpp",
"OpenThread/GenericNetworkCommissioningThreadDriver.h",
Expand Down
3 changes: 2 additions & 1 deletion src/platform/device.gni
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ declare_args() {
chip_enable_openthread =
chip_device_platform == "linux" || chip_device_platform == "qpg" ||
chip_device_platform == "cc13x2_26x2" ||
chip_device_platform == "k32w0" || chip_device_platform == "tizen"
chip_device_platform == "k32w0" || chip_device_platform == "tizen" ||
chip_device_platform == "webos"
}

declare_args() {
Expand Down
Loading

0 comments on commit c73489c

Please sign in to comment.