diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt deleted file mode 100644 index c84d4038352101..00000000000000 --- a/.github/.wordlist.txt +++ /dev/null @@ -1,1627 +0,0 @@ -14 -15 -16 -17 -18 -19 -20 -21 -22 -AAAA -aarch -abcdef -abfb -ABI -ABIs -ables -accesscontrol -accessor -Accessors -acdbc -ack -ACKed -ACL -ACLs -actdiag -adb -AddNOC -addr -adk -adoc -adr -AdvAutonomous -AdvManagedFlag -AdvOnLink -AdvRouterAddr -AdvSendAdvert -AE -aef -AES -AFL -AIDL -algs -alloc -Ameba -amebad -amebaiot -AmebaZ -amebaz2 -announcementReason -AnnounceOTAProvider -AnnounceOTAProviderRequest -APIs -apk -AppImpl -AppleTV -appliable -applianceeventsandalert -ApplianceIdentification -appliancestatistics -ApplicationId -ApplicationIdentifier -ApplicationLauncher -ApplyUpdate -applyUpdateAction -ApplyUpdateRequest -ApplyUpdateResponse -approver -appspot -appwrite -aps -arg -argc -args -argv -armeabi -armino -ARMmbed -armv -ASAN -asdk -ASR -AssertionError -AST -ASYNC -ATLs -atomics -att -attId -attr -attrib -AttributeAccessInterface -attributeValue -attrListName -attrMask -attSizeBytes -attType -ATW -ATWC -AudioOutput -auth -AuthMode -autoApplyImage -autocompletion -AutoConf -autoconnect -autocrlf -autogenerated -automake -autotools -avahi -avL -AwaitNextAction -AXXXF -AYNJV -babaf -backend -backends -backticks -backtrace -BallastConfiguration -BarrierControl -BasicCHIPRegression -BasicInformation -baudrate -BCM -BD -BDX -BDXDownloader -BeagleBone -befc -BEKEN -betaprogram -BinaryInputBasic -Binfmt -bitbake -bld -BLE -BleApplicationDelegate -BleLayer -BLEManager -BLEManagerImpl -BlePlatformDelegate -Blinls -bloaty -blockdiag -blocklist -blockquote -bluetoothd -bluez -BOOL -booleans -BooleanState -bootable -Bootloader -BorderRouterAP -bouffalolab -BRD -breakpoint -bredr -BridgedDeviceBasicInformation -bringup -BroadcastReceiver -BromateConcentrationMeasurement -BromodichloromethaneConcentrationMeasurement -BromoformConcentrationMeasurement -bt -btmgmt -BTN -BTP -btvirt -BuildKit -buildwithmatter -buildX -burndown -ButtonIsr -BytesMain -bz -bzip -CACACACA -cacerts -CAfile -cancelled -capacitive -CarbonDioxideConcentrationMeasurement -CarbonMonoxideConcentrationMeasurement -CaseAdminNode -CatalogVendorId -CBB -cbd -CBOR -Ccache -ccf -CCMP -CCS -CCSTUDIO -CCXML -CDEEDC -CDVersionNumber -ced -cfg -CFLAGS -cgit -cgroup -changeset -Channel -characterised -CharString -checkmark -ChipBLEMgr -CHIPCirqueTest -CHIPConfig -CHIPCryptoPALHsm -CHIPDeviceController -ChipDeviceCtrl -CHIPDeviceEvent -CHIPDevicePlatformConfig -CHIPDevicePlatformEvent -ChipEchoRequester -ChipEchoResponder -ChipImInitiator -ChipImResponder -ChipLight -ChipMessageLayer -CHIPOBLE -CHIPProjectAppConfig -CHIPProjectConfig -CHIPTest -chiptests -CHIPTool -ChloraminesConcentrationMeasurement -ChlorineConcentrationMeasurement -ChlorodibromomethaneConcentrationMeasurement -ChloroformConcentrationMeasurement -chmod -chown -chrpath -CIPD -CircleCI -cJTAG -CKIT -CLA -clapre -CLI -CLIs -cloudbuild -CLRF -clusterAttrs -ClusterName -ClusterObjectTests -ClusterRevision -ClusterTestGeneration -cmake -CMakeLists -CMD -CMS -CMSIS -CMVH -cn -COAP -codeaurora -codebase -codegen -CodeGenerator -CodeLab -codelabs -ColorControl -Comcast -Commandline -CommandHandlerInterface -CommandName -Commissionable -CommissionableDataProvider -commissionables -commissionee -CommissioningFlow -commondatastorage -CONF -CONFIG -ConfigDescription -configs -configTOTAL -ConfigurationManager -ConfigurationManagerImpl -conformant -connectedhomeip -ConnectionData -ConnectIP -ConnectivityManager -ConnectivityManagerImpl -ConnectNetwork -ConnectNetworkRequest -ConnectNetworkResponse -connstring -conntype -const -ContentApp -ContentApp's -ContentAppPlatform -ContentLaunch -ContentLauncher -contrib -controllee -conv -CopperConcentrationMeasurement -Corstone -cortexa -cp -cpio -cpp -cppreference -CPROTO -cpuapp -cpython -CQM -crypto -cryptographic -CSA -csg -csrrequest -csu -csv -ctl -ctrl -ctypes -CurrentHue -CurrentLevel -CurrentSaturation -customAcl -customizations -cvfJ -cxx -CY -CYW -DAC -DACs -dadbdcdddedf -DAP -DAPLINK -DataFrame -datamodel -DataModelRevision -dataset -datasets -datastore -DataVersion -dbf -DBG -dBm -DBUILD -dbus -dcc -DCHIP -DCL -DCMAKE -DCONF -DCONFIG -debianutils -debugText -decrypt -decrypted -DEDEDEDE -deepnote -DefaultOTAProviders -DefaultOTARequestor -DefaultOTARequestorDriver -DefaultOTARequestorStorage -DefaultSuccess -definedValue -DehumidificationControl -DelayedActionTime -delayedApplyActionTimeSec -delayedQueryActionTimeSec -delayQuery -deliverables -demangle -deployable -depottools -deps -der -desc -descheduled -detokenization -detokenizer -dev -devcontainer -devCtrl -DevelopmentCerts -DeviceAttestationCredentialsProvider -DeviceAttestationCredsExample -DeviceCaCerts -DeviceCert -DeviceCommissioner -DeviceCommon -DeviceController -DeviceId -DeviceInstanceInfoProvider -DeviceLayer -DeviceNetworkProvisioningDelegate -DeviceNetworkProvisioningDelegateImpl -DevicePairingDelegate -DeviceTemperatureConfiguration -DevKitC -DevKitM -devtype -df -dfe -DFILE -dfu -DgDxsfHx -dhclient -DHCP -DHCPC -DHCPv -dhrishi -DiagnosticLogs -dialout -diffstat -diffsyms -dimmable -dirname -dirs -disableNotifyUpdateApplied -disambiguated -discoverable -DispatchEvent -DispatchEventToApplication -DissolvedOxygenConcentrationMeasurement -DISTRO -Distutils -DK -DL -DM -DMG -DMM -DNS -Dnsmasq -dnsmasqd -DNSSD -DNSStubListener -docbuild -Dockerfile -Dockerfiles -Don'ts -DoorLock -DoorState -doru -DOTBR -DOVERLAY -downcasting -DownloadProtocolEnum -Doxygen -dpkg -dropdown -dryrun -DS -duplicative -DUT -DUTS -DUT's -DV -DVK -dynload -eabi -EB -ECC -ECD -ECDH -ECDSA -EchoMessage -EchoRequests -EchoResponse -EchoService -ECW -edaf -edc -EDR -ee -eea -EEE -eef -ef -EFR -efuse -eg -EjQ -elftools -elock -emberAf -emberAfExternalAttributeReadCallback -emberAfExternalAttributeWriteCallback -EmberAfInitializeAttributes -emberAfSetDynamicEndpoint -emsp -EnableNetwork -EnableWiFiNetwork -endian -EndpointId -eno -entrypoint -enum -Enums -env -epochKey -epochStartTime -eq -errorValue -esd -espcoredump -ESPPORT -Espressif -esptool -eth -EthernetNetworkDiagnostics -ethernets -EthyleneConcentrationMeasurement -EthyleneOxideConcentrationMeasurement -EvalCode -EvalCodeWithName -EvalFrameDefault -EV -EVB -EventLogging -evk -EVSE -exceptfds -ExchangeContext -exe -ExecStart -executables -ExtendedPAN -ExtensionEntry -extern -extpanid -FabricId -fabricIdx -fabricIndex -factoryreset -FanControl -fb -fbb -fbd -FC -FCJ -FDDE -fddead -fde -fdx -FECA -FecalColiformAndEColiConcentrationMeasurement -feff -ffaa -ffeebaefa -FFF -fffe -fffff -Fi -filepath -fini -FixedLabel -flashdebug -FlowMeasurement -FluorideConcentrationMeasurement -focusable -forkpty -FOTA -FreeRTOS -FreeRTOSConfig -FS -fsl -fstab -fsync -ftd -fullclean -fuzzer -fuzztest -FW -gbl -gcloud -GDB -gdbgui -gdbserver -GeneralCommissioning -GeneralDiagnostics -generalised -GenericConfigurationManagerImpl -GenericConnectivityManagerImpl -GenericImpl -GenericPlatformManagerImpl -GenericThreadConfigurationManagerImpl -GenericThreadStackManagerImpl -GenericWiFiConfigurationManagerImpl -GetDeviceId -GetDeviceInfo -GetDns -getter -getters -GetInDevelopmentTests -GetIP -getManualTests -GetSafeAttributePersistenceProvider -getstarted -GH -ghcr -ghp -githubusercontent -gitignore -glibc -gn -GND -gni -GNinja -GNUARMEMB -gnueabihf -googleapis -googlesource -GPG -GPIO -GPL -GPLv -Gradle -gradlew -graphviz -Groupcast -GroupId -GroupKeyManagement -groupsettings -gsdk -gtk -GUA -Gv -gz -gzbf -HaloaceticAcidsConcentrationMeasurement -HandleCommand -hardcoded -hardknott -hardwarever -HardwareVersion -HardwareVersionString -hasValue -hci -hciattach -hciconfig -hdlc -HEPA -HKDF -HMAC -hoc -homebrew -HomePod -HomePods -hostapd -hostname -href -HSM -hsm -HTTPS -Humidistat -HW -hwadr -HydrogenConcentrationMeasurement -HydrogenSulphideConcentrationMeasurement -IasAce -IasWd -iaszone -ibb -ICA -ICAC -ICD -ICDs -iCloud -ICMP -IDF -IDL -IDLs -idt -idx -ifconfig -ifdef -ifdefs -IGMP -ihex -Illuminance -IlluminanceMeasurement -IM -imager -imagetool -imageUri -img -Impl -ImplClass -implementers -imx -imxlinux -incomingCommands -indexhtml -Inet -InetLayer -Infineon -ini -init -InitArgs -inlined -InputLoop -installDebug -instantiation -integrations -IntelliSense -InteractionModelEngine -InteractionModelVersion -Interoperable -introvideos -InvokeCommandRequests -InvokeCommandResponse -IoT -ipaddr -iPadOS -ipadr -IPK -ipp -iptables -iputils -IPv -ipykernel -ipynb -IPython -ISCAN -isHexString -isLowerCase -isUpperCase -itemName -iterable -itsfoss -JDK -jinja -JLink -JLinkExe -JLinkRTTClient -JN -jni -jpg -jre -js -json -JTAG -Jupyter -jupyterlab -KA -kAdminister -kbd -kBusy -kCase -Kconfig -kDacPublicKey -KeypadInput -keypair -keyset -kGroup -kInvalidCommandId -KitProg -kManage -kNewButton -kNodeIdNotSpecified -knownissues -kOperate -kPAKEParameterError -kPase -kView -KVS -kWindowNotOpen -LabelList -LabelStruct -launchable -LAUNCHXL -ldflags -LeadConcentrationMeasurement -LEDs -LevelControl -LF -libavahi -libc -libcairo -libCHIP -libdbus -LIBDIR -libegl -libffi -libfuzzer -libgirepository -libglib -libical -libncurses -libreadline -libsdl -libshell -libssl -libstdc -libthread -libtool -libTransportLayer -libudev -libwebkitgtk -lifecycle -lightbulb -lightin -LightingApp -LightingColor -LightingState -LinkSoftwareAndDocumentationPack -lladdr -LocalConfigDisabled -localedef -localhost -LocalizationConfiguration -localstatedir -LockingState -LogEvent -loopback -LowPower -LPC -LSP -LTE -LTS -LwIP -LwIP's -LZMA -macaddr -machineType -MacOS -MacOSX -MacPorts -Makefile -makefiles -MakeTpCall -mandir -ManganeseConcentrationMeasurement -ManualPairingCode -ManualTest -ManufacturingDate -masterkey -matterBuildSrcDir -matterc -MatterCustomTrace -matterd -MatterLock -MatterReportingAttributeChangeCallback -matterSdkSourceBuild -matterSourceBuildAbiFilters -matterUTestLib -maxApplicableSoftwareVersion -MaxInterval -MaxIntervalCeilingSeconds -maxLength -MaxRtrAdvInterval -maxValue -mbed -MbedCommissioning -MbedNewTarget -mbedos -mbedTarget -mbedTLS -MCORE -mcu -MCUboot -mcumgr -MCUs -mcux -MCUXpresso -mdash -MDNS -MediaInput -MediaPlayback -MediaTek -MEI -mem -memdf -MemMonitoring -menuconfig -MeshCoP -MeterIdentification -MfgDeviceCaCerts -MfgSpecificPing -mfrcacerts -mfrcert -MfrDeviceCert -MfrDeviceId -mgmt -microcontroller -microcontrollers -MicroSD -middleware -minApplicableSoftwareVersion -Minicom -MinInterval -MinIntervalFloorSeconds -minLength -MinRtrAdvInterval -minValue -mkdir -mlan -MLD -mmevk -moal -Mobly -ModeSelect -modprobe -Modustoolbox -moveMode -MoveToHue -MoveToLevel -MoveToSaturation -MoveWithOnOff -MPSL -MRP -MTD -MTR -MTU -Multiband -Multicast -multilib -Multiprotocol -multithreaded -mutex -mutexes -mv -MX -mydir -MyPASSWORD -MySSID -NAMESERVER -NAMESPACE -namespaces -namespacing -nano -natively -navpad -nbsp -NCP -ncs -nding -NDK -netcmp -netif -netplan -NetworkCommissioning -networkID -networkname -NewUDPEndPoint -nfds -NitricOxideConcentrationMeasurement -NitrogenDioxideConcentrationMeasurement -nl -nltest -nmcli -nmtui -noc -NodeId -nongnu -nordicsemi -NotAvailable -NotifyUpdateApplied -notValue -npm -nRF -nrfconnect -nrfdks -nrfutil -nrfxlib -NTAG -NTP -nullable -nullptr -NUM -NuttX -NVM -NVS -nwdiag -nwk -NXP -objcopy -OccupancySensing -OctetString -OECORE -OID -ol -Onboarding -onboardingcodes -oneshot -onnetwork -OnOff -OnOffClusterTest -OnOffSwitchConfiguration -OnPlatformEvent -onwards -OO -openiotsdk -openjdk -OpenOCD -OpenSSL -OpenThread -OpenThreadDemo -openweave -OperationalCredentials -operationalDataset -opkg -OPTIGA -optionMask -optionOverride -optionsMask -optionsOverride -orgs -OSS -OTA -OTADownloader -otaDownloadPath -otaImageList -OTAImageProcessorDriver -OTAImageProcessorImpl -OTAImageProcessorInterface -otaissues -OTAProvider -OTAProviderIpAddress -OTAProviderNodeId -otaproviders -OTAProviderSerialPort -OTARequesterImpl -OTARequestorDriver -OTARequestorInterface -OTARequestorSerialPort -OTARequestorStorage -otasoftwareupdateapp -OtaSoftwareUpdateProvider -otasoftwareupdaterequestor -otatesting -otaURL -OTBR -otcli -outform -outgoingCommands -overridable -OxygenConcentrationMeasurement -OzoneConcentrationMeasurement -PAA -PAAs -PacketBuffer -PAI -PairDevice -PAIs -PAKE -palletsprojects -PANID -pankore -param -params -PartNumber -PASE -Passcode -passRetained -passwd -PBKDF -pbuf -pbufs -pbxproj -PCA -pcap -pcaps -PDFs -PDK -PDM -peerAddrStr -peerNodeId -peerSessionId -pem -percentageLiftValue -perfetto -periodicQueryTimeout -pexpect -pickString -PICSCODE -PID -Pigweed -PinCode -pinrequest -PIXIT -PIXITs -pkgconfig -PKI -plaintext -PlatformManager -PlatformManagerImpl -plt -PluginServerCallback -png -Podman -PollControl -pollInterval -polymorphism -POSIX -PosixConfig -postAttributeChangeCallback -PowerConfiguration -PowerProfile -PowerSource -PowerSourceConfiguration -pre -preprocessor -Presetup -PressureMeasurement -prj -ProductID -ProductLabel -ProductName -ProductURL -proto -protobuf -protos -Prover -providerFabricIndex -ProviderLocation -providerNodeId -ProxyConfiguration -ProxyDiscovery -ProxyValid -ProxyView -PRs -PSA -PSCAN -PSECT -PSK -PSoC -PTR -pts -PulseWidthModulation -PumpConfigurationAndControl -pwd -PWM -PXXXF -py -pychip -pycrypto -pycryptodome -PyEval -PyFunction -pylint -PyObject -pypi -PyRun -pytest -QEMU -Qorvo -QPG -QRCode -qrcodetool -QRCodeUrl -QSPI -QueryImage -QueryImageResponse -queryImageStatus -Quickstart -qvCHIP -RADVD -raspberryPi -RasPi -rAv -RCAC -RCP -ReadAttribute -ReadConfigValue -readelf -readfds -README -READMEs -readonly -readthedocs -Reag -rebase -recommand -recommanded -recurse -regen -registerAttributeAccessOverride -RegisterCommandHandler -RelativeHumidityMeasurement -RemainAfterExit -remoteDeviceId -Rendez -RendezvousInformation -RendezvousParameters -RendezVousTest -REPL -repo -repos -req -Requestor -Requestor's -RequestorCanConsent -Requestors -responder -RestrictedEvent -retargeting -reusability -reviwed -rfid -rfids -RGB -riscv -rloc -rmw -rodata -Rollershade -rootfs -RPC -RPCs -RPi -RPi's -RPis -RSA -rsn -RSSI -RST -rsync -RTC -rtd -RTL -rtld -RTOS -RTT -RTX -runArgs -runIf -RUNAS -RunMain -runtime -RVC -rw -RXD -sandboxed -saveAs -saveDataVersschemaionAs -sbin -scalability -scalable -schema -schemas -scm -sco -scp -ScriptBinding -SDB -SDC -SDHC -SDK -SDK's -sdkconfig -SDKs -SDKTARGETSYSROOT -sdl -SecureCertDACProvider -SED -SEGGER -semver -SendButton -SendNewInputEvent -sendto -seqdiag -SERIALDEVICE -serialno -SerialNumber -ServiceId -SetDns -SetImageProcessorDelegate -SetOTADownloader -SetOtaRequestorDriver -setpin -setpoint -SetpointRaiseLower -SetRequestorInstance -SetUpPINCode -SetupQRCode -sexualized -sfv -SHA -ShadeConfiguration -SHAs -showDocumentation -showsdks -shubhamdp -SIGINT -SiLabs -Silabs's -SiliconLabs -SimpleFileExFlags -SimpleLink -SiWx -sizedb -sl -SLAAC -SLTB -SLWSTK -SmartThings -smoketest -SMP -socat -socio -SoCs -SodiumConcentrationMeasurement -softap -SoftDevice -softmmu -SoftwareDiagnostics -SoftwareVersion -softwareVersionStr -SoftwareVersionString -softwareVersionValid -SparkFun -sphinxcontrib -SPI -spiflash -spinel -src -SRP -SRV -SSBL -SSID -startoffset -StartScan -startsWith -StatusCode -stderr -stdout -sterm -stlink -stm -stmicroelectronics -storagepath -str -strcpy -struct -structs -su -Subclassing -subcommand -subcommands -subdirectories -subdirectory -subfolder -submodule -submodules -subnet -subprocess -SubscribeResponse -SubscriptionId -substeps -subtype -sudo -SulfateConcentrationMeasurement -SulfurDioxideConcentrationMeasurement -suppressResponse -svg -SVR -SWD -SWU -symlinks -sysbuild -sysconfdir -SysConfig -sysctl -sysdeps -SYSROOT -systemctl -systemd -systemdsystemunitdir -systemduserunitdir -systime -sysv -TargetNavigator -TBD -tbody -tcl -TCP -teardown -Telink -TemperatureMeasurement -templating -Tera -testability -TestArray -TestCluster -TestConstraints -TestEmptyString -TestEqualities -TestGenExample -TestGroupDemoConfig -TestMultiRead -TestName -TestOnlySendCommandTimedRequestFlagWithNoTimedInvoke -TESTPASSWD -TestPICS -TESTSSID -TestString -TestStruct -TestThreadStackMgr -TestTimedRequestTimeout -TestUint -TestUpdateValue -testws -texinfo -textboxes -TFT -ThermostatUserInterfaceConfiguration -ThIsIsNoTMyReAlGiThUbToKeNSoDoNoTtRy -thread -ThreadNetworkDiagnostics -threadOperationalDataset -ThreadStackManager -ThreadStackManagerImpl -ths -Thunderboard -timedInteractionTimeoutMs -TimeFormatLocalization -timeframe -timeoutMs -TimeSynchronization -tinycrypt -Tizen -TKIP -TLS -tlsr -TLV -tmp -tngvndl -TODO -toJson -tokenization -tokenized -tokenizer -toolchain -toolchains -topologies -tos -TotalColiformBacteriaConcentrationMeasurement -totalTests -TotalTrihalomethanesConcentrationMeasurement -TPK -trackAlloc -trackFree -TransferSession -transitionTime -TransportMgrBase -TriggerEffect -TRNG -trustm -TrustedRootCertificates -tsan -TSG -tsv -TTL -tty -ttyACM -ttyACMx -ttymxc -ttyUSB -TurbidityConcentrationMeasurement -TvCasting -TVOC -tvOS -TXD -txt -uargument -UART -UDC -udcport -udhcpc -UDP -UDPEndPoint -udpPort -ug -ui -uint -ULA -Ultrafast -UNBLUR -uncommissioned -Unencrypted -unfocus -Unicast -UniFlash -UnitLocalization -unpair -unprovisioned -Unsecure -Unselect -untrusted -updateAvailable -updateNotAvailable -UpdateTokens -upstreamed -ureverse -URI -urlrequest -usbmodem -usbserial -USBtoUART -uscif -UserConsentNeeded -userConsentState -userguide -USERINTERFACE -UserLabel -usermod -usr -UTF -util -utils -UUID -ux -validator -valgrind -vcom -VCP -Vectorcall -VendorID -VendorName -vendorpayload -venv -ver -Verifier -Verifiers -VID -vids -virtualenv -visualstudio -vlatest -VLEDs -vm -vn -vnc -vous -VPN -VSC -VSCode -WaitNewInputEvent -WakeOnLan -WantedBy -watchdogTimeout -watchOS -webpage -wf -wg -wget -whde -whitespace -whitespaces -whl -wic -WiFiNetworkDiagnostics -WindowCovering -WindowCoveringGoToLiftPercentage -WiseMCU -wlan -wmm -WPA -wpan -wra -WriteAttribute -writefds -wrover -WS -WSL -WSTK -xa -xAAAA -xab -xaver -xb -xbef -xc -xcd -Xcode -xcodebuild -xcodeproj -xcworkspace -xd -xds -xdsdfu -xEA -xEB -xEC -xed -xef -xF -xFA -xFB -xFC -xFD -xFE -xFF -xFFF -xFFFF -xfffff -xFFFFFFEFFFFFFFFF -xtensa -xvzf -xwayland -xyz -xz -xzvf -yaml -yearday -yml -YNJV -Yocto -yoctoproject -YourFolder -zapt -zaptool -ZCL -zclconfigure -zclread -zclsubscribe -zclwrite -ZephyrConfig -zephyrproject -zhengyaohan -Zigbee -zigbeealliance -zigbeethread diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index b8ab010a1dfe5f..00000000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# Current reviewers-XXX teams, who review everything for approval. -* @reviewers-amazon @reviewers-apple @reviewers-comcast @reviewers-google @reviewers-lg @reviewers-nordic @reviewers-samsung @reviewers-silabs @reviewers-tcl diff --git a/.github/ISSUE_TEMPLATE/001-bug-report.yaml b/.github/ISSUE_TEMPLATE/001-bug-report.yaml deleted file mode 100644 index 8944e002c5ecc3..00000000000000 --- a/.github/ISSUE_TEMPLATE/001-bug-report.yaml +++ /dev/null @@ -1,80 +0,0 @@ -name: "\U0001F41B Bug report" -description: Create a report to help Matter -title: "[BUG] " -labels: [bug, "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: "How do you trigger this bug? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: input - id: prevalence - attributes: - label: Bug prevalence - description: "How often do you or others encounter this bug?" - placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" - validations: - required: true - - type: input - attributes: - label: GitHub hash of the SDK that was being used - description: Hash of the GitHub SDK used - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf - - python - - raspi - - vscode - - windows - - other - - core - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.0.1, N/A" - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for submitting a bug!" diff --git a/.github/ISSUE_TEMPLATE/002-1.0-issue.yaml b/.github/ISSUE_TEMPLATE/002-1.0-issue.yaml deleted file mode 100644 index 10551fef60fe44..00000000000000 --- a/.github/ISSUE_TEMPLATE/002-1.0-issue.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: "\u0030\u20e3 1.0 Issue" -description: Create an issue that is required for Matter 1.0 release -title: "[1.0] " -labels: [bug, "V1.0", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: "How do you trigger this bug? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: input - id: prevalence - attributes: - label: Bug prevalence - description: "How often do you or others encounter this bug?" - placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" - validations: - required: true - - type: input - attributes: - label: GitHub hash of the SDK that was being used - description: Hash of the GitHub SDK used - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.0.1, N/A" - - type: dropdown - attributes: - label: Type - description: What type of issue is this? - multiple: true - options: - - Test Improvement - - Common Cluster Logic - - Spec Compliance Issue - - Security Issue - - Platform Issue - - Core SDK Memory Issue - - Core SDK Crash - - Core SDK Performance Improvement - - Core SDK Interopability Issue - validations: - required: true - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping us get to 1.0!" diff --git a/.github/ISSUE_TEMPLATE/003-1.1-issue.yaml b/.github/ISSUE_TEMPLATE/003-1.1-issue.yaml deleted file mode 100644 index 50db3e80a95c33..00000000000000 --- a/.github/ISSUE_TEMPLATE/003-1.1-issue.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: "\u0031\u20e3 1.1 Issue" -description: Create an issue that is required for Matter 1.1 release -title: "[1.1] " -labels: [bug, "V1.1", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: "How do you trigger this bug? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: input - id: prevalence - attributes: - label: Bug prevalence - description: "How often do you or others encounter this bug?" - placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" - validations: - required: true - - type: input - attributes: - label: GitHub hash of the SDK that was being used - description: Hash of the GitHub SDK used - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.1, N/A" - - type: dropdown - attributes: - label: Type - description: What type of issue is this? - multiple: true - options: - - Test Improvement - - Common Cluster Logic - - Spec Compliance Issue - - Security Issue - - Platform Issue - - Core SDK Memory Issue - - Core SDK Crash - - Core SDK Performance Improvement - - Core SDK Interopability Issue - validations: - required: true - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping us get to 1.1!" diff --git a/.github/ISSUE_TEMPLATE/004-1.2-issue.yaml b/.github/ISSUE_TEMPLATE/004-1.2-issue.yaml deleted file mode 100644 index 81b641a52e45ef..00000000000000 --- a/.github/ISSUE_TEMPLATE/004-1.2-issue.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: "\u0032\u20e3 1.2 Issue" -description: Create an issue that is required for Matter 1.2 release -title: "[1.2] " -labels: [bug, "V1.2", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: "How do you trigger this bug? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: input - id: prevalence - attributes: - label: Bug prevalence - description: "How often do you or others encounter this bug?" - placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" - validations: - required: true - - type: input - attributes: - label: GitHub hash of the SDK that was being used - description: Hash of the GitHub SDK used - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.2, N/A" - - type: dropdown - attributes: - label: Type - description: What type of issue is this? - multiple: true - options: - - Test Improvement - - Common Cluster Logic - - Spec Compliance Issue - - Security Issue - - Platform Issue - - Core SDK Memory Issue - - Core SDK Crash - - Core SDK Performance Improvement - - Core SDK Interopability Issue - validations: - required: true - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping us get to 1.2!" diff --git a/.github/ISSUE_TEMPLATE/005-1.3-issue.yaml b/.github/ISSUE_TEMPLATE/005-1.3-issue.yaml deleted file mode 100644 index 5c91f91e75b3be..00000000000000 --- a/.github/ISSUE_TEMPLATE/005-1.3-issue.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: "\u0033\u20e3 1.3 Issue" -description: Create an issue that is required for Matter 1.3 release -title: "[1.3] " -labels: [bug, "V1.3", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: "How do you trigger this bug? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: input - id: prevalence - attributes: - label: Bug prevalence - description: "How often do you or others encounter this bug?" - placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" - validations: - required: true - - type: input - attributes: - label: GitHub hash of the SDK that was being used - description: Hash of the GitHub SDK used - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.3, N/A" - - type: dropdown - attributes: - label: Type - description: What type of issue is this? - multiple: true - options: - - Test Improvement - - Common Cluster Logic - - Spec Compliance Issue - - Security Issue - - Platform Issue - - Core SDK Memory Issue - - Core SDK Crash - - Core SDK Performance Improvement - - Core SDK Interopability Issue - validations: - required: true - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping us get to 1.3!" diff --git a/.github/ISSUE_TEMPLATE/049-trivial-fix.yaml b/.github/ISSUE_TEMPLATE/049-trivial-fix.yaml deleted file mode 100644 index 7c82d950e9f7f4..00000000000000 --- a/.github/ISSUE_TEMPLATE/049-trivial-fix.yaml +++ /dev/null @@ -1,93 +0,0 @@ -name: "\U0001F3C3 Trivial Fix" -description: Create an issue for a trivial fix -title: "[Trivial] " -labels: [bug, "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to submit a trivial fix, can you please please help us understand this change in this quick form? - - type: dropdown - attributes: - label: Type - description: What type of trivial fix is this? - multiple: true - options: - - Comment fix - - Typo fix - - Rename - - Other - validations: - required: true - - type: textarea - id: repro - attributes: - label: Explanation - description: "(Optional) If other, why do you think this is trivial?" - validations: - required: false - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - all - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core (please add to version below) - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.0.1, N/A" - - type: dropdown - attributes: - label: Testing - description: How was this tested? - multiple: true - options: - - Unit tested - - YAML tested - - Manually tested with SDK - - CI tested - - Hardware validated - - Platform validated - validations: - required: true - - type: textarea - attributes: - label: (Optional) If manually tested please explain why this is only manually tested - description: | - Please explain how you tested it - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about this! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for submitting a trivial issue!" diff --git a/.github/ISSUE_TEMPLATE/050-tooling-fix.yaml b/.github/ISSUE_TEMPLATE/050-tooling-fix.yaml deleted file mode 100644 index 0d775a61ef119d..00000000000000 --- a/.github/ISSUE_TEMPLATE/050-tooling-fix.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: "\U0001F9F0 Tooling Fix/Feature" -description: Create an issue for a tooling specific fix/feature -title: "[Tooling] " -labels: ["tools", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to submit a an issue for our tooling, can you please please help us understand this change in this quick form? - - type: textarea - id: repro - attributes: - label: Reproduction steps / Feature - description: "How do you trigger this issue and/or can you please explain this new feature? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core (please add to version below) - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.0.1, N/A" - - type: dropdown - attributes: - label: Type - description: How was this tested? - multiple: true - options: - - Unit tested - - YAML tested - - Manually tested with SDK - - CI tested - - Hardware validated - - Platform validated - validations: - required: true - - type: textarea - attributes: - label: (Optional) If manually tested please explain why this is only manually tested - description: | - Please explain how you tested it - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about this! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for help our tooling!" diff --git a/.github/ISSUE_TEMPLATE/060-platform-fix.yaml b/.github/ISSUE_TEMPLATE/060-platform-fix.yaml deleted file mode 100644 index fdb8b76d88f2ec..00000000000000 --- a/.github/ISSUE_TEMPLATE/060-platform-fix.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: "\U0001F3D7 Platform Fix" -description: Create an issue for a platform specific fix -title: "[Platform] " -labels: ["platform", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to submit a an issue for a platform, can you please please help us understand this change in this quick form? - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: "How do you trigger this issue? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core (please add to version below) - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.0.1, N/A" - - type: dropdown - attributes: - label: Type - description: How was this tested? - multiple: true - options: - - Unit tested - - YAML tested - - Manually tested with SDK - - CI tested - - Hardware validated - - Platform validated - validations: - required: true - - type: textarea - attributes: - label: (Optional) If manually tested please explain why this is only manually tested - description: | - Please explain how you tested it - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about this! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for submitting a platform issue!" diff --git a/.github/ISSUE_TEMPLATE/080-feature-request.yaml b/.github/ISSUE_TEMPLATE/080-feature-request.yaml deleted file mode 100644 index c83b0c22acaa98..00000000000000 --- a/.github/ISSUE_TEMPLATE/080-feature-request.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: "\U0001F4A1 Feature Request" -description: Create an feature to be considered future release -title: "[Feature] " -labels: ["feature work", "feature request", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for submitting a feature request to the Matter SDK! We need information about the feature to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Feature description - description: "What feature are you looking to add? Please walk us through it!" - value: | - ... - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - all - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.0.1, N/A" - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for submitting a new feature request." diff --git a/.github/ISSUE_TEMPLATE/090-sve-issue.yaml b/.github/ISSUE_TEMPLATE/090-sve-issue.yaml deleted file mode 100644 index 6ea65341230a35..00000000000000 --- a/.github/ISSUE_TEMPLATE/090-sve-issue.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: "\U0001F9EA SVE Issue" -description: Create an issue that is required for SVE -title: "[SVE] " -labels: [bug, "sve", "request sve", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: "How do you trigger this bug? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: input - id: prevalence - attributes: - label: Bug prevalence - description: "How often do you or others encounter this bug?" - placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" - validations: - required: true - - type: input - attributes: - label: GitHub hash of the SDK that was being used - description: Hash of the GitHub SDK used - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core (please add to version below) - validations: - required: true - - type: input - id: platform-versions - attributes: - label: Platform Version(s) - description: "What platform version(s) are affected [optional]" - placeholder: "eg: 1.0.1, N/A" - - type: dropdown - attributes: - label: Type - description: What type of issue is this? - multiple: true - options: - - Test Improvement - - Common Cluster Logic - - Spec Compliance Issue - - Security Issue - - Platform Issue - - Core SDK Memory Issue - - Core SDK Crash - - Core SDK Performance Improvement - - Core SDK Interopability Issue - validations: - required: true - - type: dropdown - attributes: - label: Testing - description: How was this tested? - multiple: true - options: - - Unit tested - - YAML tested - - Manually tested with SDK - - CI tested - - Hardware validated - - Platform validated - validations: - required: true - - type: textarea - attributes: - label: (Optional) If manually tested please explain why this is only manually tested - description: | - Please explain how you tested it - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping our SVE!" diff --git a/.github/ISSUE_TEMPLATE/091-cert-blocker.yaml b/.github/ISSUE_TEMPLATE/091-cert-blocker.yaml deleted file mode 100644 index 659135117d1938..00000000000000 --- a/.github/ISSUE_TEMPLATE/091-cert-blocker.yaml +++ /dev/null @@ -1,108 +0,0 @@ -name: "\U0001F4DC Test Case Failure / Cert Blocker" -description: Create a report to identify matter certification test failures -title: "[CERT-TEST-FAILURE] " -labels: [bug, "cert blocker", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK! We need information about the cert blocker to follow up, so please help us out by filling out this information. - - type: dropdown - attributes: - label: Feature Area - description: What feature area is the test failing in? - multiple: true - options: - - Area:AirPurifiers - - Area:AirQualitySensor - - Area:ConcentrationMeasurement - - Area:DeviceAppearance - - Area:Dishwashers - - Area:DoorLockEnhancements - - Area:EventList - - Area:ICDPhase2 - - Area:ModeSelect - - Area:OperationalState - - Area:Refrigerators - - Area:RobotVacuums - - Area:RoomAirConditioner - - Area:Scenes - - Area:SmokeCO2 - - Area:TemperatureControlledCabinet - - Area:TimeSync - - Other - validations: - required: true - - type: input - id: testcase - attributes: - label: Test Case - description: "Which test case is failing?" - placeholder: "TC-XXXX" - validations: - required: true - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: "How do you trigger this bug? Please walk us through it step by step." - placeholder: | - Please list reproduction steps step by step. - Place shell commands between ```. - Attach logs as files instead of pasting them in. - 1. - 2. - 3. - ... - validations: - required: true - - type: input - id: prevalence - attributes: - label: Bug prevalence - description: "How often do you or others encounter this bug?" - placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" - validations: - required: true - - type: input - attributes: - label: GitHub hash of the SDK that was being used - description: Hash of the GitHub SDK used - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf - - python - - raspi - - vscode - - windows - - other - - core - validations: - required: true - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for submitting a test case/cert blocker!" diff --git a/.github/ISSUE_TEMPLATE/097-ci-test-failure.yaml b/.github/ISSUE_TEMPLATE/097-ci-test-failure.yaml deleted file mode 100644 index a99f5a6361715d..00000000000000 --- a/.github/ISSUE_TEMPLATE/097-ci-test-failure.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: "\U0001F6E0 Test Issue" -description: Test issue -title: "[Test Failed] " -labels: ["build issue", "needs triage", "tests"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK's tests! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Test issue(s) - description: "What are the tests that failed? Please include links to failed jobs if possible." - value: | - 1. - 2. - 3. - ... - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core (please add to version below) - - all - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping improve our tests" diff --git a/.github/ISSUE_TEMPLATE/098-build-issue.yaml b/.github/ISSUE_TEMPLATE/098-build-issue.yaml deleted file mode 100644 index 5d1adb35548657..00000000000000 --- a/.github/ISSUE_TEMPLATE/098-build-issue.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: "\U0001F6E0 Build Issue" -description: Build issue -title: "[Build] " -labels: ["build issue", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK's builds! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Build issue(s) - description: "What are the build issues? Please include links to failed jobs if possible." - value: | - 1. - 2. - 3. - ... - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core (please add to version below) - - all - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping improve our builds" diff --git a/.github/ISSUE_TEMPLATE/099-github-workflow-issue.yaml b/.github/ISSUE_TEMPLATE/099-github-workflow-issue.yaml deleted file mode 100644 index eefa5f0f984c61..00000000000000 --- a/.github/ISSUE_TEMPLATE/099-github-workflow-issue.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: "\U0001F477 GitHub / CI / Workflow" -description: Create an issue to improve CI / Workflows -title: "[Workflow] " -labels: ["workflows", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK's workflows! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Workflow issues - description: "What updates to the workflows are needed?" - value: | - 1. - 2. - 3. - ... - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core (please add to version below) - - all - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping improve our development workflows" diff --git a/.github/ISSUE_TEMPLATE/100-documentation-issue.yaml b/.github/ISSUE_TEMPLATE/100-documentation-issue.yaml deleted file mode 100644 index 51971d1d010b5f..00000000000000 --- a/.github/ISSUE_TEMPLATE/100-documentation-issue.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: "\U0001F5BA Documentation Issue" -description: Create an issue to improve documentation -title: "[Documentation] " -labels: ["documentation", "needs triage"] -body: - - type: markdown - attributes: - value: | - Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. - - type: textarea - id: repro - attributes: - label: Documentation issues - description: "What updates to documentation are needed?" - value: | - 1. - 2. - 3. - ... - validations: - required: true - - type: dropdown - attributes: - label: Platform - description: What platforms are affected? - multiple: true - options: - - ameba - - android - - cc13x2_cc26x2 - - darwin - - efr32 - - esp32 - - freeRTOS - - IMX8 - - k32w - - nrf connect - - nrf - - python - - raspi - - vscode - - windows - - other - - core (please add to version below) - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false - - type: markdown - attributes: - value: "Thanks for helping improve our documentation." diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yaml deleted file mode 100644 index 3ba13e0cec6cbb..00000000000000 --- a/.github/ISSUE_TEMPLATE/config.yaml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index dad1d2c6463644..00000000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,12 +0,0 @@ -> !!!!!!!!!! Please delete the instructions below and replace with PR description -> -> If you have an issue number, please use a syntax of -> `Fixes #12345` and a brief change description -> -> If you do not have an issue number, please have a good description of -> the problem and the fix. Help the reviewer understand what to expect. -> -> Make sure you delete these instructions (to prove you have read them). -> -> !!!!!!!!!! Instructions end - diff --git a/.github/actions/bootstrap-cache/action.yaml b/.github/actions/bootstrap-cache/action.yaml deleted file mode 100644 index f5ed24ba3f06e7..00000000000000 --- a/.github/actions/bootstrap-cache/action.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Bootstrap cache -description: Bootstrap cache (deprecated) -runs: - using: "composite" - steps: - - uses: Wandalen/wretry.action@v1.4.10 - name: Bootstrap cache - continue-on-error: true - with: - action: buildjet/cache@v3 - attempt_limit: 3 - attempt_delay: 2000 - with: | - key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**', '/etc/lsb-release') }} - path: | - .environment - build_overrides/pigweed_environment.gni diff --git a/.github/actions/bootstrap/action.yaml b/.github/actions/bootstrap/action.yaml deleted file mode 100644 index ea06ceed7b3952..00000000000000 --- a/.github/actions/bootstrap/action.yaml +++ /dev/null @@ -1,82 +0,0 @@ -name: Bootstrap -description: Bootstrap -inputs: - platform: - description: "Platform name" - required: false - default: none - bootstrap-log-name: - description: "Bootstrap log name" - required: false - default: bootstrap-logs-${{ github.job }} -outputs: - cache-hit: - description: "Bootstrap environment was restored from cache" - value: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit }} # dynamic action returns all outputs in `outputs` - -runs: - using: "composite" - steps: - - name: Determine bootstrap cache configuration - id: prepare - shell: bash - run: | - # Determine bootstrap cache configuration - # In addition to the various setup files, the work directory matters as well, - # because the bootstrapped Pigweed environment contains absolute paths. - echo "Calculating bootstrap cache key for '$PWD'" - FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}" - case "$RUNNER_OS" in - macOS) OS_HASH="$(sw_vers | shasum -a 256 | cut -d' ' -f1)";; - *) OS_HASH="$(shasum -a 256 /etc/lsb-release | cut -d' ' -f1)";; - esac - PYTHON_HASH="$(python --version | shasum -a 256 | cut -d' ' -f1)" - FINAL_HASH="$(echo "$PWD:$FILES_HASH:$OS_HASH:$PYTHON_HASH" | shasum -a 256 | cut -d' ' -f1)" - echo key="${RUNNER_OS}-${RUNNER_ARCH}-${{ inputs.platform }}-${FINAL_HASH}" | tee -a "$GITHUB_OUTPUT" - - # Split caches across backends - case "$RUNNER_OS" in - macOS) echo backend=actions;; - *) echo backend=buildjet;; - esac | tee -a "$GITHUB_OUTPUT" - - - name: Bootstrap from cache - id: restore - uses: ./.github/actions/dynamic - continue-on-error: true - with: - action: ${{ steps.prepare.outputs.backend }}/cache/restore@v4 - with: | - key: ${{ steps.prepare.outputs.key }} - path: | - .environment - build_overrides/pigweed_environment.gni - - - name: Run bootstrap - if: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }} - env: - PW_NO_CIPD_CACHE_DIR: 1 - PW_ENVSETUP_NO_BANNER: 1 - shell: bash - run: source scripts/bootstrap.sh -p all,${{ inputs.platform }} - - - name: Save bootstrap cache - uses: ./.github/actions/dynamic - if: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }} - continue-on-error: true - with: - action: ${{ steps.prepare.outputs.backend }}/cache/save@v4 - with: | - key: ${{ steps.prepare.outputs.key }} - path: | - .environment - build_overrides/pigweed_environment.gni - - - name: Upload bootstrap logs - uses: actions/upload-artifact@v4 - if: ${{ always() && !env.ACT && fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }} - with: - name: ${{ inputs.bootstrap-log-name }} - path: | - .environment/gn_out/.ninja_log - .environment/pigweed-venv/*.log diff --git a/.github/actions/checkout-submodules-and-bootstrap/action.yaml b/.github/actions/checkout-submodules-and-bootstrap/action.yaml deleted file mode 100644 index df3fdff1e02ce4..00000000000000 --- a/.github/actions/checkout-submodules-and-bootstrap/action.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Checkout submodules & Bootstrap -description: Checkout submodules & Bootstrap -inputs: - platform: - description: "Platform name" - required: true - extra-submodule-parameters: - description: "extra submodule parameters" - required: false - default: "" - bootstrap-log-name: - description: "Bootstrap log name" - required: false - default: bootstrap-logs-${{ github.job }} -runs: - using: "composite" - steps: - - name: Maximize runner disk - uses: ./.github/actions/maximize-runner-disk - - name: Dump disk info - uses: ./.github/actions/dump-disk-info - - name: Set git safe directory for local act runs - uses: ./.github/actions/git-safe-directory - - name: Checkout submodules - uses: ./.github/actions/checkout-submodules - with: - platform: ${{ inputs.platform }} - extra-parameters: ${{ inputs.extra-submodule-parameters }} - - name: Bootstrap - uses: ./.github/actions/bootstrap - with: - platform: ${{ inputs.platform }} - bootstrap-log-name: ${{ inputs.bootstrap-log-name }} - - name: Dump disk info after checkout submodule & Bootstrap - shell: bash - run: scripts/dump_diskspace_info.sh - - name: Work around TSAN ASLR issues - if: runner.os == 'Linux' && !env.ACT - shell: bash - run: | - # See https://stackoverflow.com/a/77856955/2365113 - if [[ "$UID" == 0 ]]; then function sudo() { "$@"; }; fi - sudo sysctl vm.mmap_rnd_bits=28 diff --git a/.github/actions/checkout-submodules/action.yaml b/.github/actions/checkout-submodules/action.yaml deleted file mode 100644 index e180a8c49458a2..00000000000000 --- a/.github/actions/checkout-submodules/action.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Checkout submodules -description: Checkout submodules -inputs: - extra-parameters: - description: "extra parameters" - required: false - default: "" - platform: - description: "Platform name" - required: true -runs: - using: "composite" - steps: - - uses: Wandalen/wretry.action@v1.4.10 - name: Checkout submodules - with: - command: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform ${{ inputs.platform }} ${{ inputs.extra-parameters }} - attempt_limit: 3 - attempt_delay: 2000 diff --git a/.github/actions/dump-disk-info/action.yaml b/.github/actions/dump-disk-info/action.yaml deleted file mode 100644 index 1f6474e54c4656..00000000000000 --- a/.github/actions/dump-disk-info/action.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Dump disk space info -description: Help debug running out of disk space on github CI -runs: - using: "composite" - steps: - - name: Collect disk info - # Unfortunately current syntax for github wrapper actions only work for - # Javascript actions, and Docker container actions, which doesn't make it - # possible to wrap a shell script like the one below. The action below - # essentially wraps the shell commands we want to run into a Javascript - # wrapped action. This allow us to get the disk info usage before a job - # is run and after the job is run regardless if the job succeeds or - # fails. - uses: pyTooling/Actions/with-post-step@v0.4.5 - if: ${{ runner.os == 'Linux' }} - with: - main: |- - exec ./scripts/dump_diskspace_info.sh - post: |- - exec ./scripts/dump_diskspace_info.sh \ No newline at end of file diff --git a/.github/actions/dynamic/action.yaml b/.github/actions/dynamic/action.yaml deleted file mode 100644 index 7cee233c4f4ce2..00000000000000 --- a/.github/actions/dynamic/action.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Dynamic -description: Dynamically resolves another GitHub action -inputs: - action: - description: Action reference - required: true - with: - description: Action inputs as multi-line YAML string - required: false - default: "" -outputs: - outputs: - description: JSON object of outputs from the action - value: ${{ steps.run.outputs.outputs }} -runs: - using: composite - steps: - - name: Instantiate - shell: bash - run: | - # Dynamically invoke ${{ inputs.action }} - with='${{ inputs.with }}' - [[ -z "$with" ]] || with="$(echo ' with:'; sed -e 's/^/ /' <<<"$with")" - mkdir -p ./.tmp/dynamic-action-instance - cat <./.tmp/dynamic-action-instance/action.yaml - runs: - using: composite - steps: - - id: run - uses: ${{ inputs.action }} - $with - outputs: - outputs: - value: $(echo '$'){{ toJSON(steps.run.outputs) }} - END - - name: Run - id: run - uses: ./.tmp/dynamic-action-instance diff --git a/.github/actions/git-safe-directory/action.yaml b/.github/actions/git-safe-directory/action.yaml deleted file mode 100644 index 1308c4ea1bf524..00000000000000 --- a/.github/actions/git-safe-directory/action.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: Git safe directory -description: For running act with checkout owned by non-root user -runs: - using: "composite" - steps: - - name: Set git safe.directory to "*" - if: ${{ env.ACT }} - shell: bash - run: git config --system --add safe.directory '*' \ No newline at end of file diff --git a/.github/actions/maximize-runner-disk/action.yaml b/.github/actions/maximize-runner-disk/action.yaml deleted file mode 100644 index d71ba3646d3279..00000000000000 --- a/.github/actions/maximize-runner-disk/action.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Maximize runner disk -description: Free up disk space on the github runner -runs: - using: "composite" - steps: - - name: Free up disk space on the github runner - if: runner.os == 'Linux' && !env.ACT - shell: bash - run: | - # maximize-runner-disk - # Directories to prune to free up space. Candidates: - # 1.6G /usr/share/dotnet - # 1.1G /usr/local/lib/android/sdk/platforms - # 1000M /usr/local/lib/android/sdk/build-tools - # 8.9G /usr/local/lib/android/sdk - # This list can be amended later to change the trade-off between the amount of - # disk space freed up, and how long it takes to do so (deleting many files is slow). - prune=(/usr/share/dotnet /usr/local/lib/android/sdk/platforms /usr/local/lib/android/sdk/build-tools) - - if [[ "$UID" -eq 0 && -d /__w ]]; then - root=/runner-root-volume - if [[ ! -d "$root" ]]; then - echo "Unable to maximize disk space, job is running inside a container and $root is not mounted" - exit 0 - fi - function sudo() { "$@"; } # we're already root (and sudo is probably unavailable) - elif [[ "$UID" -ne 0 && "$RUNNER_ENVIRONMENT" == github-hosted ]]; then - root= - else - echo "Unable to maximize disk space, unknown runner environment" - exit 0 - fi - - echo "Freeing up runner disk space on ${root:-/}" - function avail() { df -k --output=avail "${root:-/}" | grep '^[0-9]*$'; } - function now() { date '+%s'; } - before="$(avail)" start="$(now)" - for dir in "${prune[@]}"; do - if [[ -d "${root}${dir}" ]]; then - echo "- $dir" - # du -sh -- "${root}${dir}" - sudo rm -rf -- "${root}${dir}" - else - echo "- $dir (not found)" - fi - done - after="$(avail)" end="$(now)" - echo "Done, freed up $(( (after - before) / 1024 ))M of disk space in $(( end - start )) seconds." diff --git a/.github/actions/perform-codeql-analysis/action.yaml b/.github/actions/perform-codeql-analysis/action.yaml deleted file mode 100644 index f1caf10dc3df1c..00000000000000 --- a/.github/actions/perform-codeql-analysis/action.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: Run CodeQL Analysis -description: Run and upload CodeQL Analysis -inputs: - language: - description: "language for codeql analysis" - required: true -runs: - using: "composite" - steps: - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{ inputs.language }}" - upload: False - output: sarif-results - - name: filter-sarif - uses: advanced-security/filter-sarif@v1 - with: - patterns: | - -**/third_party/** - -**/scripts/** - input: "sarif-results/${{ inputs.language }}.sarif" - output: "sarif-results/${{ inputs.language }}.sarif" - - - name: Upload SARIF - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: "sarif-results/${{ inputs.language }}.sarif" - - name: Upload loc as a Build Artifact - uses: actions/upload-artifact@v4 - with: - name: sarif-results - path: sarif-results - retention-days: 1 diff --git a/.github/actions/setup-size-reports/action.yaml b/.github/actions/setup-size-reports/action.yaml deleted file mode 100644 index 511a434242d2e6..00000000000000 --- a/.github/actions/setup-size-reports/action.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: Setup size reports -description: Setup size reports -inputs: - gh-context: - description: "GH Context" - required: true - -runs: - using: "composite" - steps: - - name: Set up environment for size reports - shell: bash - env: - GH_CONTEXT: ${{ inputs.gh-context }} - run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/actions/upload-size-reports/action.yaml b/.github/actions/upload-size-reports/action.yaml deleted file mode 100644 index 41fe8c820c7cc0..00000000000000 --- a/.github/actions/upload-size-reports/action.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: upload-size-reports -description: upload-size-reports -inputs: - platform-name: - description: "Platform name Name" - required: true - -runs: - using: "composite" - steps: - - name: Uploading Size Reports - uses: actions/upload-artifact@v4 - if: ${{ !env.ACT }} - with: - name: Size,${{ inputs.platform-name }}-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} - path: | - /tmp/bloat_reports/ diff --git a/.github/boring-cyborg.yml b/.github/boring-cyborg.yml deleted file mode 100644 index c6fa9bcf943bef..00000000000000 --- a/.github/boring-cyborg.yml +++ /dev/null @@ -1,132 +0,0 @@ -# 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. -labelPRBasedOnFilePath: - ############################################################ - # Top Level Labels - ############################################################ - repo: - - ./* - - ############################################################ - # Examples - ############################################################ - examples: - - examples/* - - ############################################################ - # Documentation - ############################################################ - documentation: - - docs/* - - ############################################################ - # Tools + Development Items - ############################################################ - scripts: - - scripts/* - - integrations: - - integrations/* - - vscode: - - .vscode - - .devcontainer - - gn: - - gn/* - - github: - - .github - - workflows: - - .github/workflows/* - - tools: - - tools/* - - ############################################################ - # Source Code - ############################################################ - qr code: - - src/qrcode/* - - lwip: - - src/lwip/* - - inet: - - src/inet/* - - config: - - config/* - - lib: - - src/lib/* - - crypto: - - src/crypto/* - - controller: - - src/controller/* - - ble: - - src/ble/* - - app: - - src/app/* - - transport: - - src/transport/* - - system: - - src/system/* - - setup payload: - - src/setup_payload/* - - ############################################################ - # Platforms - ############################################################ - platform: - - src/platform/* - - darwin: - - src/platform/Darwin/* - - src/darwin/* - - efr32: - - src/platform/silabs/* - - esp32: - - src/platform/ESP32/* - - freeRTOS: - - src/platform/FreeRTOS/* - - k32w: - - src/platform/K32W/* - - linux: - - src/platform/Linux/* - - nrf connect: - - src/platform/nrfconnect/* - - openthread: - - src/platform/openthread/* - - zephyr: - - src/platform/Zephyr/* - - telink: - - src/platform/telink/* diff --git a/.github/config.yml b/.github/config.yml deleted file mode 100644 index 027b4dc4e4deca..00000000000000 --- a/.github/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -todo: - keyword: ["@todo", "TODO", "TODO:"] # string|string[] - bodyKeyword: ["@body", "BODY", "BODY:"] # string|string[] - blobLines: 10 # number|boolean, 0 or false to disable - autoAssign: true # string|string[]|boolean - label: ["todo"] # boolean|string|string[] - reopenClosed: true # boolean - exclude: ".*lint\\.yaml|.*/(zzz_generated|zap-generated)/.*" # string diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 8c618416fba4c1..00000000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,61 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "gradle" - directory: "/" - schedule: - interval: "weekly" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "weekly" - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - - - package-ecosystem: "gitsubmodule" - directory: "/" - schedule: - interval: "weekly" - allow: - - dependency-name: "third_party/pigweed/repo" - - dependency-name: "third_party/mbedtls/repo" - - dependency-name: "third_party/openthread/repo" - - - dependency-name: "third_party/ameba/repo" - - dependency-name: "third_party/android_deps/repo" - - dependency-name: "third_party/asr/repo" - - dependency-name: "third_party/boringssl/repo" - - dependency-name: "third_party/bouffalolab/repo" - - dependency-name: "third_party/cirque/repo" - - dependency-name: "third_party/editline/repo" - - dependency-name: "third_party/freertos/repo" - - dependency-name: "third_party/imgui/repo" - - dependency-name: "third_party/infineon/repo" - - dependency-name: "third_party/inipp/repo" - - dependency-name: "third_party/java_deps/repo" - - dependency-name: "third_party/jlink/repo" - - dependency-name: "third_party/jsoncpp/repo" - - dependency-name: "third_party/libwebsockets/repo" - - dependency-name: "third_party/lwip/repo" - - dependency-name: "third_party/mbed-mcu-boot/repo" - - dependency-name: "third_party/mbed-os-cypress-capsense-button/repo" - - dependency-name: "third_party/mbed-os-posix-socket/repo" - - dependency-name: "third_party/mbedtls/repo" - - dependency-name: "third_party/mt793x_sdk/repo" - - dependency-name: "third_party/mynewt-core/repo" - - dependency-name: "third_party/nanopb/repo" - - dependency-name: "third_party/nlassert/repo" - - dependency-name: "third_party/nlfaultinjection/repo" - - dependency-name: "third_party/nlio/repo" - - dependency-name: "third_party/nxp/repo" - - dependency-name: "third_party/open-iot-sdk/repo" - - dependency-name: "third_party/ot-br-posix/repo" - - dependency-name: "third_party/perfetto/repo" - - dependency-name: "third_party/qpg_sdk/repo" - - dependency-name: "third_party/silabs/repo" - - dependency-name: "third_party/simw-top-mini/repo" - - dependency-name: "third_party/ti_simplelink_sdk/repo" - - dependency-name: "third_party/tizen/repo" diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml deleted file mode 100644 index 909ef045c039e4..00000000000000 --- a/.github/issue-labeler.yml +++ /dev/null @@ -1,54 +0,0 @@ -darwin: - # Make sure we don't match random words that contain "mac" inside. - # - # Make sure we don't match random words that contain "ios" inside - # (like "kiosk" or whatnot), but do allow matching "ios8" and things - # like that. - # - # Make sure we don't trigger for the string "MAC", which almost - # certainly has nothing to do with Darwin. - # - # \\b means "word boundary" - # (?![a-z]) means "there is no next char in the range a-z". - - "/(\\b[Ii][Oo][Ss](?![a-zA-Z])|[Hh][Oo][Mm][Ee][Pp][Oo][Dd]|[Dd][Aa][Rr][Ww][Ii][Nn]|\\bm[Aa][Cc]\\b|\\bMa[Cc]\\b|\\bM[Aa]c\\b|[Mm][Aa][Cc][Oo][Ss])/" - -linux: - - "/(linux)/i" - -# Special Keywords for Cert Blockers -air purifiers: - - "(Area:AirPurifiers)" -air quality sensors: - - "(Area:AirQualitySensor)" -concentration measurement: - - "(Area:ConcentrationMeasurement)" -device appearance: - - "(Area:DeviceAppearance)" -dishwashers: - - "(Area:Dishwashers)" -door lock enhancements: - - "(Area:DoorLockEnhancements)" -event list: - - "(Area;EventList)" -icd: - - "(Area:ICDPhase2)" -icd phase 2: - - "(Area:ICDPhase2)" -mode select: - - "(Area:ModeSelect)" -operational state: - - "(Area:OperationalState)" -refrigerators: - - "(Area:Refrigerators)" -robot vacuums: - - "(Area:RobotVacuums)" -room air conditioners: - - "(Area:RoomAirConditioner)" -scenes: - - "(Area:Scenes)" -smoke & c02: - - "(Area:SmokeCO2)" -temperature controlled cabinet: - - "(Area:TemperatureControlledCabinet)" -time sync: - - "(Area:TimeSync)" diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 7e02fe6d368df3..00000000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,333 +0,0 @@ -# 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. - -############################################################ -# Top Level Labels -############################################################ -repo: - - changed-files: - - any-glob-to-any-file: - - './*' - -############################################################ -# Examples -############################################################ -examples: - - changed-files: - - any-glob-to-any-file: - - examples/* - - examples/**/* - -############################################################ -# Documentation -############################################################ -documentation: - - changed-files: - - any-glob-to-any-file: - - docs/* - - docs/**/* - - "*.md" - -############################################################ -# Tools + Development Items -############################################################ -scripts: - - changed-files: - - any-glob-to-any-file: - - scripts/* - - scripts/**/* - -integrations: - - changed-files: - - any-glob-to-any-file: - - integrations/* - - integrations/**/* - -docker: - - changed-files: - - any-glob-to-any-file: - - integrations/docker/* - - integrations/docker/**/* - -vscode: - - changed-files: - - any-glob-to-any-file: - - .vscode/* - - .vscode/**/* - - .devcontainer/* - - .devcontainer/**/* - -gn: - - changed-files: - - any-glob-to-any-file: - - build/* - - build/**/* - - build_overrides/* - - build_overrides/**/* - - .gn - - "*.gn" - - "*.gni" - -github: - - changed-files: - - any-glob-to-any-file: - - .github - - .github/* - - .github/**/* - -workflows: - - changed-files: - - any-glob-to-any-file: - - .github/workflows/* - - .github/workflows/**/* - -tools: - - changed-files: - - any-glob-to-any-file: - - src/tools/* - - src/tools/**/* - - tools/* - - tools/**/* - - examples/chip-tool/* - - examples/chip-tool/**/* - -############################################################ -# Tests -############################################################ -tests: - - changed-files: - - any-glob-to-any-file: - - src/python_testing/* - - src/python_testing/**/* - - src/app/tests/* - - src/app/tests/**/* - -test driver: - - changed-files: - - any-glob-to-any-file: - - src/test_driver/* - - src/test_driver/**/* - -# Cert tests touched: add current milestone delta-tracking label. -# TODO: Change after Aug 15, 2024 -matter-1.4-te2-script-change: - - changed-files: - - any-glob-to-any-file: - - src/python_testing/* - - src/python_testing/**/* - - src/app/tests/suites/certification/* - -############################################################ -# Source Code -############################################################ -qr code: - - changed-files: - - any-glob-to-any-file: - - src/qrcode/* - - src/qrcode/**/* - - src/qrcodetool/* - - src/qrcodetool/**/* - -lwip: - - changed-files: - - any-glob-to-any-file: - - src/lwip/* - - src/lwip/**/* - -inet: - - changed-files: - - any-glob-to-any-file: - - src/inet/* - - src/inet/**/* - -config: - - changed-files: - - any-glob-to-any-file: - - config/* - - config/**/* - -lib: - - changed-files: - - any-glob-to-any-file: - - src/lib/* - - src/lib/**/* - -core: - - changed-files: - - any-glob-to-any-file: - - src/lib/core/* - - src/lib/core/**/* - -protocols: - - changed-files: - - any-glob-to-any-file: - - src/lib/protocols/* - - src/lib/protocols/**/* - - src/protocols/* - - src/protocols/**/* - -messaging: - - changed-files: - - any-glob-to-any-file: - - src/messaging/* - - src/messaging/**/* - -shell: - - changed-files: - - any-glob-to-any-file: - - src/lib/shell/* - - src/lib/shell/**/* - -support: - - changed-files: - - any-glob-to-any-file: - - src/lib/support/* - - src/lib/support/**/* - -crypto: - - changed-files: - - any-glob-to-any-file: - - src/crypto/* - - src/crypto/**/* - -controller: - - changed-files: - - any-glob-to-any-file: - - src/controller/* - - src/controller/**/* - -ble: - - changed-files: - - any-glob-to-any-file: - - src/ble/* - - src/ble/**/* - -app: - - changed-files: - - any-glob-to-any-file: - - src/app/* - - src/app/**/* - -icd: - - changed-files: - - any-glob-to-any-file: - - src/app/icd/* - - src/app/icd/**/* - -transport: - - changed-files: - - any-glob-to-any-file: - - src/transport/* - - src/transport/**/* - -system: - - changed-files: - - any-glob-to-any-file: - - src/system/* - - src/system/**/* - -setup payload: - - changed-files: - - any-glob-to-any-file: - - src/setup_payload/* - - src/setup_payload/**/* - -############################################################ -# Platforms -############################################################ -platform: - - changed-files: - - any-glob-to-any-file: - - src/platform/* - - src/platform/**/* - - config/tizen/chip-gn/platform/* - - config/tizen/chip-gn/platform/**/* - - examples/platform/* - - examples/platform/**/* - - scripts/tools/memory/platform/* - - scripts/tools/memory/platform/**/* - - src/include/platform/* - - src/include/platform/**/* - - src/lib/dnssd/platform/* - - src/lib/dnssd/platform/**/* - -darwin: - - changed-files: - - any-glob-to-any-file: - - src/platform/Darwin/* - - src/platform/Darwin/**/* - - src/darwin/* - - src/darwin/**/* - - examples/darwin-framework-tool/* - - examples/darwin-framework-tool/**/* - -silabs: - - changed-files: - - any-glob-to-any-file: - - src/platform/silabs/* - - src/platform/silabs/**/* - -esp32: - - changed-files: - - any-glob-to-any-file: - - src/platform/ESP32/* - - src/platform/ESP32/**/* - -freeRTOS: - - changed-files: - - any-glob-to-any-file: - - src/platform/FreeRTOS/* - - src/platform/FreeRTOS/**/* - -k32w: - - changed-files: - - any-glob-to-any-file: - - src/platform/K32W/* - - src/platform/K32W/**/* - -linux: - - changed-files: - - any-glob-to-any-file: - - src/platform/Linux/* - - src/platform/Linux/**/* - -nrf connect: - - changed-files: - - any-glob-to-any-file: - - src/platform/nrfconnect/* - - src/platform/nrfconnect/**/* - -openthread: - - changed-files: - - any-glob-to-any-file: - - src/platform/openthread/* - - src/platform/openthread/**/* - -zephyr: - - changed-files: - - any-glob-to-any-file: - - src/platform/Zephyr/* - - src/platform/Zephyr/**/* - -telink: - - changed-files: - - any-glob-to-any-file: - - src/platform/telink/* - - src/platform/telink/**/* - -tizen: - - changed-files: - - any-glob-to-any-file: - - src/platform/Tizen/* - - src/platform/Tizen/**/* diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index d33d2a3e6ddf48..00000000000000 --- a/.github/release.yml +++ /dev/null @@ -1,76 +0,0 @@ -# .github/release.yml - -changelog: - exclude: - labels: - - scripts - - external dependency - - submodules - - integrations - - documentation - authors: - - restyled-io - - octocat - - pullapprove - - jira - - issue-label-bot - - github-actions - - github-labels - - buildjet - categories: - - title: Highlighted Fixes - labels: - - release note - - title: Security Fixes - labels: - - security - - title: Bug Fixes - labels: - - bug - - title: Bluetooth Related Changes - labels: - - ble - - title: Spec Alignment Changes - labels: - - spec - - title: Transport/Messaging Layer Changes - labels: - - inet - - transport - - messaging - - protocols - - lwip - - title: Crypto Changes - labels: - - crypto - - title: Core Library Changes - labels: - - lib - - title: Core Changes - labels: - - core - - title: Controller Changes - labels: - - controller - - title: System Level Changes - labels: - - system - - attestation - - title: App Level Changes - labels: - - app - - title: Platform Changes - labels: - - platform - - darwin - - android - - title: Example App Changes - labels: - - examples - - title: Test Changes - labels: - - tests - - title: Build Related Changes - labels: - - gn - - build diff --git a/.github/workflows/artifacts.yaml b/.github/workflows/artifacts.yaml deleted file mode 100644 index 002d945ebc0f09..00000000000000 --- a/.github/workflows/artifacts.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: 'Delete old artifacts' -on: - schedule: - - cron: '0 * * * *' # every hour - -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true - -jobs: - delete-artifacts: - runs-on: ubuntu-latest - steps: - - uses: kolpav/purge-artifacts-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - expire-in: 14days diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml deleted file mode 100644 index 870c5f379e5eb8..00000000000000 --- a/.github/workflows/bloat_check.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# 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. - -name: Bloat Check -on: - workflow_dispatch: - schedule: - - cron: "*/5 * * * *" - -concurrency: - group: ${{ github.workflow }} - # Don't cancel an already-running bloat check just because it took more - # than 5 minutes to run and our cron job is trying to schedule a new one. - cancel-in-progress: false - -jobs: - pull_request_update: - name: Report on pull requests - - # Don't run on forked repos - if: github.repository_owner == 'project-chip' - - runs-on: ubuntu-latest - - container: - image: ghcr.io/project-chip/chip-build:74 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Report - run: | - scripts/tools/memory/gh_report.py \ - --verbose \ - --report-increases 0.2 \ - --report-pr \ - --github-comment \ - --github-limit-artifact-pages 50 \ - --github-limit-artifacts 500 \ - --github-limit-comments 20 \ - --github-repository project-chip/connectedhomeip \ - --github-api-token "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/build-cert-bins.yaml b/.github/workflows/build-cert-bins.yaml deleted file mode 100644 index 52c274193b4fc1..00000000000000 --- a/.github/workflows/build-cert-bins.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Build Certification Image -on: - workflow_call: - workflow_dispatch: -jobs: - build-cert-bin: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@v5 - with: - name: ghcr.io/project-chip/chip-cert-bins - tags: latest - dockerfile: ./integrations/docker/images/chip-cert-bins/Dockerfile - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - platforms: linux/amd64,linux/arm64,linux/arm diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index be259e232e5022..00000000000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,474 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Builds - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - workflow_call: - inputs: - run-codeql: - required: false - type: boolean - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - build_linux_gcc_debug: - name: Build on Linux (gcc_debug) - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/:/runner-root-volume" - - "/tmp/log_output:/tmp/test_logs" - options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" - - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Dump Concurrency context - env: - CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - run: echo "$CONCURRENCY_CONTEXT" - - name: Checkout - uses: actions/checkout@v4 - - name: Try to ensure the directories for core dumping exist and we - can write them. - run: | - mkdir /tmp/cores || true - sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - name: Initialize CodeQL - if: ${{ inputs.run-codeql }} - uses: github/codeql-action/init@v3 - with: - languages: "cpp" - - name: Setup Build - run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=false chip_data_model_check_die_on_failure=true" - - name: Run Build - run: scripts/run_in_build_env.sh "ninja -C ./out" - - name: Run Tests - run: scripts/tests/gn_tests.sh - # TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227 - # TODO https://github.com/project-chip/connectedhomeip/issues/1512 - # - name: Run Code Coverage - # if: ${{ contains('main', env.BUILD_TYPE) }} - # run: scripts/tools/codecoverage.sh - # - name: Upload Code Coverage - # if: ${{ contains('main', env.BUILD_TYPE) }} - # run: bash <(curl -s https://codecov.io/bash) - - name: Set up Build Without Detail Logging - run: scripts/build/gn_gen.sh --args="chip_detail_logging=false" - - name: Run Build Without Detail Logging - run: scripts/run_in_build_env.sh "ninja -C ./out" - - name: Set up Build Without Progress Logging - run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false" - - name: Run Build Without Progress Logging - run: scripts/run_in_build_env.sh "ninja -C ./out" - - name: Set up Build Without Error Logging - run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false chip_error_logging=false" - - name: Run Build Without Error Logging - run: scripts/run_in_build_env.sh "ninja -C ./out" - - name: Set up Build Without Logging - run: scripts/build/gn_gen.sh --args="chip_logging=false" - - name: Run Build Without Logging - run: scripts/run_in_build_env.sh "ninja -C ./out" - - name: Uploading core files - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-linux-gcc-debug - path: /tmp/cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - - name: Perform CodeQL Analysis - if: ${{ inputs.run-codeql }} - uses: ./.github/actions/perform-codeql-analysis - with: - language: cpp - # OBJDIR on linux is > 10K files and takes more than 50 minutes to upload, usually - # having the job timeout. - # - # If re-enabling, some subset of this should be picked - # - # - name: Uploading objdir for debugging - # uses: actions/upload-artifact@v4 - # if: ${{ failure() && !env.ACT }} - # with: - # name: crash-objdir-linux-gcc-debug - # path: out/ - # # objdirs are big; don't hold on to them too long. - # retention-days: 5 - - build_linux: - name: Build on Linux (fake, gcc_release, clang, simulated) - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/:/runner-root-volume" - - "/tmp/log_output:/tmp/test_logs" - options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" - - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Dump Concurrency context - env: - CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - run: echo "$CONCURRENCY_CONTEXT" - - name: Checkout - uses: actions/checkout@v4 - - name: Try to ensure the directories for core dumping exist and we - can write them. - run: | - mkdir /tmp/cores || true - sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - name: Initialize CodeQL - if: ${{ inputs.run-codeql }} - uses: github/codeql-action/init@v3 - with: - languages: "cpp" - - name: Setup and Build Simulated Device - run: | - BUILD_TYPE=simulated - GN_ARGS='chip_tests_zap_config="app1" chip_project_config_include_dirs=["../../examples/placeholder/linux/apps/app1/include", "../../config/standalone"] chip_config_network_layer_ble=false' - CHIP_ROOT_PATH=examples/placeholder/linux - CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS" - scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - - name: Setup Build, Run Build and Run Tests - run: | - BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false chip_data_model_check_die_on_failure=true" - scripts/run_in_build_env.sh "ninja -C ./out/gcc_release" - BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh - - name: Clean output - run: rm -rf ./out - - name: Run Tests with sanitizers - env: - LSAN_OPTIONS: detect_leaks=1 - run: | - for BUILD_TYPE in asan tsan ubsan; do - case $BUILD_TYPE in - "asan") GN_ARGS='is_clang=true is_asan=true';; - "msan") GN_ARGS='is_clang=true is_msan=true';; - "tsan") GN_ARGS='is_clang=true is_tsan=true chip_enable_wifi=false';; - "ubsan") GN_ARGS='is_clang=true is_ubsan=true';; - esac - - rm -rf ./out/sanitizers - BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands - BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh - done - - name: Ensure codegen is done for sanitize - run: | - ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers" - - name: Clang-tidy validation - # NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check. - # See https://github.com/llvm/llvm-project/issues/97426 - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/run-clang-tidy-on-compile-commands.py \ - --compile-database out/sanitizers/compile_commands.json \ - --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write|QuieterReporting' \ - check \ - " - - name: Clean output - run: rm -rf ./out - - name: Build using build_examples.py - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-minmdns-ipv6only-clang \ - --target linux-x64-rpc-console \ - build \ - " - - name: Create a pre-generate directory and ensure compile-time codegen would fail - run: | - ./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated" - mv scripts/codegen.py scripts/codegen.py.renamed - mv scripts/tools/zap/generate.py scripts/tools/zap/generate.py.renamed - - name: Clean output - run: rm -rf ./out - - name: Build using build_examples.py (pregen) - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-all-clusters-ipv6only-clang \ - --target linux-x64-chip-tool-ipv6only-clang \ - --pregen-dir ./zzz_pregenerated \ - build \ - " - - name: Undo code pre-generation changes (make compile time codegen work again) - run: | - rm -rf ./zzz_pregenerated - mv scripts/codegen.py.renamed scripts/codegen.py - mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py - - name: Run fake linux tests with build_examples - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target linux-fake-tests build" - - name: Perform CodeQL Analysis - if: ${{ inputs.run-codeql }} - uses: ./.github/actions/perform-codeql-analysis - with: - language: cpp - - - name: Uploading core files - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-linux - path: /tmp/cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - # OBJDIR on linux is > 10K files and takes more than 50 minutes to upload, usually - # having the job timeout. - # - # If re-enabling, some subset of this should be picked - # - # - name: Uploading objdir for debugging - # uses: actions/upload-artifact@v4 - # if: ${{ failure() && !env.ACT }} - # with: - # name: crash-objdir-linux - # path: out/ - # # objdirs are big; don't hold on to them too long. - # retention-days: 5 - - build_linux_python_lib: - name: Build on Linux (python_lib) - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:54 - volumes: - - "/:/runner-root-volume" - - "/tmp/log_output:/tmp/test_logs" - options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" - - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Dump Concurrency context - env: - CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - run: echo "$CONCURRENCY_CONTEXT" - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Setup Build, Run Build and Run Tests - run: | - scripts/build/gn_gen.sh --args="enable_rtti=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false chip_generate_link_map_file=false chip_data_model_check_die_on_failure=true" - scripts/run_in_build_env.sh "ninja -C ./out" - scripts/tests/gn_tests.sh - - name: Setup test python environment - shell: bash - run: | - scripts/run_in_build_env.sh 'virtualenv pyenv' - source pyenv/bin/activate - pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl - pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl - pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl - - - name: Run Python tests - shell: bash - run: | - source pyenv/bin/activate - cd src/controller/python/test/unit_tests/ - python3 -m unittest -v - - name: Clean previous outputs - run: rm -rf out pyenv - - name: Run Python Setup Payload Generator Test - shell: bash - run: | - scripts/run_in_build_env.sh 'scripts/examples/gn_build_example.sh examples/chip-tool out/' - scripts/run_in_build_env.sh 'virtualenv pyenv' - source pyenv/bin/activate - pip3 install -r scripts/setup/requirements.setuppayload.txt - python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool - - build_linux_python_lighting_device: - name: Build on Linux (python lighting-app) - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:54 - volumes: - - "/:/runner-root-volume" - - "/tmp/log_output:/tmp/test_logs" - options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" - - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Dump Concurrency context - env: - CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - run: echo "$CONCURRENCY_CONTEXT" - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Setup Build - run: | - scripts/build_python_device.sh --chip_detail_logging true - - build_darwin: - name: Build on Darwin (clang, python_lib, simulated) - runs-on: macos-13 - if: github.actor != 'restyled-io[bot]' - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: darwin - - name: Try to ensure the directory for diagnostic log collection exists - run: | - mkdir -p ~/Library/Logs/DiagnosticReports || true - - name: Initialize CodeQL - if: ${{ inputs.run-codeql }} - uses: github/codeql-action/init@v3 - with: - languages: "cpp" - - - name: Setup and Build Simulated Device - run: | - BUILD_TYPE=simulated - GN_ARGS='chip_tests_zap_config="app1" chip_project_config_include_dirs=["../../examples/placeholder/linux/apps/app1/include", "../../config/standalone"] chip_config_network_layer_ble=false' - CHIP_ROOT_PATH=examples/placeholder/linux - CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS" - scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - - name: Setup Build, Run Build and Run Tests - # We can't enable leak checking here in LSAN_OPTIONS, because on - # Darwin that's only supported with a new enough clang, and we're - # not building with the pigweed clang here. - run: | - for BUILD_TYPE in default python_lib; do - case $BUILD_TYPE in - # We want to build various standalone example apps - # (similar to what examples-linux-standalone.yaml - # does), so use target_os="all" to get those picked - # up as part of the "unified" build. But then to - # save CI resources we want to exclude the - # "host clang" build, which uses the pigweed - # clang. - "default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';; - esac - BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands - scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh - done - - name: Ensure codegen is done for sanitize - run: | - ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default" - - name: Clang-tidy validation - # NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check. - # See https://github.com/llvm/llvm-project/issues/97426 - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/run-clang-tidy-on-compile-commands.py \ - --compile-database out/default/compile_commands.json \ - --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write|QuieterReporting' \ - check \ - " - - name: Uploading diagnostic logs - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-log-darwin - path: ~/Library/Logs/DiagnosticReports/ - - - name: Perform CodeQL Analysis - if: ${{ inputs.run-codeql }} - uses: ./.github/actions/perform-codeql-analysis - with: - language: cpp - - # TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227 - # TODO https://github.com/project-chip/connectedhomeip/issues/1512 - - build_linux_gcc_coverage: - name: Build on Linux (coverage) - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/:/runner-root-volume" - - "/tmp/log_output:/tmp/test_logs" - options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Run Build Coverage - run: ./scripts/build_coverage.sh diff --git a/.github/workflows/buildjet-cache-delete.yaml b/.github/workflows/buildjet-cache-delete.yaml deleted file mode 100644 index f5c4e0668b1aed..00000000000000 --- a/.github/workflows/buildjet-cache-delete.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Manually Delete BuildJet Cache -on: - workflow_dispatch: - inputs: - cache_key: - description: 'BuildJet Cache Key to Delete' - required: true - type: string -jobs: - manually-delete-buildjet-cache: - runs-on: buildjet-2vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: buildjet/cache-delete@v1 - with: - cache_key: ${{ inputs.cache_key }} \ No newline at end of file diff --git a/.github/workflows/check-data-model-directory-updates.yaml b/.github/workflows/check-data-model-directory-updates.yaml deleted file mode 100644 index 305da81d9da817..00000000000000 --- a/.github/workflows/check-data-model-directory-updates.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2024 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. - -name: Check for changes to data_model directory without a sha update - -on: - pull_request: - paths: - - "data_model/**" - -jobs: - check-submodule-update-label: - name: Check for changes to data_model directory without a sha update - runs-on: ubuntu-latest - if: "git diff --name-only HEAD^..HEAD data_model/ | grep -q spec_sha" - steps: - - name: Error Message - run: echo This pull request attempts to update data_model directory, but is missing updates to spec_sha file with the latest version of the sha. Files in the data_model directory are generated automatically and should not be updated manually. - - name: Fail Job - run: exit 1 diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml deleted file mode 100644 index 642cdb6cf87e92..00000000000000 --- a/.github/workflows/chef.yaml +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright (c) 2021 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. - -name: Build Chef CI examples on all platforms - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - chef_linux: - name: Chef - Linux CI Examples - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - options: --user root - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - name: CI Examples Linux - shell: bash - run: | - ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t linux" - - chef_esp32: - name: Chef - ESP32 CI Examples - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-esp32:74 - options: --user root - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: esp32 - - name: CI Examples ESP32 - shell: bash - run: | - ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t esp32" - - chef_nrfconnect: - name: Chef - NRFConnect CI Examples - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-nrf-platform:74 - options: --user root - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: nrfconnect - - name: CI Examples NRFConnect - shell: bash - run: | - ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t nrfconnect" - - chef_telink: - name: Chef - Telink CI Examples - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-telink:74 - options: --user root - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: telink - # - name: Update Zephyr to specific revision (for developers purpose) - # shell: bash - # run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py ab81a585fca6a83b30e1f4e58a021113d6a3acb8" - - name: CI Examples Telink - shell: bash - run: | - ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t telink" diff --git a/.github/workflows/cherry-picks.yaml b/.github/workflows/cherry-picks.yaml deleted file mode 100644 index a062aa5fcf9b87..00000000000000 --- a/.github/workflows/cherry-picks.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Cherry-Pick Merges - -on: - pull_request_target: - branches: - - master - types: ["closed"] - -jobs: - cherry_pick_release_v1_0: - runs-on: ubuntu-latest - name: Cherry-Pick into SVE - if: | - (github.event.pull_request.merged == true) - && ( - (contains(github.event.pull_request.labels.*.name, 'sve')) - || (contains(github.event.pull_request.labels.*.name, 'request sve')) - || (contains(github.event.pull_request.labels.*.name, 'cert blocker')) - ) - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Cherry-Pick into sve branch - uses: carloscastrojumo/github-cherry-pick-action@v1.0.9 - with: - token: ${{ secrets.MATTER_PAT }} - branch: 1.3-sve - labels: | - sve cherry pick - reviewers: | - woody-apple - andy31415 - raju-apple -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml deleted file mode 100644 index 6fe17c3558c767..00000000000000 --- a/.github/workflows/cirque.yaml +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2020-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. - -name: Cirque - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - cirque: - name: Cirque - - env: - GITHUB_CACHE_PATH: /tmp/cirque-cache - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - # need to run with privilege, which isn't supported by job.XXX.contaner - # https://github.com/actions/container-action/issues/2 - # container: - # image: ghcr.io/project-chip/chip-build-cirque: - # volumes: - # - "/tmp:/tmp" - # - "/dev/pts:/dev/pts" - # env: - # LOG_DIR: /tmp/cirque_test_output/ - # CLEANUP_DOCKER_FOR_CI: 1 - # options: "--privileged" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules - uses: ./.github/actions/checkout-submodules - with: - platform: linux - - # TODO: Is what's being cached here actually compatible with a regular bootstrap? - - name: Bootstrap Cache - uses: ./.github/actions/bootstrap-cache - - name: Bootstrap Cirque - run: | - integrations/docker/images/stage-2/chip-build-cirque/run.sh \ - -- sh -c " \ - git config --global --add safe.directory '*' \ - && bash scripts/bootstrap.sh \ - && chown -R $(id -u):$(id -g) .environment \ - " - - - name: Get Cirque Bootstrap cache key - id: cirque-bootstrap-cache-key - run: echo "val=$(scripts/tests/cirque_tests.sh cachekeyhash)" >> $GITHUB_OUTPUT - - uses: Wandalen/wretry.action@v1.4.10 - name: Cirque Bootstrap cache - if: ${{ !env.ACT }} - continue-on-error: true - timeout-minutes: 10 - with: - action: buildjet/cache@v3 - attempt_limit: 3 - attempt_delay: 2000 - with: | - key: ${{ runner.os }}-cirque-${{ steps.cirque-bootstrap-cache-key.outputs.val }} - restore-keys: ${{ runner.os }}-cirque- - path: ${{ env.GITHUB_CACHE_PATH }} - - name: Cirque Bootstrap - run: | - integrations/docker/images/stage-2/chip-build-cirque/run.sh \ - --env GITHUB_ACTION_RUN=1 \ - --env GITHUB_CACHE_PATH=${{ env.GITHUB_CACHE_PATH }} \ - --volume /tmp:/tmp \ - -- sh -c " \ - git config --global --add safe.directory '*' \ - && scripts/tests/cirque_tests.sh bootstrap \ - " - - - name: Artifact suffix - id: outsuffix - uses: haya14busa/action-cond@v1 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - name: Build Binaries - run: | - integrations/docker/images/stage-2/chip-build-cirque/run.sh \ - -- sh -c " \ - git config --global --add safe.directory '*' \ - && scripts/build/gn_gen_cirque.sh \ - " - - name: Run Tests - run: | - integrations/docker/images/stage-2/chip-build-cirque/run.sh \ - --env LOG_DIR=/tmp/cirque_test_output \ - --env CLEANUP_DOCKER_FOR_CI=1 \ - --env GITHUB_ACTION_RUN=1 \ - --privileged \ - --volume /tmp:/tmp \ - --volume /dev/pts:/dev/pts \ - -- sh -c " \ - git config --global --add safe.directory '*' \ - && scripts/tests/cirque_tests.sh run_all_tests \ - " - - - - name: Uploading Binaries - uses: actions/upload-artifact@v4 - if: ${{ always() && !env.ACT }} - with: - name: cirque_log-${{steps.outsuffix.outputs.value}}-logs - path: /tmp/cirque_test_output/ diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml deleted file mode 100644 index 815293204b09de..00000000000000 --- a/.github/workflows/darwin-tests.yaml +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright (c) 2022 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. - -name: Darwin Tests - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - test_suites_chip_tool_darwin: - name: Test Suites - Darwin - - strategy: - matrix: - build_variant: [no-ble-asan-clang] - env: - BUILD_VARIANT: ${{matrix.build_variant}} - - # We can't use the pigweed clang to build the Darwin framework once we start using - # Swift, because it does not handle CLANG_ENABLE_MODULES correctly. - # - # But the Xcode clang does not handle LSan correctly. Since we can't easily apply - # LSAN_OPTIONS to just everything except darwin-framework-tool, instead disable asan for - # it. - BUILD_VARIANT_FRAMEWORK_TOOL: no-ble - LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt - - if: github.actor != 'restyled-io[bot]' - runs-on: macos-13 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Environment - # coreutils for stdbuf - run: brew install coreutils - - name: - Try to ensure the directories for core dumping and diagnostic - log collection exist and we can write them. - run: | - sudo chown ${USER} /cores || true - mkdir -p ~/Library/Logs/DiagnosticReports || true - mkdir objdir-clone || true - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: darwin - bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }} - - - name: Run macOS Darwin Framework Tool Build Debug - working-directory: src/darwin/Framework - run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug - - name: Delete Defaults - run: defaults delete com.apple.dt.xctest.tool - continue-on-error: true - - name: Clean Build - run: xcodebuild clean - working-directory: src/darwin/Framework - - name: Build Apps - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL} \ - --target darwin-x64-all-clusters-${BUILD_VARIANT} \ - --target darwin-x64-lock-${BUILD_VARIANT} \ - --target darwin-x64-ota-provider-${BUILD_VARIANT} \ - --target darwin-x64-ota-requestor-${BUILD_VARIANT} \ - --target darwin-x64-tv-app-${BUILD_VARIANT} \ - --target darwin-x64-bridge-${BUILD_VARIANT} \ - --target darwin-x64-lit-icd-${BUILD_VARIANT} \ - --target darwin-x64-microwave-oven-${BUILD_VARIANT} \ - --target darwin-x64-rvc-${BUILD_VARIANT} \ - --target darwin-x64-network-manager-${BUILD_VARIANT} \ - build \ - --copy-artifacts-to objdir-clone \ - " - - name: Run Tests - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/tests/run_test_suite.py \ - --runner darwin_framework_tool_python \ - --chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ - --target-skip-glob '{TestAccessControlConstraints}' \ - run \ - --iterations 1 \ - --test-timeout-seconds 120 \ - --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ - --lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \ - --ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ - --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ - --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ - --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ - --microwave-oven-app ./out/darwin-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ - --rvc-app ./out/darwin-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ - --network-manager-app ./out/darwin-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ - " - - name: Run OTA Test - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/tests/run_darwin_framework_ota_test.py \ - run \ - --darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ - --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ - --ota-data-file /tmp/rawImage \ - --ota-image-file /tmp/otaImage \ - --ota-destination-file /tmp/downloadedImage \ - --ota-candidate-file /tmp/otaCandidateJSON \ - " - - name: Uploading core files - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-darwin-${{ matrix.build_variant }} - path: /cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - - name: Uploading diagnostic logs - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-log-darwin-${{ matrix.build_variant }} - path: ~/Library/Logs/DiagnosticReports/ - - name: Uploading framework build log - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: framework-build-log-darwin-${BUILD_VARIANT_FRAMEWORK_TOOL} - path: out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin_framework_build.log - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-darwin-${{ matrix.build_variant }} - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml deleted file mode 100644 index 360c5bb6963217..00000000000000 --- a/.github/workflows/darwin.yaml +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Darwin - -on: - push: - branches-ignore: - - "dependabot/**" - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: - ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - framework: - name: Build framework - if: github.actor != 'restyled-io[bot]' - runs-on: macos-13 - strategy: - matrix: - options: # We don't need a full matrix - - flavor: macos-release - arguments: -sdk macosx -configuration Release - - flavor: ios-release - arguments: -sdk iphoneos -configuration Release - - flavor: tvos-debug - arguments: -sdk appletvos -configuration Debug - - flavor: watchos-debug - arguments: -sdk watchos -configuration Debug - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: darwin - bootstrap-log-name: - bootstrap-logs-framework-${{ matrix.options.flavor }} - - name: Block zap-cli from being used - env: - PW_ENVSETUP_NO_BANNER: 1 - run: | - # Framework builds are NOT expected to require zap-cli - scripts/run_in_build_env.sh 'rm -- "$(which zap-cli)"' - # run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli - scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0' - - name: Build - working-directory: src/darwin/Framework - run: xcodebuild -target "Matter" ${{ matrix.options.arguments }} - - tests: - name: Run framework tests - if: github.actor != 'restyled-io[bot]' - needs: [framework] # serialize to avoid running to many parallel macos runners - runs-on: macos-13 - strategy: - matrix: - options: # We don't need a full matrix - - flavor: asan - arguments: - -enableAddressSanitizer YES - -enableUndefinedBehaviorSanitizer YES - - flavor: tsan - arguments: -enableThreadSanitizer YES - # "leaks" does not seem to be very compatible with asan or tsan - - flavor: leaks - defines: ENABLE_LEAK_DETECTION=1 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: darwin - bootstrap-log-name: - bootstrap-logs-framework-${{ matrix.options.flavor }} - - name: Build example All Clusters Server - run: | - scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/all-clusters-app chip_config_network_layer_ble=false - - name: Build example OTA Provider - run: | - scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug/ota-provider-app chip_config_network_layer_ble=false - - name: Build example OTA Requestor - run: | - scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug/ota-requestor-app chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 - - name: Run Framework Tests - # For now disable unguarded-availability-new warnings because we - # internally use APIs that we are annotating as only available on - # new enough versions. Maybe we should change out deployment - # target versions instead? - working-directory: src/darwin/Framework - run: | - mkdir -p /tmp/darwin/framework-tests - echo "This is a simple log" > /tmp/darwin/framework-tests/end_user_support_log.txt - ../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) & - - export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 - - # Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI. - xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx ${{ matrix.options.arguments }} \ - CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} ${{ matrix.options.defines }}' \ - > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2) - - name: Collect crash logs - if: failure() && !env.ACT - run: | - mkdir -p /tmp/darwin/framework-tests - find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests - - name: Uploading log files - uses: actions/upload-artifact@v4 - if: failure() && !env.ACT - with: - name: darwin-framework-test-logs-${{ matrix.options.flavor }} - path: /tmp/darwin/framework-tests - retention-days: 5 diff --git a/.github/workflows/docbuild.yaml b/.github/workflows/docbuild.yaml deleted file mode 100644 index 2d28a2a537d922..00000000000000 --- a/.github/workflows/docbuild.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Documentation Build - -on: - pull_request: - types: [opened, synchronize, reopened] - branches: - - master - paths: - - '.github/workflows/docbuild.yaml' - - '**.md' - - 'docs/**' - push: - branches: - - master - -permissions: - contents: write - -jobs: - build-and-publish: - runs-on: ubuntu-latest - - steps: - - name: Checkout the code - uses: actions/checkout@v4 - with: - path: matter - fetch-depth: 0 - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: 3.8 - cache-dependency-path: matter/docs/requirements.txt - cache: pip - - name: Install base dependencies - working-directory: matter - run: | - sudo pip3 install -U pip - pip3 install -r docs/requirements.txt - - name: Build documentation - working-directory: matter/docs - run: | - mkdir -p _build/src - make html - touch _build/html/.nojekyll - - name: Deploy to gh-pages - if: github.repository == 'project-chip/connectedhomeip' && github.event_name == 'push' && github.ref_name == 'master' - uses: peaceiris/actions-gh-pages@v3 - with: - deploy_key: ${{ secrets.DOXYGEN_DEPLOY_KEY }} - external_repository: project-chip/connectedhomeip-doc - publish_dir: matter/docs/_build/html - # Keep only the latest version of the documentation - force_orphan: true diff --git a/.github/workflows/docker_img.yaml b/.github/workflows/docker_img.yaml deleted file mode 100644 index 05594606a610c7..00000000000000 --- a/.github/workflows/docker_img.yaml +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Docker CHIP images - -on: - workflow_call: - inputs: - push_images: - required: false - type: boolean - default: false - push: - paths: - - "integrations/docker/**" - pull_request: - paths: - - "integrations/docker/**" - workflow_dispatch: - inputs: - push_images: - required: false - type: boolean - default: false - -jobs: - build_images_base: - name: Build Docker CHIP Build images - base - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - strategy: - fail-fast: false - matrix: - img: - - "" - - "-minimal" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build & Push images using project bash script - if: ${{ inputs.push_images == true }} - run: | - cd integrations/docker/images/base/chip-build${{ matrix.img }} - ./build.sh --latest --push - - name: Build images using project bash script - if: ${{ inputs.push_images == false }} - run: | - cd integrations/docker/images/base/chip-build${{ matrix.img }} - ./build.sh --latest - build_images_stage_1: - needs: [build_images_base] - name: Build Docker CHIP Build images - stage 1 - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - strategy: - fail-fast: false - matrix: - img: - - "-crosscompile" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build & Push images using project bash script - if: ${{ inputs.push_images == true }} - run: | - cd integrations/docker/images/stage-1/chip-build${{ matrix.img }} - ./build.sh --latest --push - - name: Build images using project bash script - if: ${{ inputs.push_images == false }} - run: | - cd integrations/docker/images/stage-1/chip-build${{ matrix.img }} - ./build.sh --latest - build_images_stage_2: - needs: [build_images_base, build_images_stage_1] - name: Build Docker CHIP Build images - stage 2 - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - strategy: - fail-fast: false - matrix: - img: - - "-ameba" - - "-asr" - - "-bouffalolab" - - "-doxygen" - - "-efr32" - - "-esp32" - - "-infineon" - # NOTE: imx image requires too much space for GitHub-hosted runners. It fails with: - # ApplyLayer exit status 1 stdout: stderr: write /opt/fsl-imx-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/opt/ltp/testcases/bin/fanotify15: no space left on device - # - "-imx" - - "-java" - - "-k32w" - - "-nrf-platform" - - "-telink" - - "-ti" - - "-tizen" - - "-openiotsdk" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build & Push images using project bash script - if: ${{ inputs.push_images == true }} - run: | - cd integrations/docker/images/stage-2/chip-build${{ matrix.img }} - ./build.sh --latest --push - - name: Build images using project bash script - if: ${{ inputs.push_images == false }} - run: | - cd integrations/docker/images/stage-2/chip-build${{ matrix.img }} - ./build.sh --latest - - build_images_stage_3: - needs: [build_images_base, build_images_stage_1, build_images_stage_2] - name: Build Docker CHIP Build images - stage 3 - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - strategy: - fail-fast: false - matrix: - img: - - "-android" - - "-esp32-qemu" - - "-tizen-qemu" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build & Push images using project bash script - if: ${{ inputs.push_images == true }} - run: | - cd integrations/docker/images/stage-3/chip-build${{ matrix.img }} - ./build.sh --latest --push - - name: Build images using project bash script - if: ${{ inputs.push_images == false }} - run: | - cd integrations/docker/images/stage-3/chip-build${{ matrix.img }} - ./build.sh --latest - build_images_vscode: - needs: [build_images_base, build_images_stage_1, build_images_stage_2, build_images_stage_3] - name: Build Docker CHIP Build images - vscode - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' && false - strategy: - fail-fast: false - matrix: - img: - - "-vscode" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build & Push images using project bash script - if: ${{ inputs.push_images == true }} - run: | - cd integrations/docker/images/vscode/chip-build${{ matrix.img }} - ./build.sh --latest --push - - name: Build images using project bash script - if: ${{ inputs.push_images == false }} - run: | - cd integrations/docker/images/vscode-3/chip-build${{ matrix.img }} - ./build.sh --latest diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml deleted file mode 100644 index d29b620c374165..00000000000000 --- a/.github/workflows/doxygen.yaml +++ /dev/null @@ -1,107 +0,0 @@ -# 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. - -name: Doxygen - -on: - push: - paths: - - "**.do[xc]" - - "**.c[cs]?" - - "**.cxx" - - "**.cpp" - - "**.c\\+\\+" - - "**.ii" - - "**.ixx" - - "**.ipp" - - "**.i\\+\\+" - - "**.inl" - - "**.[hH]" - - "**.hh" - - "**.HH" - - "**.hxx" - - "**.hpp" - - "**.h\\+\\+" - - "**.mm" - - "**.txt" - - "**.[ido]dl" - - "**.java" - - "**.d" - - "**.php[45]?" - - "**.inc" - - "**.phtml" - - "**.[mM]" - pull_request: - paths: - - "**.do[xc]" - - "**.c[cs]?" - - "**.cxx" - - "**.cpp" - - "**.c\\+\\+" - - "**.ii" - - "**.ixx" - - "**.ipp" - - "**.i\\+\\+" - - "**.inl" - - "**.[hH]" - - "**.hh" - - "**.HH" - - "**.hxx" - - "**.hpp" - - "**.h\\+\\+" - - "**.mm" - - "**.txt" - - "**.[ido]dl" - - "**.java" - - "**.d" - - "**.php[45]?" - - "**.inc" - - "**.phtml" - - "**.[mM]" - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -jobs: - doxygen: - name: Build Doxygen - - runs-on: ubuntu-latest - container: - image: ghcr.io/project-chip/chip-build-doxygen:74 - - if: github.actor != 'restyled-io[bot]' - - steps: - - name: "Print Actor" - run: echo ${{github.actor}} - - name: Checkout - uses: actions/checkout@v4 - - name: Generate - run: scripts/helpers/doxygen.sh - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})" - id: extract_branch - - name: Deploy if master - if: steps.extract_branch.outputs.branch == 'master' && github.repository == 'project-chip/connectedhomeip' - uses: peaceiris/actions-gh-pages@v3 - with: - deploy_key: ${{ secrets.DOXYGEN_DEPLOY_KEY }} - external_repository: project-chip/connectedhomeip-doc - publish_dir: ./docs/html - # Keep only the latest version of the documentation - force_orphan: true diff --git a/.github/workflows/example-tv-casting-darwin.yaml b/.github/workflows/example-tv-casting-darwin.yaml deleted file mode 100644 index d9d9ef8f37cee9..00000000000000 --- a/.github/workflows/example-tv-casting-darwin.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: TV Casting Example - Darwin - -on: - push: - branches-ignore: - - "dependabot/**" - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: - ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - tv-casting-bridge: - name: Build TV Casting Bridge example - if: github.actor != 'restyled-io[bot]' - runs-on: macos-13 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: darwin - - name: Build - working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge - run: xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml deleted file mode 100644 index 62a3bf55119b3d..00000000000000 --- a/.github/workflows/examples-ameba.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (c) 2021 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. - -name: Build example - Ameba - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - ameba: - name: Ameba - env: - BUILD_TYPE: ameba - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-ameba:74 - options: --user root - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: ameba - - name: Build example Ameba All Clusters App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target ameba-amebad-all-clusters \ - --target ameba-amebad-all-clusters-minimal \ - --target ameba-amebad-light \ - --target ameba-amebad-pigweed \ - build \ - " diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml deleted file mode 100644 index 840811d13daa6a..00000000000000 --- a/.github/workflows/examples-asr.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# 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. - -name: Build example - ASR - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - asr: - name: ASR - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-asr:74 - options: --user root - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: asr - - name: Build all ASR582X examples - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target asr-asr582x-all-clusters \ - --target asr-asr582x-all-clusters-minimal \ - --target asr-asr582x-lighting-ota \ - --target asr-asr582x-light-switch-shell \ - --target asr-asr582x-lock-no_logging \ - --target asr-asr582x-ota-requestor \ - --target asr-asr582x-bridge-factory \ - --target asr-asr582x-temperature-measurement-rotating_id \ - --target asr-asr582x-thermostat-rio \ - --target asr-asr582x-dishwasher \ - --target asr-asr582x-refrigerator \ - build \ - " diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml deleted file mode 100644 index af20a4c5b0872f..00000000000000 --- a/.github/workflows/examples-bouffalolab.yaml +++ /dev/null @@ -1,147 +0,0 @@ -# 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. - -name: Build example - BouffaloLab - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - bouffalolab: - name: Bouffalo Lab - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-bouffalolab:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: bouffalolab - extra-submodule-parameters: " --recursive" - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - name: Build example BL602 Lighting App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target bouffalolab-bl602-night-light-light \ - --target bouffalolab-bl602-night-light-light-mfd \ - --target bouffalolab-bl602-iot-matter-v1-light-115200-rpc \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare some bloat report from the previous builds - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602 lighting-app \ - out/artifacts/bouffalolab-bl602-night-light-light/chip-bl602-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602+mfd lighting-app \ - out/artifacts/bouffalolab-bl602-night-light-light-mfd/chip-bl602-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602+rpc lighting-app \ - out/artifacts/bouffalolab-bl602-iot-matter-v1-light-115200-rpc/chip-bl602-lighting-example.out \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - - name: Build example BL702 Lighting App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target bouffalolab-bl706-night-light-light \ - --target bouffalolab-bl706-night-light-light-mfd \ - --target bouffalolab-bl706dk-light-ethernet \ - --target bouffalolab-bl706dk-light-wifi-fp \ - --target bouffalolab-xt-zb6-devkit-light-115200-rpc \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare some bloat report from the previous builds - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702 lighting-app \ - out/artifacts/bouffalolab-bl706-night-light-light/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702+mfd lighting-app \ - out/artifacts/bouffalolab-bl706-night-light-light-mfd/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl706-eth lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-ethernet/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl706-wifi lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-wifi-fp/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702+rpc lighting-app \ - out/artifacts/bouffalolab-xt-zb6-devkit-light-115200-rpc/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - - name: Build example BL702L Lighting App - timeout-minutes: 30 - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target bouffalolab-bl704ldk-light \ - --target bouffalolab-bl704ldk-light-mfd \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare some bloat report from the previous builds - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702l bl702l lighting-app \ - out/artifacts/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702l bl702l+mfd lighting-app \ - out/artifacts/bouffalolab-bl704ldk-light-mfd/chip-bl702l-lighting-example.out \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: BouffaloLab diff --git a/.github/workflows/examples-cc13xx_26xx.yaml b/.github/workflows/examples-cc13xx_26xx.yaml deleted file mode 100644 index 53c813d0b4c433..00000000000000 --- a/.github/workflows/examples-cc13xx_26xx.yaml +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) 2021 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. - -name: Build example - TI CC13XX_26XX - -on: - workflow_dispatch: - # Temporarely disabled: - # - TI CI runs out of disk space - # - Image should be updated to an Ubuntu 24.04 or higher based one (move from :54 version) - # push: - # branches-ignore: - # - 'dependabot/**' - # pull_request: - # merge_group: - -concurrency: - group: - ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - cc13xx_26xx: - name: cc13xx_26xx - - env: - BUILD_TYPE: gn_cc13xx_26xx - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-ti:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: cc13xx_26xx - extra-submodule-parameters: " --recursive" - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build examples - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target ti-cc13x4_26x4-lighting-ftd \ - --target ti-cc13x4_26x4-lighting-mtd \ - --target ti-cc13x4_26x4-lock-ftd \ - --target ti-cc13x4_26x4-lock-mtd \ - --target ti-cc13x4_26x4-pump-mtd \ - --target ti-cc13x4_26x4-pump-ftd \ - --target ti-cc13x4_26x4-pump-controller-mtd \ - --target ti-cc13x4_26x4-pump-controller-ftd \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Get lock FTD size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cc13x4_26x4 LP_EM_CC1354P10_6 lock-ftd \ - out/artifacts/ti-cc13x4_26x4-lock-ftd/chip-LP_EM_CC1354P10_6-lock-example.out \ - /tmp/bloat_reports/ - - name: Get lock MTD size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cc13x4_26x4 LP_EM_CC1354P10_6 lock-mtd \ - out/artifacts/ti-cc13x4_26x4-lock-mtd/chip-LP_EM_CC1354P10_6-lock-example.out \ - /tmp/bloat_reports/ - - name: Get Pump App size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cc13x4_26x4 LP_EM_CC1354P10_6 pump-app \ - out/artifacts/ti-cc13x4_26x4-pump-mtd/chip-LP_EM_CC1354P10_6-pump-example.out \ - /tmp/bloat_reports/ - - name: Get Pump Controller MTD size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cc13x4_26x4 LP_EM_CC1354P10_6 pump-controller-app \ - out/artifacts/ti-cc13x4_26x4-pump-controller-mtd/chip-LP_EM_CC1354P10_6-pump-controller-example.out \ - /tmp/bloat_reports/ - - name: Get Lighting FTD size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cc13x4_26x4 LP_EM_CC1354P10_6 lighting-app \ - out/artifacts/ti-cc13x4_26x4-lighting-ftd/chip-LP_EM_CC1354P10_6-lighting-example.out \ - /tmp/bloat_reports/ - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: cc13x4_26x4 diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml deleted file mode 100644 index 091a5eeabc4361..00000000000000 --- a/.github/workflows/examples-cc32xx.yaml +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (c) 2021 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. - -name: Build example - TI CC32XX - -on: - workflow_dispatch: - # Temporarely disabled: - # - TI CI runs out of disk space - # - Image should be updated to an Ubuntu 24.04 or higher based one (move from :54 version) - # push: - # branches-ignore: - # - 'dependabot/**' - # pull_request: - # merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - cc32xx: - name: cc32xx - - env: - BUILD_TYPE: gn_cc32xx - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-ti:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: cc32xx - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build examples - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target cc32xx-lock --target cc32xx-air-purifier build \ - --copy-artifacts-to out/artifacts \ - " - - name: Get lock app size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cc32xx CC3235SF_LAUNCHXL lock \ - out/artifacts/cc32xx-lock/chip-CC3235SF_LAUNCHXL-lock-example.out \ - /tmp/bloat_reports/ - - - name: Get air purifier app size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cc32xx CC3235SF_LAUNCHXL air-purifier \ - out/artifacts/cc32xx-air-purifier/chip-CC3235SF_LAUNCHXL-air-purifier-example.out \ - /tmp/bloat_reports/ - - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: cc32xx diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml deleted file mode 100644 index c236b4ca3db4c3..00000000000000 --- a/.github/workflows/examples-efr32.yaml +++ /dev/null @@ -1,148 +0,0 @@ -# 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. - -name: Build example - EFR32 - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - efr32: - name: EFR32 - - env: - SILABS_BOARD: BRD4187C - BUILD_TYPE: gn_efr32 - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-efr32:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: silabs_docker - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Test SLC gen - timeout-minutes: 30 - run: | - scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4187C --slc_generate --docker - rm -rf ./out/ - - name: Build some BRD4187C variants (1) - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target efr32-brd4187c-thermostat-openthread-mtd \ - --target efr32-brd4187c-switch-shell-use-ot-coap-lib \ - --target efr32-brd4187c-unit-test \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Clean out build output - run: rm -rf ./out - - name: Build some BRD4187C variants (2) - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target efr32-brd4187c-light-use-ot-lib \ - --target efr32-brd4187c-pump \ - --target efr32-brd4187c-lock-shell-heap-monitoring \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Clean out build output - run: rm -rf ./out - - name: Build BRD4187C variants (3) - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target efr32-brd4187c-window-covering-additional-data-advertising \ - --target efr32-brd4187c-light-rpc \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare some bloat report from the previous builds - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD4187C lighting-app \ - out/efr32-brd4187c-light-rpc/matter-silabs-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD4187C window-app \ - out/efr32-brd4187c-window-covering-additional-data-advertising/matter-silabs-window-example.out \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Build BRD4338A WiFi Soc variants - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target efr32-brd4338a-light-skip-rps-generation \ - --target efr32-brd4338a-lock-skip-rps-generation \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare bloat report for brd4338a lock app - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD4338a lock-app \ - out/efr32-brd4338a-lock-skip-rps-generation/matter-silabs-lock-example.out \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Build EFR32 with WiFi NCP - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target efr32-brd4187c-lock-wifi-siwx917 \ - --target efr32-brd4187c-light-wifi-rs9116 \ - --target efr32-brd4187c-lock-wifi-wf200 \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Clean out build output - run: rm -rf ./out - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: EFR32 diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml deleted file mode 100644 index 5d84540eda4676..00000000000000 --- a/.github/workflows/examples-esp32.yaml +++ /dev/null @@ -1,169 +0,0 @@ -# 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. - -name: Build example - ESP32 - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - esp32: - name: ESP32 - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-esp32:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: esp32 - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build some M5Stack variations - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target esp32-m5stack-all-clusters \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare bloat report - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - esp32 m5stack all-clusters-app \ - out/esp32-m5stack-all-clusters/chip-all-clusters-app.elf \ - /tmp/bloat_reports/ - - name: Prepare code pregen and ensure compile time pregen not possible - run: | - ./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated" - mv scripts/codegen.py scripts/codegen.py.renamed - mv scripts/tools/zap/generate.py scripts/tools/zap/generate.py.renamed - - name: Clean output - run: rm -rf ./out - - name: Build some M5Stack variations with pregen - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target esp32-m5stack-all-clusters-minimal \ - --target esp32-m5stack-all-clusters-rpc-ipv6only \ - --pregen-dir ./zzz_pregenerated \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Undo code pregeneration changes - run: | - rm -rf ./zzz_pregenerated - mv scripts/codegen.py.renamed scripts/codegen.py - mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py - - name: Build example All Clusters App(Target:ESP32C3) - run: scripts/examples/esp_example.sh all-clusters-app sdkconfig.defaults.esp32c3 esp32c3 - - name: Copy aside build products - run: | - mkdir -p example_binaries/esp32-build - cp examples/all-clusters-app/esp32/build/chip-all-clusters-app.elf \ - example_binaries/esp32-build/chip-all-clusters-app.elf - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - esp32 c3devkit all-clusters-app \ - example_binaries/esp32-build/chip-all-clusters-app.elf \ - /tmp/bloat_reports/ - - - name: Build example Pigweed App - run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults - - - name: Build example Lighting App (Target:ESP32H2) - run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32h2 esp32h2 - - - name: Build example Lock App (Target:ESP32C6) - run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6 esp32c6 - - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: ESP32 - - esp32_1: - name: ESP32_1 - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-esp32:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: esp32 - - - name: Build example Bridge App - run: scripts/examples/esp_example.sh bridge-app - - - name: Build example Persistent Storage App - run: scripts/examples/esp_example.sh persistent-storage sdkconfig.defaults - - - name: Build example Shell App - run: scripts/examples/esp_example.sh shell sdkconfig.defaults - - - name: Build example Temperature Measurement App - run: scripts/examples/esp_example.sh temperature-measurement-app sdkconfig.optimize.defaults - - - name: Build example OTA Requestor App - run: scripts/examples/esp_example.sh ota-requestor-app sdkconfig.defaults - - - name: Build example OTA Provider App - run: scripts/examples/esp_example.sh ota-provider-app sdkconfig.defaults - - - name: Build example Light Switch App (Target:ESP32C3) - run: scripts/examples/esp_example.sh light-switch-app sdkconfig.defaults.esp32c3 esp32c3 - - - name: Build example Lighting App (external platform) - run: scripts/examples/esp_example.sh lighting-app sdkconfig.ext_plat.defaults - - - name: Build example Energy Management App - run: scripts/examples/esp_example.sh energy-management-app sdkconfig.defaults - - - name: Build example LIT ICD App (Target:ESP32H2) - run: scripts/examples/esp_example.sh lit-icd-app sdkconfig.defaults esp32h2 diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml deleted file mode 100644 index 290e67273f9bd3..00000000000000 --- a/.github/workflows/examples-infineon.yaml +++ /dev/null @@ -1,223 +0,0 @@ -# Copyright (c) 2021 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. - -name: Build example - Infineon - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - infineon: - name: Infineon examples building - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-infineon:54 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: infineon - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build PSoC6 lock-app example - run: | - scripts/run_in_build_env.sh \ - "scripts/build/build_examples.py \ - --enable-flashbundle \ - --target infineon-psoc6-lock \ - build \ - --copy-artifacts-to out/artifacts \ - " - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - psoc6 cy8ckit_062s2_43012 lock \ - out/artifacts/infineon-psoc6-lock/chip-psoc6-lock-example.out \ - /tmp/bloat_reports/ - - name: Build PSoC6 all-clusters-app example - run: | - scripts/run_in_build_env.sh \ - "scripts/build/build_examples.py \ - --enable-flashbundle \ - --target infineon-psoc6-all-clusters \ - build \ - --copy-artifacts-to out/artifacts \ - " - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - psoc6 cy8ckit_062s2_43012 all-clusters \ - out/artifacts/infineon-psoc6-all-clusters/chip-psoc6-clusters-example.out \ - /tmp/bloat_reports/ - - name: Build PSoC6 all-clusters-minimal-app example - run: | - scripts/run_in_build_env.sh \ - "scripts/build/build_examples.py \ - --enable-flashbundle \ - --target infineon-psoc6-all-clusters-minimal \ - build \ - --copy-artifacts-to out/artifacts \ - " - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - psoc6 cy8ckit_062s2_43012 all-clusters-minimal \ - out/artifacts/infineon-psoc6-all-clusters-minimal/chip-psoc6-clusters-minimal-example.out \ - /tmp/bloat_reports/ - - name: Build PSoC6 lighting-app example - run: | - scripts/run_in_build_env.sh \ - "scripts/build/build_examples.py \ - --enable-flashbundle \ - --target infineon-psoc6-light \ - build \ - --copy-artifacts-to out/artifacts \ - " - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - psoc6 cy8ckit_062s2_43012 light \ - out/artifacts/infineon-psoc6-light/chip-psoc6-lighting-example.out \ - /tmp/bloat_reports/ - - - name: Build CYW30739 Lighting App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target cyw30739-cyw30739b2_p5_evk_01-light \ - --target cyw30739-cyw30739b2_p5_evk_02-light \ - --target cyw30739-cyw30739b2_p5_evk_03-light \ - --target cyw30739-cyw930739m2evb_02-light \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Get light size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-01 light \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_01-light/lighting_app-CYW30739B2-P5-EVK-01.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-02 light \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_02-light/lighting_app-CYW30739B2-P5-EVK-02.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-03 light \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_03-light/lighting_app-CYW30739B2-P5-EVK-03.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW930739M2EVB-02 light \ - out/artifacts/cyw30739-cyw930739m2evb_02-light/lighting_app-CYW930739M2EVB-02.elf \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Build CYW30739 Light Switch App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target cyw30739-cyw30739b2_p5_evk_01-light-switch \ - --target cyw30739-cyw30739b2_p5_evk_02-light-switch \ - --target cyw30739-cyw30739b2_p5_evk_03-light-switch \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Get light-switch size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-01 light-switch \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_01-light-switch/light_switch_app-CYW30739B2-P5-EVK-01.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-02 light-switch \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_02-light-switch/light_switch_app-CYW30739B2-P5-EVK-02.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-03 light-switch \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_03-light-switch/light_switch_app-CYW30739B2-P5-EVK-03.elf \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Build CYW30739 Lock App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target cyw30739-cyw30739b2_p5_evk_01-lock \ - --target cyw30739-cyw30739b2_p5_evk_02-lock \ - --target cyw30739-cyw30739b2_p5_evk_03-lock \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Get lock size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-01 lock \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_01-lock/lock_app-CYW30739B2-P5-EVK-01.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-02 lock \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_02-lock/lock_app-CYW30739B2-P5-EVK-02.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-03 lock \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_03-lock/lock_app-CYW30739B2-P5-EVK-03.elf \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Build CYW30739 Thermostat App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target cyw30739-cyw30739b2_p5_evk_01-thermostat \ - --target cyw30739-cyw30739b2_p5_evk_02-thermostat \ - --target cyw30739-cyw30739b2_p5_evk_03-thermostat \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Get thermostat size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-01 thermostat \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_01-thermostat/thermostat-CYW30739B2-P5-EVK-01.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-02 thermostat \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_02-thermostat/thermostat-CYW30739B2-P5-EVK-02.elf \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 CYW30739B2-P5-EVK-03 thermostat \ - out/artifacts/cyw30739-cyw30739b2_p5_evk_03-thermostat/thermostat-CYW30739B2-P5-EVK-03.elf \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: Infineon diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml deleted file mode 100644 index 41fe2456518850..00000000000000 --- a/.github/workflows/examples-linux-arm.yaml +++ /dev/null @@ -1,90 +0,0 @@ -# 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. - -name: Build example - Linux ARM - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - arm_crosscompile: - name: Linux ARM Cross compile - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-crosscompile:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build Some samples - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-arm64-chip-cert-clang \ - --target linux-arm64-all-clusters-clang \ - --target linux-arm64-chip-tool-ipv6only-clang \ - --target linux-arm64-chip-tool-nodeps-ipv6only \ - --target linux-arm64-lock-clang \ - --target linux-arm64-minmdns-clang \ - --target linux-arm64-light-rpc-ipv6only-clang \ - --target linux-arm64-thermostat-no-ble-clang \ - --target linux-arm64-lit-icd-no-ble-clang \ - --target linux-arm64-fabric-admin-clang-rpc \ - --target linux-arm64-fabric-bridge-no-ble-clang-rpc \ - build \ - " - - name: Bloat report - chip-tool - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux arm64 chip-tool-ipv6only \ - out/linux-arm64-chip-tool-ipv6only-clang/chip-tool \ - /tmp/bloat_reports/ - - name: Bloat report - thermostat - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux arm64 thermostat-no-ble \ - out/linux-arm64-thermostat-no-ble-clang/thermostat-app \ - /tmp/bloat_reports/ - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: Linux diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml deleted file mode 100644 index 6ad5f4c9d9c31e..00000000000000 --- a/.github/workflows/examples-linux-imx.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (c) 2022 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. - -name: Build example - i.MX Linux - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - imx: - name: Linux i.MX Build - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-imx:74 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Build lighting-app - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target imx-lighting-app \ - build" - - name: Clean out build output - run: rm -rf ./out - - name: Build chip-tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target imx-chip-tool \ - build" - - name: Clean out build output - run: rm -rf ./out - - name: Build thermostat - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target imx-thermostat \ - build" - - name: Clean out build output - run: rm -rf ./out - - name: Build all-cluster - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target imx-all-clusters-app \ - build" - - name: Clean out build output - run: rm -rf ./out - - name: Build all-cluster-minimal - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target imx-all-clusters-minimal-app \ - build" - - name: Clean out build output - run: rm -rf ./out - - name: Build ota-provider-app - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target imx-ota-provider-app \ - build" - - name: Clean out build output - run: rm -rf ./out diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml deleted file mode 100644 index aa4051ea308a56..00000000000000 --- a/.github/workflows/examples-linux-standalone.yaml +++ /dev/null @@ -1,225 +0,0 @@ -# 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. - -name: Build example - Linux Standalone - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - linux_standalone: - name: Linux Standalone - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build Standalone cert tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-chip-cert \ - build" - - name: Build minmdns example with platform dns - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-address-resolve-tool-platform-mdns-ipv6only \ - build" - - name: Build example Standalone chip tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-chip-tool \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug chip-tool \ - out/linux-x64-chip-tool/chip-tool \ - /tmp/bloat_reports/ - - name: Build example Standalone Shell - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-shell \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug shell \ - out/linux-x64-shell/chip-shell \ - /tmp/bloat_reports/ - - name: Build example Standalone All Clusters Server - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-all-clusters \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug all-clusters-app \ - out/linux-x64-all-clusters/chip-all-clusters-app \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Build example Standalone All Clusters Minimal Server - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-all-clusters-minimal \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug all-clusters-minimal-app \ - out/linux-x64-all-clusters-minimal/chip-all-clusters-minimal-app \ - /tmp/bloat_reports/ - - name: Build example TV app - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-tv-app \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug tv-app \ - out/linux-x64-tv-app/chip-tv-app \ - /tmp/bloat_reports/ - - name: Build example Standalone TV Casting App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-tv-casting-app \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug tv-casting-app \ - out/linux-x64-tv-casting-app/chip-tv-casting-app \ - /tmp/bloat_reports/ - - name: Build example lighting app with RPCs and UI - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-light-rpc-with-ui \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug+rpc+ui lighting-app \ - out/linux-x64-light-rpc-with-ui/chip-lighting-app \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Build example Standalone Bridge - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-bridge \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug bridge-app \ - out/linux-x64-bridge/chip-bridge-app \ - /tmp/bloat_reports/ - - name: Build example OTA Provider - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-ota-provider \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug ota-provider-app \ - out/linux-x64-ota-provider/chip-ota-provider-app \ - /tmp/bloat_reports/ - - name: Build example OTA Requestor - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-ota-requestor \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug ota-requestor-app \ - out/linux-x64-ota-requestor/chip-ota-requestor-app \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - - name: Build example Standalone Lock App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-lock-no-thread \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug lock-app \ - out/linux-x64-lock-no-thread/chip-lock-app \ - /tmp/bloat_reports/ - - name: Build example contact sensor with UI - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-contact-sensor-no-ble-with-ui \ - build" - - name: Build example Air Purifier - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-air-purifier \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug air-purifier-app \ - out/linux-x64-air-purifier/chip-air-purifier-app \ - /tmp/bloat_reports/ - - name: Build example Fabric Admin - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-fabric-admin-rpc \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug fabric-admin \ - out/linux-x64-fabric-admin-rpc/fabric-admin \ - /tmp/bloat_reports/ - - name: Build example Fabric Bridge App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-fabric-bridge-no-ble-rpc \ - build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug fabric-bridge-app \ - out/linux-x64-fabric-bridge-no-ble-rpc/fabric-bridge-app \ - /tmp/bloat_reports/ - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: Linux-Standalone diff --git a/.github/workflows/examples-linux-tv-casting-app.yaml b/.github/workflows/examples-linux-tv-casting-app.yaml deleted file mode 100644 index e2ff0f9f6697da..00000000000000 --- a/.github/workflows/examples-linux-tv-casting-app.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (c) 2024 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. - -name: Test TV Casting Example - -on: - push: - branches-ignore: - - "dependabot/**" - pull_request: - merge_group: - -concurrency: - group: - ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -jobs: - Linux-test: - name: Linux Test - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Set Up Environment for Size Reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build Linux tv-app - run: | - ./scripts/run_in_build_env.sh \ - "scripts/examples/gn_build_example.sh examples/tv-app/linux/ out/tv-app" - - - name: Build Linux tv-casting-app - run: | - ./scripts/run_in_build_env.sh \ - "scripts/examples/gn_build_example.sh examples/tv-casting-app/linux/ out/tv-casting-app chip_casting_simplified=true" - - - name: - Test casting from Linux tv-casting-app to Linux tv-app - - Commissionee Generated Passcode - run: | - ./scripts/run_in_build_env.sh \ - "python3 ./scripts/tests/run_tv_casting_test.py" - timeout-minutes: 2 # Comment this out to debug if GitHub Action times out. - - # TODO: this test is flaky and was disabled - # https://github.com/project-chip/connectedhomeip/issues/34598 - # - # - name: - # Test casting from Linux tv-casting-app to Linux tv-app - - # Commissioner Generated Passcode - # run: | - # ./scripts/run_in_build_env.sh \ - # "python3 ./scripts/tests/run_tv_casting_test.py --commissioner-generated-passcode=True" - # timeout-minutes: 2 # Comment this out to debug if GitHub Action times out. - - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: Linux diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml deleted file mode 100644 index 04664c28cf339e..00000000000000 --- a/.github/workflows/examples-mw320.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Build example - MW320 - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - mw320: - name: MW320 - - env: - BUILD_TYPE: gn_mw320 - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: mw320 - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build MW320 all clusters example app - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target 'mw320-all-clusters-app' \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: MW320 diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml deleted file mode 100644 index 13b0ae9c691d7c..00000000000000 --- a/.github/workflows/examples-nrfconnect.yaml +++ /dev/null @@ -1,211 +0,0 @@ -# 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. - -name: Build example - nRF Connect SDK - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - nrfconnect: - name: nRF Connect SDK - - env: - BUILD_TYPE: nrfconnect - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-nrf-platform:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: nrfconnect - - name: Detect changed paths - uses: dorny/paths-filter@v3 - id: changed_paths - with: - filters: | - nrfconnect: - - '**/nrfconnect/**' - - '**/Zephyr/**' - - '**/zephyr/**' - tests: - - '**/tests/**' - shell: - - 'examples/shell/nrfconnect/**' - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Check nRF Connect SDK revision. - run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --check" - - name: Run unit tests of factory data generation script - run: | - scripts/run_in_build_env.sh 'pip3 install -r scripts/setup/requirements.nrfconnect.txt' - scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py" - - name: Build example nRF Connect SDK Lock App on nRF52840 DK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh lock-app nrf52840dk/nrf52840 - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dk_nrf52840 lock-app \ - examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle/nrf52840 -DCONFIG_CHIP_ROTATING_DEVICE_ID=y - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dongle_nrf52840 lighting-app \ - examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Lighting App on nRF52840 DK with RPC - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk/nrf52840 -DOVERLAY_CONFIG=rpc.overlay - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dk_nrf52840+rpc lighting-app \ - examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Light Switch App on nRF52840 DK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh light-switch-app nrf52840dk/nrf52840 - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dk_nrf52840 light-switch-app \ - examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Shell on nRF52840 DK - if: github.event_name == 'push' || steps.changed_paths.outputs.shell == 'true' - run: | - scripts/examples/nrfconnect_example.sh shell nrf52840dk/nrf52840 - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dk_nrf52840 shell \ - examples/shell/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Pump App on nRF52840 DK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh pump-app nrf52840dk/nrf52840 - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dk_nrf52840 pump-app \ - examples/pump-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Pump Controller App on nRF52840 DK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh pump-controller-app nrf52840dk/nrf52840 - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dk_nrf52840 pump-controller-app \ - examples/pump-controller-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK All Clusters App on nRF52840 DK - run: | - scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk/nrf52840 - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dk_nrf52840 all-clusters-app \ - examples/all-clusters-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK All Clusters Minimal App on nRF52840 DK - run: | - scripts/examples/nrfconnect_example.sh all-clusters-minimal-app nrf52840dk/nrf52840 -DFILE_SUFFIX=dfu - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf52840dk_nrf52840 all-clusters-minimal-app \ - examples/all-clusters-minimal-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Lock App on nRF5340 DK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh lock-app nrf5340dk/nrf5340/cpuapp - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf5340dk_nrf5340_cpuapp lock-app \ - examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Lighting App on nRF5340 DK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk/nrf5340/cpuapp - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf5340dk_nrf5340_cpuapp lighting-app \ - examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Lock App on nRF7002 PDK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh lock-app nrf7002dk/nrf5340/cpuapp - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf7002dk_nrf5340_cpuapp lock-app \ - examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Light Switch App on nRF7002 PDK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh light-switch-app nrf7002dk/nrf5340/cpuapp - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf7002dk_nrf5340_cpuapp light-switch-app \ - examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK Lighting App on nRF7002 PDK - if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/examples/nrfconnect_example.sh lighting-app nrf7002dk/nrf5340/cpuapp - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf7002dk_nrf5340_cpuapp lighting-app \ - examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Build example nRF Connect SDK All Clusters App on nRF7002 PDK - run: | - scripts/examples/nrfconnect_example.sh all-clusters-app nrf7002dk/nrf5340/cpuapp -DFILE_SUFFIX=release - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nrfconnect nrf7002dk_nrf5340_cpuapp all-clusters-app \ - examples/all-clusters-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - name: Run unit tests for Zephyr native_posix_64 platform - if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true' || steps.changed_paths.outputs.nrfconnect == 'true' - run: | - scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-posix-64-tests build" - - name: Uploading Failed Test Logs - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: test-log - path: | - src/test_driver/nrfconnect/build/Testing/Temporary/LastTest.log - - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: nRFConnect diff --git a/.github/workflows/examples-nuttx.yaml b/.github/workflows/examples-nuttx.yaml deleted file mode 100644 index d1bf7594b0a332..00000000000000 --- a/.github/workflows/examples-nuttx.yaml +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2024 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. - -name: Build example - NuttX - -on: - push: - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - nuttx: - name: NuttX - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-nuttx:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: nuttx - extra-submodule-parameters: " --recursive" - - name: Build example simulator NuttX Lighting App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target nuttx-x64-light \ - build \ - " diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml deleted file mode 100644 index 050751457645d4..00000000000000 --- a/.github/workflows/examples-nxp.yaml +++ /dev/null @@ -1,233 +0,0 @@ -# Copyright (c) 2021 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. - -name: Build example - NXP - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - k32w0: - name: K32W0 - - env: - BUILD_TYPE: gn_k32w - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-k32w:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: nxp - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build examples - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target nxp-k32w0-freertos-lighting \ - --target nxp-k32w0-freertos-lighting-factory \ - --target nxp-k32w0-freertos-lighting-rotating-id \ - --target nxp-k32w0-freertos-contact-sensor \ - --target nxp-k32w0-freertos-contact-sensor-low-power \ - --target nxp-k32w0-freertos-contact-sensor-low-power-factory \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Get lighting app size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nxp k32w0+release light \ - out/artifacts/nxp-k32w0-freertos-lighting/chip-k32w0x-light-example.elf \ - /tmp/bloat_reports/ - - name: Get contact sensor size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nxp k32w0+release contact \ - out/artifacts/nxp-k32w0-freertos-contact-sensor-low-power/chip-k32w0x-contact-example.elf \ - /tmp/bloat_reports/ - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: K32W0 - k32w1: - name: K32W1 - - env: - BUILD_TYPE: gn_k32w - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-nxp:71 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: nxp - extra-submodule-parameters: --recursive - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build examples - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target nxp-k32w1-freertos-lighting \ - --target nxp-k32w1-freertos-contact-sensor-low-power \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Get lighting app size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nxp k32w1+release light \ - out/artifacts/nxp-k32w1-freertos-lighting/chip-k32w1-light-example.elf \ - /tmp/bloat_reports/ - - name: Get contact sensor size stats - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - nxp k32w1+release contact \ - out/artifacts/nxp-k32w1-freertos-contact-sensor-low-power/chip-k32w1-contact-example.elf \ - /tmp/bloat_reports/ - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: K32W1 - rw61x: - name: RW61X - - env: - BUILD_TYPE: gn_rw61x - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-nxp:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: nxp - extra-submodule-parameters: --recursive - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build RW61X all clusters example app - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target nxp-rw61x-freertos-all-clusters-wifi \ - --target nxp-rw61x-freertos-all-clusters-thread \ - --target nxp-rw61x-freertos-all-clusters-thread-wifi \ - build \ - --copy-artifacts-to out/artifacts \ - " - - - name: Build RW61X thermostat example app - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target nxp-rw61x-freertos-thermostat-wifi \ - --target nxp-rw61x-freertos-thermostat-thread \ - --target nxp-rw61x-freertos-thermostat-thread-wifi \ - build \ - --copy-artifacts-to out/artifacts \ - " - - - name: Build RW61X laundry-washer example app - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target nxp-rw61x-freertos-laundry-washer-wifi \ - --target nxp-rw61x-freertos-laundry-washer-thread \ - --target nxp-rw61x-freertos-laundry-washer-thread-wifi \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: RW61X - zephyr: - name: ZEPHYR_RW61X - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-nxp-zephyr:74 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: nxp - - - name: Build RW61x Zephyr examples - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target nxp-rw61x-zephyr-all-clusters \ - --target nxp-rw61x-zephyr-thermostat \ - --target nxp-rw61x-zephyr-laundry-washer-factory \ - build \ - " diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml deleted file mode 100644 index d85a789a0bcef7..00000000000000 --- a/.github/workflows/examples-openiotsdk.yaml +++ /dev/null @@ -1,220 +0,0 @@ -# Copyright (c) 2021 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. - -name: Build example - Open IoT SDK - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - openiotsdk: - name: Open IoT SDK examples building - - env: - TEST_NETWORK_NAME: OIStest - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-openiotsdk:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - options: --privileged - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: openiotsdk linux - extra-submodule-parameters: " --recursive" - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build and install Python controller - run: | - scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' - scripts/run_in_python_env.sh out/venv 'pip install -r scripts/setup/requirements.openiotsdk.txt' - - - name: Build shell example - id: build_shell - run: | - scripts/examples/openiotsdk_example.sh shell - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - openiotsdk release shell \ - examples/shell/openiotsdk/build/chip-openiotsdk-shell-example.elf \ - /tmp/bloat_reports/ - - - name: "Test: shell example" - if: github.event_name == 'workflow_dispatch' && steps.build_shell.outcome == 'success' - run: | - scripts/run_in_python_env.sh out/venv \ - 'scripts/examples/openiotsdk_example.sh --no-activate -C test shell' - - - name: Clean shell output - run: rm -rf examples/shell/openiotsdk/build - - - name: Build lock-app example (mbedtls) - # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026 - if: false - id: build_lock_app_mbedtls - run: | - scripts/examples/openiotsdk_example.sh -b mbedtls lock-app - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - openiotsdk release lock-app-mbedtls \ - examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \ - /tmp/bloat_reports/ - - - name: Build tv-app example - id: build_tv_app - timeout-minutes: 10 - run: | - scripts/examples/openiotsdk_example.sh tv-app - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - openiotsdk release tv-app \ - examples/tv-app/openiotsdk/build/chip-openiotsdk-tv-app-example.elf \ - /tmp/bloat_reports/ - - - name: "Test: tv-app example" - if: github.event_name == 'workflow_dispatch' && steps.build_tv_app.outcome == 'success' - timeout-minutes: 10 - run: | - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up - scripts/run_in_python_env.sh out/venv \ - 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap tv-app' - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down - - - name: Clean tv-app output - run: rm -rf examples/tv-app/openiotsdk/build - - - name: Build all-clusters-app example - id: build_all_clusters_app - timeout-minutes: 10 - run: | - scripts/examples/openiotsdk_example.sh all-clusters-app - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - openiotsdk release all-clusters-app \ - examples/all-clusters-app/openiotsdk/build/chip-openiotsdk-all-clusters-app-example.elf \ - /tmp/bloat_reports/ - - - name: "Test: all-clusters-app example" - if: github.event_name == 'workflow_dispatch' && steps.build_all_clusters_app.outcome == 'success' - timeout-minutes: 5 - run: | - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up - scripts/run_in_python_env.sh out/venv \ - 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap all-clusters-app' - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down - - - name: Clean all-clusters-app output - run: rm -rf examples/all-clusters-app/openiotsdk/build - - - name: Build ota-requestor-app example - id: build_ota_requestor_app - timeout-minutes: 10 - run: | - scripts/examples/openiotsdk_example.sh -v 1 -V 0.0.1 ota-requestor-app - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - openiotsdk release ota-requestor-app \ - examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.elf \ - /tmp/bloat_reports/ - - - name: Build unit tests (mbedtls) - # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026 - if: false - id: build_unit_tests_mbedtls - run: | - scripts/examples/openiotsdk_example.sh -b mbedtls unit-tests - - - name: Build the OTA provider (Linux) - id: build_ota_provider_app - if: steps.build_ota_requestor_app.outcome == 'success' - timeout-minutes: 10 - run: | - scripts/examples/gn_build_example.sh examples/ota-provider-app/linux/ out/ota-provider chip_config_network_layer_ble=false - - - name: "Test: lock-app example (mbedtls)" - if: github.event_name == 'workflow_dispatch' && steps.build_lock_app_mbedtls.outcome == 'success' - run: | - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up - scripts/run_in_python_env.sh out/venv \ - 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap lock-app' - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down - - - name: "Test: ota-requestor-app example" - if: github.event_name == 'workflow_dispatch' && steps.build_ota_requestor_app.outcome == 'success' && steps.build_ota_provider_app.outcome == 'success' - timeout-minutes: 30 - run: | - mkdir out/binaries - cp examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.elf out/binaries/ - scripts/examples/openiotsdk_example.sh -c -v 2 -V 0.0.2 ota-requestor-app - cp examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.ota out/binaries/ - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up - scripts/run_in_python_env.sh out/venv \ - 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -p out/binaries -v 2 -V 0.0.2 -C test -n ${TEST_NETWORK_NAME}tap ota-requestor-app' - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down - - - name: "Test: unit-tests (mbedtls)" - if: github.event_name == 'workflow_dispatch' && steps.build_unit_tests_mbedtls.outcome == 'success' - run: | - scripts/run_in_python_env.sh out/venv \ - 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests' - - - name: Build lock-app example (psa) - # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026 - if: false - id: build_lock_app_psa - run: | - scripts/examples/openiotsdk_example.sh -c -b psa lock-app - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - openiotsdk release lock-app-psa \ - examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \ - /tmp/bloat_reports/ - - - name: "Test: lock-app example (psa)" - if: github.event_name == 'workflow_dispatch' && steps.build_lock_app_psa.outcome == 'success' - run: | - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up - scripts/run_in_python_env.sh out/venv \ - 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap lock-app' - scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down - - - name: Build unit tests (psa) - id: build_unit_tests_psa - run: | - scripts/examples/openiotsdk_example.sh -b psa unit-tests - - - name: "Test: unit-tests (psa)" - if: github.event_name == 'workflow_dispatch' && steps.build_unit_tests_psa.outcome == 'success' - run: | - scripts/run_in_python_env.sh out/venv \ - 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests' diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml deleted file mode 100644 index 18d47cf8ef9937..00000000000000 --- a/.github/workflows/examples-qpg.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Build example - QPG - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - qpg: - name: QPG - - env: - BUILD_TYPE: gn_qpg - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: qpg - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build QPG6105 example apps - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target qpg-qpg6105-lock \ - --target qpg-qpg6105-light \ - --target qpg-qpg6105-light-switch \ - --target qpg-qpg6105-thermostat \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Build Matter SDK library - run: | - config/qpg/chip-gn/build.sh - - - name: Prepare some bloat report from the previous builds - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - qpg qpg6105+debug lighting-app \ - out/qpg-qpg6105-light/chip-qpg6105-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - qpg qpg6105+debug lock-app \ - out/qpg-qpg6105-lock/chip-qpg6105-lock-example.out \ - /tmp/bloat_reports/ - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: QPG diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml deleted file mode 100644 index 6c4fa05864efff..00000000000000 --- a/.github/workflows/examples-stm32.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Build example - stm32 - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - stm32: - name: stm32 - timeout-minutes: 60 - - env: - BUILD_TYPE: gn_stm32 - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: stm32 - extra-submodule-parameters: --recursive - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build stm32 example apps - timeout-minutes: 20 - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target stm32-STM32WB5MM-DK-light build \ - " - - - name: Gather size reports - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - stm32 STM32WB5MM-DK light \ - out/stm32-stm32wb5mm-dk-light/chip-stm32-lighting-example.elf \ - /tmp/bloat_reports/ - - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: stm32 diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml deleted file mode 100644 index 904ae98fbcabcc..00000000000000 --- a/.github/workflows/examples-telink.yaml +++ /dev/null @@ -1,280 +0,0 @@ -# Copyright (c) 2022-2024 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. - -name: Build example - Telink - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - telink: - name: Telink - env: - BUILD_TYPE: telink - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-telink:74 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: telink - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - # - name: Update Zephyr to specific revision (for developers purpose) - # run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py ab81a585fca6a83b30e1f4e58a021113d6a3acb8" - - - name: Build example Telink (B92 retention) Air Quality Sensor App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-air-quality-sensor' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9528a_retention air-quality-sensor-app \ - out/telink-tlsr9528a_retention-air-quality-sensor/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (W91) All Clusters App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-all-clusters' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9118bdk40d all-clusters-app \ - out/telink-tlsr9118bdk40d-all-clusters/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B92) All Clusters Minimal App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9528a-all-clusters-minimal' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9528a all-clusters-minimal-app \ - out/telink-tlsr9528a-all-clusters-minimal/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B95) Bridge App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9258a-bridge' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9258a bridge-app \ - out/telink-tlsr9258a-bridge/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B92 retention) Contact Sensor App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-contact-sensor' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9528a_retention contact-sensor-app \ - out/telink-tlsr9528a_retention-contact-sensor/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build tools required for Factory Data - run: | - ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - ./scripts/build/gn_gen.sh - ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" - mv ./out/$BUILD_TYPE/chip-cert ./out/$BUILD_TYPE/chip-tool ./out/$BUILD_TYPE/spake2p ./out - - - name: clean out build output (keep tools) - run: rm -rf ./out/telink* - - - name: Build example Telink (W91) Lighting App with OTA, Factory Data - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-light-ota-factory-data' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9118bdk40d lighting-app-ota-factory-data \ - out/telink-tlsr9118bdk40d-light-ota-factory-data/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output (keep tools) - run: rm -rf ./out/telink* - - - name: Build example Telink (B91) Lighting App with OTA, RPC, Factory Data and 4Mb flash - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-ota-rpc-factory-data-4mb \ - out/telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output (keep tools) - run: rm -rf ./out/telink* - - - name: Build example Telink (B92) Light Switch App with OTA, Shell, Factory Data - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-switch-ota-shell-factory-data' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9528a light-switch-app-ota-shell-factory-data \ - out/telink-tlsr9528a-light-switch-ota-shell-factory-data/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B92) Lock App with DFU - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9528a-lock-dfu' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9528a lock-app-dfu \ - out/telink-tlsr9528a-lock-dfu/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B95) OTA Requestor App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9258a-ota-requestor' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9258a ota-requestor-app \ - out/telink-tlsr9258a-ota-requestor/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B91 USB) Pump App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-usb' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d pump-app-usb \ - out/telink-tlsr9518adk80d-pump-usb/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B91) Pump Controller App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-controller' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d pump-controller-app \ - out/telink-tlsr9518adk80d-pump-controller/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B91) Shell App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-shell' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d shell \ - out/telink-tlsr9518adk80d-shell/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B92 retention) Smoke CO Alarm App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-smoke-co-alarm' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9528a_retention smoke_co_alarm-app \ - out/telink-tlsr9528a_retention-smoke-co-alarm/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B91 Mars) Temperature Measurement App with OTA - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-temperature-measurement-mars-ota' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d temperature-measurement-app-mars-ota \ - out/telink-tlsr9518adk80d-temperature-measurement-mars-ota/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (B91) Thermostat App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-thermostat' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d thermostat \ - out/telink-tlsr9518adk80d-thermostat/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink (W91) Window Covering App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-window-covering' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9118bdk40d window-covering \ - out/telink-tlsr9118bdk40d-window-covering/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: Telink diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml deleted file mode 100644 index f6571342a84618..00000000000000 --- a/.github/workflows/examples-tizen.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (c) 2021 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. - -name: Build example - Tizen - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - tizen: - name: Tizen - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-tizen:74 - options: --user root - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - - "/tmp/output_binaries:/tmp/output_binaries" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: tizen - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build Tizen examples - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target tizen-arm-all-clusters \ - --target tizen-arm-chip-tool-ubsan \ - --target tizen-arm-light-with-ui \ - build \ - --copy-artifacts-to out/artifacts \ - " - - - name: Bloat report - chip-tool - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - tizen arm chip-tool-ubsan out/tizen-arm-chip-tool-ubsan/chip-tool \ - /tmp/bloat_reports/ - - name: Bloat report - all-clusters-app - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - tizen arm all-clusters-app out/tizen-arm-all-clusters/chip-all-clusters-app \ - /tmp/bloat_reports/ - - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: Tizen diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml deleted file mode 100644 index 43aee09a821be9..00000000000000 --- a/.github/workflows/full-android.yaml +++ /dev/null @@ -1,117 +0,0 @@ -# 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. - -name: Full builds - Android - -on: - push: - branches-ignore: - - 'dependabot/**' - workflow_dispatch: - -concurrency: - group: full-${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - full_android: - name: Run - - env: - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64/ - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-android:74 - volumes: - - "/tmp/log_output:/tmp/test_logs" - - steps: - - uses: actions/checkout@v4 - name: Checkout - with: - token: ${{ github.token }} - # To use act like: - # act -j full_android - # - # Note you likely still need to have non submodules setup for the - # local machine, like: - # git submodule deinit --all - - uses: actions/checkout@v4 - if: ${{ env.ACT }} - name: Checkout (ACT for local build) - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: android - - - name: Cleanup pigweed CIPD packages - # This should not generally be needed, however android CI runs out of space - # We do not need pigweed cross compile here because we use android NDK - # compilers. Removing this package saves a significant amount of space. - continue-on-error: true - run: | - du -sh .environment/cipd/packages/arm - rm -rf .environment/cipd/packages/arm - - name: Build Android arm-chip-tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target android-arm-chip-tool build" - - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar - - name: Build Android arm-tv-casting-app - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target android-arm-tv-casting-app build" - - name: Clean out build output - run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar - - name: Build Android arm-tv-server - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target android-arm-tv-server build" - - name: Clean out build output - run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar - - name: Build Android arm64-tv-casting-app - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build" - - name: Clean out build output - run: rm -rf ./out examples/tv-casting-app/android/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar - - name: Build Android arm64-tv-server - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target android-arm64-tv-server build" - - name: Clean out build output - run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar - - name: Build Android arm64-chip-tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target android-arm64-chip-tool build" - - name: Run Android build rule tests - run: | - ./scripts/run_in_build_env.sh \ - "ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test" - - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar - - name: Build Android arm64-chip-test - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target android-arm64-chip-test build" - - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTest/app/libs/jniLibs/* examples/android/CHIPTest/app/libs/*.jar diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml deleted file mode 100644 index d839317bc4248e..00000000000000 --- a/.github/workflows/fuzzing-build.yaml +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (c) 2021 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. - -name: Fuzzing Builds - -on: - # For now, only manual triggers. - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - build_linux_fuzzing: - name: Build on Linux - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/tmp/log_output:/tmp/test_logs" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - run: apt-get update - - run: apt-get install --fix-missing llvm-10 clang-10 - - name: Try to ensure the objdir-clone dir exists - run: | - mkdir objdir-clone || true - - - name: Bootstrap - uses: ./.github/actions/bootstrap - - - name: Build all-clusters-app - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-all-clusters-no-ble-libfuzzer \ - build \ - --copy-artifacts-to objdir-clone \ - " - - name: Uploading binaries - uses: actions/upload-artifact@v4 - if: ${{ !env.ACT }} - with: - name: objdir-linux - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 - - build_darwin_fuzzing: - name: Build on Darwin - runs-on: macos-13 - if: github.actor != 'restyled-io[bot]' - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Environment - run: brew install llvm - - name: Try to ensure the objdir-clone dir exists - run: | - mkdir objdir-clone || true - - - name: Bootstrap - uses: ./.github/actions/bootstrap - - - name: Build all-clusters-app - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target darwin-x64-all-clusters-no-ble-asan-libfuzzer-clang \ - build \ - --copy-artifacts-to objdir-clone \ - " - - name: Uploading binaries - uses: actions/upload-artifact@v4 - if: ${{ !env.ACT }} - with: - name: crash-darwin - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml deleted file mode 100644 index ab3f49942329ce..00000000000000 --- a/.github/workflows/gradle-wrapper-validation.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: "Validate Gradle Wrapper" -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - -jobs: - validation: - name: "Validation" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: Wandalen/wretry.action@v1.4.5 - name: Gradle Validation - continue-on-error: true - with: - action: gradle/wrapper-validation-action@v1 - attempt_limit: 3 - attempt_delay: 2000 diff --git a/.github/workflows/issue-labeler.yaml b/.github/workflows/issue-labeler.yaml deleted file mode 100644 index a92a4c212d187a..00000000000000 --- a/.github/workflows/issue-labeler.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: "Issue Labeler" -on: - issues: - types: [opened, edited] - -permissions: - issues: write - contents: read - -jobs: - triage: - runs-on: ubuntu-latest - steps: - - uses: github/issue-labeler@v3.4 #May not be the latest version - with: - configuration-path: .github/issue-labeler.yml - not-before: 2020-01-15T02:54:34Z - enable-versioned-regex: 0 - sync-labels: 1 - repo-token: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml deleted file mode 100644 index a43fdfb7f49d4d..00000000000000 --- a/.github/workflows/java-tests.yaml +++ /dev/null @@ -1,308 +0,0 @@ -# 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. - -name: Java Tests - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - java_tests_linux: - name: Linux - - env: - TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt" - - if: github.actor != 'restyled-io[bot]' - runs-on: ubuntu-latest - - container: - image: ghcr.io/project-chip/chip-build-java:74 - options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} - - name: Try to ensure the directories for core dumping exist and we - can write them. - run: | - mkdir /tmp/cores || true - sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true - mkdir objdir-clone || true - - name: Generate unit tests - run: | - scripts/run_in_build_env.sh \ - './scripts/build/build_examples.py \ - --target linux-x64-tests \ - gen \ - ' - - name: Build unit tests - run: scripts/run_in_build_env.sh 'ninja -C out/linux-x64-tests src:java_controller_tests' - - - name: Run unit tests - # TODO: this direct path loading is not maintainable. Our build system should define and - # support test classes. - run: | - $JAVA_PATH/bin/java \ - -cp 'third_party/java_deps/artifacts/*:out/linux-x64-tests/lib/src/controller/java/*' \ - org.junit.runner.JUnitCore \ - matter.tlv.TlvWriterTest \ - matter.tlv.TlvReadWriteTest \ - matter.tlv.TlvReaderTest \ - matter.jsontlv.JsonToTlvToJsonTest \ - matter.onboardingpayload.ManualCodeTest \ - matter.onboardingpayload.QRCodeTest - - name: Build Java Matter Controller and all clusters app - run: | - scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' - scripts/run_in_python_env.sh out/venv 'pip install -r scripts/setup/requirements.build.txt' - scripts/run_in_python_env.sh out/venv 'pip install colorama' - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test \ - --target linux-x64-java-matter-controller \ - --target linux-x64-lit-icd-ipv6only \ - build \ - " - - name: Build Kotlin Matter Controller - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-kotlin-matter-controller \ - build \ - " - - name: Run Discover Commissionables Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "discover" \ - --tool-args "commissionables" \ - --factoryreset \ - ' - - name: Run Pairing Onnetwork Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "pairing" \ - --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ - --factoryreset \ - ' - - name: Run IM Invoke Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ - --factoryreset \ - ' - - name: Run IM Extendable Invoke Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-extendable-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ - --factoryreset \ - ' - - name: Run IM Read Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-read --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ - --factoryreset \ - ' - - name: Run IM Write Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-write --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ - --factoryreset \ - ' - - name: Run IM Subscribe Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-subscribe --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ - --factoryreset \ - ' - - name: Run Pairing AlreadyDiscovered Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "pairing" \ - --tool-args "already-discovered --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \ - --factoryreset \ - ' - # Disabled due to failure: https://github.com/project-chip/connectedhomeip/issues/27361 - # - name: Run Pairing Address-PaseOnly Test - # run: | - # scripts/run_in_python_env.sh out/venv \ - # './scripts/tests/run_java_test.py \ - # --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - # --app-args "--discriminator 3840 --interface-id -1" \ - # --tool-path out/linux-x64-java-matter-controller \ - # --tool-cluster "pairing" \ - # --tool-args "address-paseonly --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \ - # --factoryreset \ - # ' - - name: Run Pairing SetupQRCode Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "pairing" \ - --tool-args "code --nodeid 1 --setup-payload MT:-24J0AFN00KA0648G00 --discover-once 1 --use-only-onnetwork-discovery 0 -t 1000" \ - --factoryreset \ - ' - - name: Run Pairing ManualCode Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "pairing" \ - --tool-args "code --nodeid 1 --setup-payload 34970112332 --discover-once 1 --use-only-onnetwork-discovery 0 -t 1000" \ - --factoryreset \ - ' - - name: Run Pairing ICD Onnetwork Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_java_test.py \ - --app out/linux-x64-lit-icd-ipv6only/lit-icd-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-java-matter-controller \ - --tool-cluster "pairing" \ - --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ - --factoryreset \ - ' - - name: Run Pairing Onnetwork Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_kotlin_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-kotlin-matter-controller \ - --tool-cluster "pairing" \ - --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ - --factoryreset \ - ' - - name: Run Kotlin IM Invoke Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_kotlin_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-kotlin-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ - --factoryreset \ - ' - - name: Run Kotlin IM Read Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_kotlin_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-kotlin-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-read --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ - --factoryreset \ - ' - - name: Run Kotlin IM Write Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_kotlin_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-kotlin-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-write --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ - --factoryreset \ - ' - - name: Run Kotlin IM Subscribe Test - run: | - scripts/run_in_python_env.sh out/venv \ - './scripts/tests/run_kotlin_test.py \ - --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ - --app-args "--discriminator 3840 --interface-id -1" \ - --tool-path out/linux-x64-kotlin-matter-controller \ - --tool-cluster "im" \ - --tool-args "onnetwork-long-im-subscribe --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ - --factoryreset \ - ' - - name: Uploading core files - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-linux-java-controller - path: /tmp/cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-linux-java-controller - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 diff --git a/.github/workflows/kotlin-style.yaml b/.github/workflows/kotlin-style.yaml deleted file mode 100644 index a8d328268951bf..00000000000000 --- a/.github/workflows/kotlin-style.yaml +++ /dev/null @@ -1,70 +0,0 @@ -name: Kotlin - -on: - pull_request: - paths: - - "**/*.kt" - - ".github/workflows/kotlin-style.yaml" - - "kotlin-detect-config.yaml" - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - - -jobs: - detekt: - name: Static code analysis - runs-on: ubuntu-latest - - steps: - - name: "checkout" - uses: actions/checkout@v4 - - - name: "detekt" - uses: natiginfo/action-detekt-all@1.23.6 - # Detekt seems not to like circular symlinks, so we set up - # explicit paths below - # - # In particular, if symlinks exist and recurse, detekt tries to - # follow, so for example `examples/android/CHIPTest` as a path - # will never end (and eventually run out of HEAP) because - # `examples/android/CHIPTest/third_party/connectedhomeip` is - # circular - with: - args: --parallel --build-upon-default-config --config kotlin-detect-config.yaml --input examples/android/CHIPTest/app,examples/android/CHIPTool,examples/java-matter-controller/java,src/controller/java - - ktlint: - name: "Format check" - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-version: '17' - - - name: Download ktfmt - run: | - cd /tmp - wget "https://repo1.maven.org/maven2/com/facebook/ktfmt/0.44/ktfmt-0.44-jar-with-dependencies.jar" - - - name: Format kotlin files - run: | - find src examples -name '*.kt' \ - | xargs java -jar /tmp/ktfmt-0.44-jar-with-dependencies.jar --google-style - - - name: Ensure git works in current working directory - run: git config --global --add safe.directory `pwd` - - - name: Check for uncommited changes - run: | - git add . - # Show the full diff - git diff-index -p HEAD -- - # Also show just the files that are different, to make it easy - # to tell at a glance what might be going on. And throw in - # --exit-code to make this job fail if there is a difference. - git diff-index --exit-code HEAD -- diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml deleted file mode 100644 index 59f56fdb5407ae..00000000000000 --- a/.github/workflows/labeler.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: "Pull Request Labeler" -on: -- pull_request_target - -jobs: - triage: - name: Label Triage - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 15004c5aca5037..00000000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,347 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Lint Code Base - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: - ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -jobs: - code-lints: - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build:74 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - # Bootstrap and checkout for internal scripts (like idl_lint) - # to run - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Check for orphaned gn files - if: always() - # We should enforce that ALL new files are referenced in our build scripts. - # Several things do not have a clear fix path: - # - various platform implementations (including darwin-specific files as they - # are not using GN) - # - app/clusters (they are fetched dynamically - this should probably be fixed) - # - # All the rest of the exceptions should be driven down to 0: chip should fully - # be defined in build rules. - # - # This check enforces that for any newly added file, it must be part of some - # BUILD.gn file - run: | - ./scripts/run_in_build_env.sh "./scripts/tools/not_known_to_gn.py \ - src \ - --skip-dir app/clusters \ - --skip-dir darwin \ - --skip-dir include \ - --skip-dir platform/Ameba \ - --skip-dir platform/android \ - --skip-dir platform/ASR \ - --skip-dir platform/Beken \ - --skip-dir platform/bouffalolab \ - --skip-dir platform/cc13xx_26xx \ - --skip-dir platform/cc32xx \ - --skip-dir platform/Darwin \ - --skip-dir platform/ESP32 \ - --skip-dir platform/fake \ - --skip-dir platform/FreeRTOS \ - --skip-dir platform/Infineon \ - --skip-dir platform/Linux \ - --skip-dir platform/mbed \ - --skip-dir platform/mt793x \ - --skip-dir platform/nxp \ - --skip-dir platform/OpenThread \ - --skip-dir platform/qpg \ - --skip-dir platform/silabs \ - --skip-dir platform/telink \ - --skip-dir platform/webos \ - --skip-dir platform/Zephyr \ - --skip-dir test_driver \ - --skip-dir platform/NuttX \ - --known-failure app/app-platform/ContentApp.cpp \ - --known-failure app/app-platform/ContentApp.h \ - --known-failure app/app-platform/ContentAppPlatform.cpp \ - --known-failure app/app-platform/ContentAppPlatform.h \ - --known-failure controller/ExamplePersistentStorage.cpp \ - --known-failure controller/ExamplePersistentStorage.h \ - --known-failure app/AttributeAccessToken.h \ - --known-failure app/CommandResponseSender.h \ - --known-failure app/CommandSenderLegacyCallback.h \ - --known-failure app/ReadHandler.h \ - --known-failure app/reporting/reporting.cpp \ - --known-failure app/reporting/tests/MockReportScheduler.cpp \ - --known-failure app/reporting/tests/MockReportScheduler.h \ - --known-failure app/util/attribute-storage.cpp \ - --known-failure app/util/attribute-storage-detail.h \ - --known-failure app/util/attribute-storage.h \ - --known-failure app/util/attribute-table.cpp \ - --known-failure app/util/attribute-table-detail.h \ - --known-failure app/util/attribute-table.h \ - --known-failure app/util/binding-table.cpp \ - --known-failure app/util/binding-table.h \ - --known-failure app/util/config.h \ - --known-failure app/util/DataModelHandler.cpp \ - --known-failure app/util/DataModelHandler.h \ - --known-failure app/util/ember-compatibility-functions.cpp \ - --known-failure app/util/ember-compatibility-functions.h \ - --known-failure app/util/ember-global-attribute-access-interface.cpp \ - --known-failure app/util/ember-global-attribute-access-interface.h \ - --known-failure app/util/ember-io-storage.cpp \ - --known-failure app/util/ember-io-storage.h \ - --known-failure app/util/endpoint-config-api.h \ - --known-failure app/util/generic-callbacks.h \ - --known-failure app/util/generic-callback-stubs.cpp \ - --known-failure app/util/im-client-callbacks.h \ - --known-failure app/util/IMClusterCommandHandler.h \ - --known-failure app/util/util.cpp \ - --known-failure app/util/util.h \ - --known-failure app/WriteHandler.h \ - --known-failure platform/DeviceSafeQueue.cpp \ - --known-failure platform/DeviceSafeQueue.h \ - --known-failure platform/GLibTypeDeleter.h \ - --known-failure platform/SingletonConfigurationManager.cpp \ - " - - - name: Check for matter lint errors - if: always() - run: | - for idl_file in $(find . -name '*.matter'); do - # TODO: all these conformance failures should be fixed - # Issues exist for most of them: - # https://github.com/project-chip/connectedhomeip/issues/19176 - # https://github.com/project-chip/connectedhomeip/issues/19175 - # https://github.com/project-chip/connectedhomeip/issues/19173 - if [ "$idl_file" = './examples/log-source-app/log-source-common/log-source-app.matter' ]; then continue; fi - if [ "$idl_file" = './examples/placeholder/linux/apps/app1/config.matter' ]; then continue; fi - if [ "$idl_file" = './examples/placeholder/linux/apps/app2/config.matter' ]; then continue; fi - if [ "$idl_file" = './examples/thermostat/thermostat-common/thermostat.matter' ]; then continue; fi - if [ "$idl_file" = './examples/window-app/common/window-app.matter' ]; then continue; fi - # Example is intentionally not spe compliant for use in cert testing - if [ "$idl_file" = './examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter' ]; then continue; fi - - # Test files are intentionally small and not spec-compilant, just parse-compliant - if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/cluster_struct_attribute.matter" ]; then continue; fi - if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/global_struct_attribute.matter" ]; then continue; fi - if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/optional_argument.matter" ]; then continue; fi - if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/several_clusters.matter" ]; then continue; fi - if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/simple_attribute.matter" ]; then continue; fi - if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/large_lighting_app.matter" ]; then continue; fi - if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter" ]; then continue; fi - - ./scripts/run_in_build_env.sh "./scripts/idl_lint.py --log-level warn $idl_file" >/dev/null || exit 1 - done - - - name: Check broken links - # On-push disabled until the job can run fully green - # At that point the step should be enabled. - if: github.event_name == 'workflow_dispatch' - uses: gaurav-nelson/github-action-markdown-link-check@v1 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: Check for incorrect error use in VerifyOrExit - if: always() - run: | - git grep -I -n "VerifyOrExit(.*, [A-Za-z]*_ERROR" -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: - Check for use of PRI*8, which are not supported on some libcs. - if: always() - run: | - git grep -I -n "PRI.8" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: - Check for use of PRI*16, which are not supported on some - libcs. - if: always() - run: | - git grep -I -n "PRI.16" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: - Check for use of PRI*64, which are not supported on some - libcs. - if: always() - run: | - # TODO: MessageDefHelper should ideally not be excluded here. - # TODO: chip_im_initiatore should ideally not be excluded here. - # TODO: TLVDebug should ideally not be excluded here. - # TODO: protocol_decoder.cpp should ideally not be excluded here. - # TODO: PersistentStorageMacros.h should ideally not be excluded here. - git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/Darwin' ':(exclude)src/darwin' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' ':(exclude)src/platform/NuttX' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: Check for use of %zu, which are not supported on some libcs. - if: always() - run: | - git grep -I -n "%zu" -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 - - # Comments like '{{! ... }}' should be used in zap files - - name: Do not allow TODO in generated files - if: always() - run: | - git grep -n 'TODO:' -- ./zzz_generated './*/zap-generated/*' && exit 1 || exit 0 - - - name: Check for disallowed include files - if: always() - run: scripts/tools/check_includes.sh - - - name: Check for zcl.json and extension sync status - if: always() - run: scripts/tools/check_zcl_file_sync.py . - - - name: Ensure all PICS are set for tests (to true or false) - if: always() - run: | - scripts/tools/check_test_pics.py src/app/tests/suites/certification/ci-pics-values src/app/tests/suites/certification/PICS.yaml - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: - Check for use of 0x%u and the like, which lead to misleading - output. - if: always() - run: | - git grep -I -n '0x%[0-9l.*-]*[^xX"0-9l.*-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: - Check for use of '"0x" PRIu*' and the like, which lead to - misleading output. - if: always() - run: | - git grep -I -n '0x%[0-9-]*" *PRI[^xX]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. - - name: - Check for use of NSLog instead of Matter logging in Matter - framework - if: always() - run: | - git grep -n 'NSLog(' -- src/darwin/Framework/CHIP && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself, as well as excluding the files - # that implement the type-safe accessors - - name: - Check for use of 'emberAfReadAttribute' instead of the - type-safe getters - if: always() - run: | - git grep -I -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/attribute-table.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself, as well as excluding the files - # that implement the type-safe accessors, attribute writing from the wire, and some - # Pigweed RPC code that seems hard to update. - - name: - Check for use of 'emberAfWriteAttribute' instead of the - type-safe setters - if: always() - run: | - git grep -I -n 'emberAfWriteAttribute' -- './*' \ - ':(exclude).github/workflows/lint.yml' \ - ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' \ - ':(exclude)src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp' \ - ':(exclude)src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp' \ - ':(exclude)src/app/util/attribute-table.cpp' \ - ':(exclude)src/app/util/attribute-table.h' \ - ':(exclude)src/app/util/ember-compatibility-functions.cpp' \ - ':(exclude)src/app/util/mock/CodegenEmberMocks.cpp' \ - ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' \ - ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' \ - && exit 1 || exit 0 - - # Run ruff python linter - - name: Check for errors using ruff Python linter - if: always() - run: | - ruff check - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: - Check for use of "SuccessOrExit(CHIP_ERROR_*)", which should - probably be "SuccessOrExit(err = CHIP_ERROR_*)" - if: always() - run: | - git grep -I -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. And we want to exclude this file, - # to avoid our grep regexp matching itself. - - name: - Check for use of - "SuccessOrExit(something-without-assignment(", which should - probably be "SuccessOrExit(err = something(" - if: always() - run: | - git grep -I -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 - - # git grep exits with 0 if it finds a match, but we want - # to fail (exit nonzero) on match. - - name: - Check for use of "using namespace" outside of a class/function - in headers. - if: always() - run: | - # Various platforms have `using namespace chip::Ble` in their BLEManager* headers; just exclude those for now. - # - # Exclude platform openiotsdk bits that do this in their persistent storage header. - # - # Also exclude examples (for now) and third_party, which have various instances of this. - # - # Ignore uses of `System::Clock::Literals`, because that's the only way to have things using _ms32 or whatnot - # in a header file. - git grep -I -n -e '^using namespace' --and --not -e 'System::Clock::Literals' -- './**/*.h' ':(exclude)src/platform/*/BLEManager*.h' ':(exclude)src/platform/openiotsdk/KVPsaPsStore.h' ':(exclude)./examples' ':(exclude)./third_party' && exit 1 || exit 0 diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml deleted file mode 100644 index 9ba9565b44c25b..00000000000000 --- a/.github/workflows/minimal-build.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# 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. - -name: Minimal Build (Linux / configure) - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -jobs: - minimal-all-clusters: - name: Linux / configure build of all-clusters-app - - if: github.actor != 'restyled-io[bot]' - runs-on: ubuntu-latest - - container: - image: ghcr.io/project-chip/chip-build-minimal:74 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Checkout submodules # but don't bootstrap! - uses: ./.github/actions/checkout-submodules - with: - platform: linux - - - name: Configure and build All Clusters App - run: | - CC=gcc CXX=g++ scripts/configure --project=examples/all-clusters-app/linux && ./ninja-build - - minimal-network-manager: - name: Linux / configure build of network-manager-app - - if: github.actor != 'restyled-io[bot]' - runs-on: ubuntu-latest - - container: - image: ghcr.io/project-chip/chip-build-minimal:74 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Checkout submodules # but don't bootstrap! - uses: ./.github/actions/checkout-submodules - with: - platform: linux - - - name: Configure and build Network Manager App - run: | - CC=gcc CXX=g++ scripts/configure --project=examples/network-manager-app/linux && ./ninja-build diff --git a/.github/workflows/protocol_compatibility.yaml b/.github/workflows/protocol_compatibility.yaml deleted file mode 100644 index 6c8960072ec3be..00000000000000 --- a/.github/workflows/protocol_compatibility.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Backwards compatibility check -on: - pull_request: - paths: - - "src/controller/data_model/controller-clusters.matter" - -jobs: - check_clusters_matter: - name: Check controller-clusters.matter backwards compatibility - runs-on: ubuntu-latest - if: github.event.pull_request && !(contains(github.event.pull_request.labels.*.name, 'skip-protocol-compatibility')) - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install click coloredlogs lark - - name: Create old/new copies - run: | - mkdir -p out - cp src/controller/data_model/controller-clusters.matter out/new_version.matter - wget '${{github.event.pull_request.diff_url}}' --output-document out/patch.diff - patch -p1 --reverse /dev/null || (sudo apt update && sudo apt install curl -y) - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ - && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ - && sudo apt update \ - && sudo apt install gh -y - - - name: Tag Release & Generate Notes - env: - GH_TOKEN: ${{ github.token }} - run: | - export BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) - echo "Tagging against branch: $BRANCH_NAME" - ./scripts/tagging/tag_new_release.sh --generate-notes --target "$BRANCH_NAME" -d # Note this is a draft for now. - - diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml deleted file mode 100644 index 3a9bca19317216..00000000000000 --- a/.github/workflows/tests.yaml +++ /dev/null @@ -1,629 +0,0 @@ -# Copyright (c) 2020-2021 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. - -name: Tests - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - test_suites_linux: - name: Test Suites - Linux - - strategy: - matrix: - build_variant: [no-ble-tsan-clang] - chip_tool: [""] - env: - BUILD_VARIANT: ${{matrix.build_variant}} - CHIP_TOOL_VARIANT: ${{matrix.chip_tool}} - TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt" - LSAN_OPTIONS: detect_leaks=1 - - if: github.actor != 'restyled-io[bot]' - runs-on: ubuntu-latest - - container: - image: ghcr.io/project-chip/chip-build:74 - options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" - - steps: - - name: Checkout - uses: actions/checkout@v4 - # To use act like: - # act -j test_suites_linux - # - # Note you likely still need to have non submodules setup for the - # local machine, like: - # git submodule deinit --all - - uses: actions/checkout@v4 - if: ${{ env.ACT }} - name: Checkout (ACT for local build) - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} - - name: Try to ensure the directories for core dumping exist and we - can write them. - run: | - mkdir /tmp/cores || true - sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true - mkdir objdir-clone || true - - - name: Validate that xml are parsable - # The sub-items being run here are the same as the input XMLs listed - # at src/app/zap-templates/zcl/zcl.json - # - # This ensures that the syntax of the XML can always be parsed/validated, however it - # does not enforce that the content is understood (that part is covered by parser - # unit tests) - # - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/py_matter_idl/matter_idl/zapxml_parser.py \ - --no-print \ - --log-level info \ - src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \ - src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml \ - src/app/zap-templates/zcl/data-model/chip/global-enums.xml \ - src/app/zap-templates/zcl/data-model/chip/global-structs.xml \ - src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml \ - src/app/zap-templates/zcl/data-model/chip/access-control-definitions.xml \ - src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/air-quality-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml \ - src/app/zap-templates/zcl/data-model/chip/chip-ota.xml \ - src/app/zap-templates/zcl/data-model/chip/chip-types.xml \ - src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml \ - src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/commissioner-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/measurement-and-sensing.xml \ - src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/ecosystem-information-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/fault-injection-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \ - src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/laundry-dryer-controls-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/operational-state-oven-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/proxy-configuration-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/proxy-discovery-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml \ - src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/scene.xml \ - src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/test-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/thread-network-directory-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/window-covering.xml \ - src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/matter-devices.xml \ - src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml \ - src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml \ - " - - name: Build Apps - run: | - scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \ - --target linux-x64-all-clusters-${BUILD_VARIANT} \ - --target linux-x64-lock-${BUILD_VARIANT} \ - --target linux-x64-ota-provider-${BUILD_VARIANT} \ - --target linux-x64-ota-requestor-${BUILD_VARIANT} \ - --target linux-x64-tv-app-${BUILD_VARIANT} \ - --target linux-x64-bridge-${BUILD_VARIANT} \ - --target linux-x64-lit-icd-${BUILD_VARIANT} \ - --target linux-x64-microwave-oven-${BUILD_VARIANT} \ - --target linux-x64-rvc-${BUILD_VARIANT} \ - --target linux-x64-network-manager-${BUILD_VARIANT} \ - build \ - --copy-artifacts-to objdir-clone \ - " - - - name: Run Tests using the python parser sending commands to chip-tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/tests/run_test_suite.py \ - --runner chip_tool_python \ - --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ - run \ - --iterations 1 \ - --test-timeout-seconds 120 \ - --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ - --lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \ - --ota-provider-app ./out/linux-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ - --ota-requestor-app ./out/linux-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ - --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ - --bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ - --lit-icd-app ./out/linux-x64-lit-icd-${BUILD_VARIANT}/lit-icd-app \ - --microwave-oven-app ./out/linux-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ - --rvc-app ./out/linux-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ - --network-manager-app ./out/linux-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ - " - - - name: Run purposeful failure tests using the python parser sending commands to chip-tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/tests/run_test_suite.py \ - --runner chip_tool_python \ - --include-tags PURPOSEFUL_FAILURE \ - --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ - run \ - --iterations 1 \ - --expected-failures 3 \ - --keep-going \ - --test-timeout-seconds 120 \ - --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ - " - - - name: Run Tests using chip-repl (skip slow) - if: github.event_name == 'pull_request' - run: | - ./scripts/run_in_python_env.sh out/venv \ - "./scripts/tests/run_test_suite.py \ - --runner chip_repl_python \ - --exclude-tags MANUAL \ - --exclude-tags FLAKY \ - --exclude-tags IN_DEVELOPMENT \ - --exclude-tags EXTRA_SLOW \ - --exclude-tags SLOW \ - --exclude-tags PURPOSEFUL_FAILURE \ - run \ - --iterations 1 \ - --test-timeout-seconds 120 \ - --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ - --lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \ - --ota-provider-app ./out/linux-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ - --ota-requestor-app ./out/linux-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ - --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ - --bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ - --lit-icd-app ./out/linux-x64-lit-icd-${BUILD_VARIANT}/lit-icd-app \ - --microwave-oven-app ./out/linux-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ - --rvc-app ./out/linux-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ - --network-manager-app ./out/linux-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ - " - - name: Run Tests using chip-repl (including slow) - if: github.event_name == 'push' - run: | - ./scripts/run_in_python_env.sh out/venv \ - "./scripts/tests/run_test_suite.py \ - --runner chip_repl_python \ - run \ - --iterations 1 \ - --test-timeout-seconds 120 \ - --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ - --lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \ - --ota-provider-app ./out/linux-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ - --ota-requestor-app ./out/linux-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ - --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ - --bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ - --lit-icd-app ./out/linux-x64-lit-icd-${BUILD_VARIANT}/lit-icd-app \ - --microwave-oven-app ./out/linux-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ - --rvc-app ./out/linux-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ - --network-manager-app ./out/linux-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ - " - - name: Uploading core files - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} - path: /tmp/cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 - - test_suites_darwin: - name: Test Suites - Darwin - - strategy: - matrix: - build_variant: [no-ble-asan-clang, no-ble-tsan-clang] - chip_tool: [""] - env: - BUILD_VARIANT: ${{matrix.build_variant}} - CHIP_TOOL_VARIANT: ${{matrix.chip_tool}} - TSAN_OPTIONS: "halt_on_error=1" - LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt - - if: github.actor != 'restyled-io[bot]' - runs-on: macos-13 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Environment - # coreutils for stdbuf - run: brew install coreutils - - name: - Try to ensure the directories for core dumping and diagnostic - log collection exist and we can write them. - run: | - sudo chown ${USER} /cores || true - mkdir -p ~/Library/Logs/DiagnosticReports || true - mkdir objdir-clone || true - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: darwin - bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} - - - - name: Build Apps - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \ - --target darwin-x64-all-clusters-${BUILD_VARIANT} \ - --target darwin-x64-lock-${BUILD_VARIANT} \ - --target darwin-x64-ota-provider-${BUILD_VARIANT} \ - --target darwin-x64-ota-requestor-${BUILD_VARIANT} \ - --target darwin-x64-tv-app-${BUILD_VARIANT} \ - --target darwin-x64-bridge-${BUILD_VARIANT} \ - --target darwin-x64-lit-icd-${BUILD_VARIANT} \ - --target darwin-x64-microwave-oven-${BUILD_VARIANT} \ - --target darwin-x64-rvc-${BUILD_VARIANT} \ - --target darwin-x64-network-manager-${BUILD_VARIANT} \ - build \ - --copy-artifacts-to objdir-clone \ - " - - - name: Run Tests using the python parser sending commands to chip-tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/tests/run_test_suite.py \ - --runner chip_tool_python \ - --chip-tool ./out/darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ - --target-skip-glob '{Test_TC_DGTHREAD_2_1,Test_TC_DGTHREAD_2_2,Test_TC_DGTHREAD_2_3,Test_TC_DGTHREAD_2_4}' \ - run \ - --iterations 1 \ - --test-timeout-seconds 120 \ - --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ - --lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \ - --ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ - --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ - --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ - --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ - --lit-icd-app ./out/darwin-x64-lit-icd-${BUILD_VARIANT}/lit-icd-app \ - --microwave-oven-app ./out/darwin-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ - --rvc-app ./out/darwin-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ - --network-manager-app ./out/darwin-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ - " - - - name: Run purposeful failure tests using the python parser sending commands to chip-tool - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/tests/run_test_suite.py \ - --runner chip_tool_python \ - --include-tags PURPOSEFUL_FAILURE \ - --chip-tool ./out/darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ - run \ - --iterations 1 \ - --expected-failures 3 \ - --keep-going \ - --test-timeout-seconds 120 \ - --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ - " - - - name: Uploading core files - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} - path: /cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - - name: Uploading diagnostic logs - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-log-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} - path: ~/Library/Logs/DiagnosticReports/ - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 - - repl_tests_linux: - name: REPL Tests - Linux - - env: - TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt" - - if: github.actor != 'restyled-io[bot]' - runs-on: ubuntu-latest - - container: - image: ghcr.io/project-chip/chip-build:74 - options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} - - name: Try to ensure the directories for core dumping exist and we - can write them. - run: | - mkdir /tmp/cores || true - sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true - mkdir objdir-clone || true - - - name: Build Python REPL and example apps - # NOTE: the data-mode-check + check-failure-die is not 100% perfect as different - # encoding sizes for data that keeps changing may alter over time (e.g. anything relating to time - # or resources such as packet counts or other similar counters) - # - # This may result in invalid errors, however for most purposes of our testing, we are unlikely to - # hit such cases so we remain very strict on testing here. - run: | - scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die \ - --target linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test \ - --target linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test \ - --target linux-x64-energy-management-ipv6only-no-ble-no-wifi-tsan-clang-test \ - --target linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test \ - --target linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test \ - --target linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test \ - --target linux-x64-fabric-admin-rpc-ipv6only-clang \ - --target linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang \ - --target linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang \ - --target linux-x64-python-bindings \ - build \ - --copy-artifacts-to objdir-clone \ - " - - name: Generate an argument environment file - run: | - echo -n "" >/tmp/test_env.yaml - echo "ALL_CLUSTERS_APP: out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die/chip-all-clusters-app" >> /tmp/test_env.yaml - echo "CHIP_LOCK_APP: out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app" >> /tmp/test_env.yaml - echo "ENERGY_MANAGEMENT_APP: out/linux-x64-energy-management-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-energy-management-app" >> /tmp/test_env.yaml - echo "LIT_ICD_APP: out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app" >> /tmp/test_env.yaml - echo "CHIP_MICROWAVE_OVEN_APP: out/linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-microwave-oven-app" >> /tmp/test_env.yaml - echo "CHIP_RVC_APP: out/linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-rvc-app" >> /tmp/test_env.yaml - echo "NETWORK_MANAGEMENT_APP: out/linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test/matter-network-manager-app" >> /tmp/test_env.yaml - echo "FABRIC_ADMIN_APP: out/linux-x64-fabric-admin-rpc-ipv6only-clang/fabric-admin" >> /tmp/test_env.yaml - echo "FABRIC_BRIDGE_APP: out/linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang/fabric-bridge-app" >> /tmp/test_env.yaml - echo "LIGHTING_APP_NO_UNIQUE_ID: out/linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang/chip-lighting-app" >> /tmp/test_env.yaml - echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml - echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml - echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml - - - name: Run Tests - run: | - mkdir -p out/trace_data - scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/execute_python_tests.py --env-file /tmp/test_env.yaml --search-directory src/python_testing' - scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die/chip-all-clusters-app' - scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_ICDM_2_1.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestChoiceConformanceSupport.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_SC_7_1.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/TestDecorators.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestMatterTestingSupport.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py' - - - - name: Uploading core files - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-linux-python-repl - path: /tmp/cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-linux-python-repl - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 - - repl_tests_darwin: - name: REPL Tests - Darwin - - strategy: - matrix: - build_variant: [no-ble-no-wifi-tsan-clang] - env: - BUILD_VARIANT: ${{matrix.build_variant}} - TSAN_OPTIONS: "halt_on_error=1" - - if: github.actor != 'restyled-io[bot]' && false - runs-on: macos-13 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Environment - # coreutils for stdbuf - run: brew install coreutils - - name: - Try to ensure the directories for core dumping and diagnostic - log collection exist and we can write them. - run: | - sudo chown ${USER} /cores || true - mkdir -p ~/Library/Logs/DiagnosticReports || true - mkdir objdir-clone || true - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: darwin - bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} - - - name: Build Python REPL and example apps - run: | - scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target darwin-x64-all-clusters-${BUILD_VARIANT}-test \ - build \ - --copy-artifacts-to objdir-clone \ - " - - name: Run Tests - run: | - scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --quiet --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' - - name: Uploading core files - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-darwin-python-repl - path: /cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - - name: Uploading traces on failure - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: trace-data-python-repl - path: out/trace_data/ - retention-days: 5 - - name: Uploading diagnostic logs - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-log-darwin-python-repl - path: ~/Library/Logs/DiagnosticReports/ - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-darwin-python-repl - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 diff --git a/.github/workflows/third-party-check.yaml b/.github/workflows/third-party-check.yaml deleted file mode 100644 index beda0af41b0622..00000000000000 --- a/.github/workflows/third-party-check.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2024 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. - -name: Check for Unintentional Submodule Updates - -on: - pull_request: - branches-ignore: - - "dependabot/**" - paths: - - "third_party/**" - - ".gitmodules" - -jobs: - check-submodule-update-label: - name: Check For Submodule Update Label - runs-on: ubuntu-latest - steps: - - if: ${{ !contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') }} - name: Fail - run: | - echo This pull request attempts to update submodules without the changing-submodules-on-purpose label. Please apply that label if the changes are intentional, or remove those changes. - exit 1 - - if: ${{ contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') }} - name: Success - run: | - echo PR looks good. - exit 0 diff --git a/.github/workflows/todos.yaml b/.github/workflows/todos.yaml deleted file mode 100644 index cc2148da4e6d18..00000000000000 --- a/.github/workflows/todos.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Create issues from To-Dos - -on: - workflow_dispatch: - inputs: - importAll: - default: "false" - required: false - type: boolean - description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing. -# push: Will move this to a cadence -# branches: -# - master - -permissions: - issues: write - repository-projects: read - contents: read - -jobs: - todos: - name: Scan for To-Dos - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Run Issue Bot - uses: derjuulsn/todo-issue@main - with: - # autoAssign: false - reopenClosed: false - # label: "todo" - # disabled until this works: https://github.com/DerJuulsn/todo-issue/issues/9 - keywords: "todo,fixme,bug,TODO,FIXME,BUG" - excludePattern: "^(node_modules/|third_party/|zzz_generated/|docs/|.vscode/)" - env: - GITHUB_TOKEN: ${{ secrets.MATTER_PAT }} diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml deleted file mode 100644 index 040e50f1535079..00000000000000 --- a/.github/workflows/unit_integration_test.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# 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. - -name: Unit / Integration Tests - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -jobs: - unit_tests: - name: Unit / Integration Tests - if: github.actor != 'restyled-io[bot]' - - strategy: - matrix: - type: [main, clang, mbedtls, rotating_device_id, icd] - env: - BUILD_TYPE: ${{ matrix.type }} - - runs-on: ubuntu-latest - - container: - image: ghcr.io/project-chip/chip-build:74 - volumes: - - "/:/runner-root-volume" - - "/tmp/log_output:/tmp/test_logs" - options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - bootstrap-log-name: bootstrap-logs-unittest-${{ matrix.type }} - - name: Artifact suffix - id: outsuffix - uses: haya14busa/action-cond@v1 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - name: Setup Build - # TODO: If rotating_device_id is ever removed/combined, we have to cover boringssl otherwise - run: | - case $BUILD_TYPE in - "main") GN_ARGS='';; - "clang") GN_ARGS='is_clang=true';; - "mbedtls") GN_ARGS='chip_crypto="mbedtls"';; - "rotating_device_id") GN_ARGS='chip_crypto="boringssl" chip_enable_rotating_device_id=true';; - "icd") GN_ARGS='chip_enable_icd_server=true chip_enable_icd_lit=true';; - *) ;; - esac - - scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" - - name: Run Build - run: scripts/run_in_build_env.sh "ninja -C out/$BUILD_TYPE" - - name: Run Tests - run: scripts/tests/gn_tests.sh - # TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227 - # TODO https://github.com/project-chip/connectedhomeip/issues/1512 - # - name: Run Code Coverage - # if: ${{ contains('main', env.BUILD_TYPE) }} - # run: scripts/tools/codecoverage.sh - # - name: Upload Code Coverage - # if: ${{ contains('main', env.BUILD_TYPE) }} - # run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml deleted file mode 100644 index dca68cc94e88ad..00000000000000 --- a/.github/workflows/zap_regeneration.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# 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. - -name: ZAP - Regenerate - -on: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - zap_regeneration: - name: ZAP Regeneration - - runs-on: ubuntu-20.04 - container: - image: ghcr.io/project-chip/chip-build:74 - defaults: - run: - shell: sh - if: github.actor != 'restyled-io[bot]' - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - - - name: Generate all - run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py - - uses: EndBug/add-and-commit@v9 - with: - default_author: github_actions - message: Regenerating ZAP diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml deleted file mode 100644 index 5ed20b29ada3d6..00000000000000 --- a/.github/workflows/zap_templates.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# 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. - -name: ZAP - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - zap_templates: - name: ZAP templates generation - - runs-on: ubuntu-20.04 - container: - image: ghcr.io/project-chip/chip-build:74 - defaults: - run: - shell: sh - if: github.actor != 'restyled-io[bot]' - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux - # Java formatting requires a newer java to run ktfmt - # TODO: this should be eventually inside Docker files - - name: Update java - run: | - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing openjdk-17-jre - # Clean out java generated files: since java codegen will generate one file per - # structure/cluster, if clusters and structures are ever changed (for in progress work) - # this may leave obsolete files. Ensure we always check for clean regen. - - name: Ensure clean java - run: rm -rf src/controller/java/generated/ - - name: Generate all - run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py - - name: Generate script-maintained items (ERROR_CODES.md) - run: ./scripts/run_in_build_env.sh "scripts/error_table.py > docs/ERROR_CODES.md" - - name: Ensure git works in current working directory - run: git config --global --add safe.directory `pwd` - - name: Check for uncommited changes - run: | - git add . - # Show the full diff - git diff-index -p HEAD -- - # Also show just the files that are different, to make it easy - # to tell at a glance what might be going on. And throw in - # --exit-code to make this job fail if there is a difference. - git diff-index --exit-code HEAD -- diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py index f44667242de807..73a33e4f0e8694 100755 --- a/build/config/linux/pkg-config.py +++ b/build/config/linux/pkg-config.py @@ -142,6 +142,8 @@ def main(): dest='dridriverdir') parser.add_option('--version-as-components', action='store_true', dest='version_as_components') + parser.add_option('--static', action='store_true', + dest='static') (options, args) = parser.parse_args() # Make a list of regular expressions to strip out. @@ -203,7 +205,13 @@ def main(): sys.stdout.write(dridriverdir.strip()) return - cmd = [options.pkg_config, "--cflags", "--libs"] + args + cmd = [options.pkg_config, "--cflags", "--libs"] + + if options.static: + cmd.append("--static") + + cmd.extend(args) + if options.debug: sys.stderr.write('Running: %s\n' % ' '.join(cmd)) diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni index d6892d97fb976f..04419ecee24260 100644 --- a/build/config/linux/pkg_config.gni +++ b/build/config/linux/pkg_config.gni @@ -137,10 +137,19 @@ template("pkg_config") { # Link libraries statically for OSS-Fuzz fuzzer build if (oss_fuzz) { + # Output libs needed for static linking (direct + transitive/non-direct libs), we will re-execute the script to get those libs + args += [ "--static" ] + pkgresult_static = exec_script(pkg_config_script, args, "value") libs = [] ldflags = [ "-Wl,-Bstatic" ] - foreach(lib, pkgresult[3]) { - ldflags += [ "-l$lib" ] + foreach(lib, pkgresult_static[3]) { + # dl(dynamic loading) lib is not needed for linking statically and its presence triggers errors. + # example of errors: + # ld.lld: error: undefined symbol: __dlsym + # >>> referenced by dlsym.o:(dlsym) in archive /lib/x86_64-linux-gnu/libdl.a + if (lib != "dl") { + ldflags += [ "-l$lib" ] + } } ldflags += [ "-Wl,-Bdynamic" ] lib_dirs = pkgresult[4] diff --git a/config/recommended.gni b/config/recommended.gni new file mode 100644 index 00000000000000..a30045ced7814e --- /dev/null +++ b/config/recommended.gni @@ -0,0 +1,31 @@ +# Copyright (c) 2024 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. + +declare_args() { + # Note for SDK developers: As additional features with their own settings + # are added to the SDK, consider using the `matter_enable_recommended` + # meta-setting instead of a default value of 'true', especially where a + # different default is used based on platform (current_os): Often various + # debugging features have previously been defaulted to on for Linux and/or + # Mac but off for embedded platforms (on the assumption that Linux / Mac + # don't have resource constraints?); build settings of that nature should + # instead reference this meta-setting. E.g. + # enable_flux_capacitor = matter_enable_recommended && current_os == "linux" + + # Enable recommended settings by default. This is a meta-setting + # that is enabled by default, and acts as a default for various + # other settings. Setting it to false produces a more conservative / + # minimal set of defaults. + matter_enable_recommended = true +} diff --git a/docs/cluster_and_device_type_dev/how_to_add_new_dts_and_clusters.md b/docs/cluster_and_device_type_dev/how_to_add_new_dts_and_clusters.md index 8d73a257c28996..90d82c60310a90 100644 --- a/docs/cluster_and_device_type_dev/how_to_add_new_dts_and_clusters.md +++ b/docs/cluster_and_device_type_dev/how_to_add_new_dts_and_clusters.md @@ -17,10 +17,9 @@ directory:** 1. [.github/workflows/tests.yaml](https://github.com/project-chip/connectedhomeip/tree/master/.github/workflows/tests.yaml) 2. [scripts/rules.matterlint](https://github.com/project-chip/connectedhomeip/tree/master/scripts/rules.matterlint) -3. [src/app/zap-templates/zcl/data-model/all.xml](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/data-model/all.xml) -4. [src/app/zap-templates/zcl/zcl-with-test-extensions.json](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/zcl-with-test-extensions.json) -5. [src/app/zap-templates/zcl/zcl.json](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/zcl.json) -6. If it is a derived cluster, add a reference to the base cluster definition. +3. [src/app/zap-templates/zcl/zcl-with-test-extensions.json](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/zcl-with-test-extensions.json) +4. [src/app/zap-templates/zcl/zcl.json](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/zcl.json) +5. If it is a derived cluster, add a reference to the base cluster definition. (e.g. in mode-base-cluster.xml you may need to add cluster codes - otherwise you may get strange exceptions which aren't clear when running regen_all.py) @@ -31,7 +30,7 @@ directory:** > > ``` -7. [src/controller/python/chip/clusters/\_\_init\_\_.py](https://github.com/project-chip/connectedhomeip/tree/master/src/controller/python/chip/clusters/__init__.py) +6. [src/controller/python/chip/clusters/\_\_init\_\_.py](https://github.com/project-chip/connectedhomeip/tree/master/src/controller/python/chip/clusters/__init__.py) **Enable your new cluster in the Python and Android clients** in [src/controller/data_model/controller-clusters.zap](https://github.com/project-chip/connectedhomeip/blob/master/src/controller/data_model/controller-clusters.zap) diff --git a/docs/guides/nxp/nxp_manufacturing_flow.md b/docs/guides/nxp/nxp_manufacturing_flow.md index cb8431cc3b3083..0551d43966f08e 100644 --- a/docs/guides/nxp/nxp_manufacturing_flow.md +++ b/docs/guides/nxp/nxp_manufacturing_flow.md @@ -132,6 +132,7 @@ Here is the interpretation of the **optional** parameters: --unique_id -> Unique id used for rotating device id generation --product_finish -> Visible finish of the product --product_primary_color -> Representative color of the visible parts of the product +--hw_params -> Use application factory data from Hardware Parameters component ``` ## 3. Write provisioning data @@ -144,15 +145,12 @@ DK6Programmer.exe -Y -V2 -s -P 1000000 -Y -p FLASH@0x9D600="factory_d ``` For **K32W1** platform, the binary needs to be written in the internal flash at -location given by `__MATTER_FACTORY_DATA_START`, using `JLink`: +location given by **0xFE080**, using `JLink`: ``` -loadfile factory_data.bin 0xf4000 +loadfile factory_data.bin 0xFE080 ``` -where `0xf4000` is the value of `__MATTER_FACTORY_DATA_START` in the -corresponding .map file (can be different if using a custom linker script). - For **RW61X** platform, the binary needs to be written in the internal flash at location given by `__MATTER_FACTORY_DATA_START`, using `JLink`: @@ -208,7 +206,7 @@ Also, demo **DAC**, **PAI** and **PAA** certificates needed in case Supported platforms: -- K32W1 - `src/plaftorm/nxp/k32w/k32w1/FactoryDataProviderImpl.h` +- K32W1 - `src/plaftorm/nxp/k32w1/FactoryDataProviderImpl.h` For platforms that have a secure subsystem (`SSS`), the DAC private key can be converted to an encrypted blob. This blob will overwrite the DAC private key in @@ -219,6 +217,12 @@ The application will check at initialization whether the DAC private key has been converted or not and convert it if needed. However, the conversion process should be done at manufacturing time for security reasons. +Reference factory data generation command: + +```shell +python3 ./scripts/tools/nxp/factory_data_generator/generate.py -i 10000 -s UXKLzwHdN3DZZLBaL2iVGhQi/OoQwIwJRQV4rpEalbA= -p 14014 -d 1000 --vid "0x1037" --pid "0xA221" --vendor_name "NXP Semiconductors" --product_name "Lighting app" --serial_num "12345678" --date "2023-01-01" --hw_version 1 --hw_version_str "1.0" --cert_declaration ./Chip-Test-CD-1037-A221.der --dac_cert ./Chip-DAC-NXP-1037-A221-Cert.der --dac_key ./Chip-DAC-NXP-1037-A221-Key.der --pai_cert ./Chip-PAI-NXP-1037-A221-Cert.der --spake2p_path ./out/spake2p --unique_id "00112233445566778899aabbccddeeff" --hw_params --out ./factory_data.bin +``` + There is no need for an extra binary. - Write factory data binary. diff --git a/docs/testing/fuzz_testing.md b/docs/testing/fuzz_testing.md index b7faeae463a10e..7660e18032ef9a 100644 --- a/docs/testing/fuzz_testing.md +++ b/docs/testing/fuzz_testing.md @@ -7,13 +7,119 @@ thousands of different inputs. - Fuzz testing is often done with sanitizers enabled; to catch memory errors and undefined behavior. -- The most commonly used fuzz testing frameworks for C/C++ are LibFuzzer and +- The most commonly used fuzz testing frameworks for C/C++ are libFuzzer and AFL. - [Google's FuzzTest](https://github.com/google/fuzztest) is a newer framework that simplifies writing fuzz tests with user-friendly APIs and offers more control over input generation. It also integrates seamlessly with Google Test (GTest). +## Fuzz testing with libFuzzer + +The following example demonstrates how to use libFuzzer to write a simple fuzz +test. Each fuzzer function is defined using +`LLVMFuzzerTestOneInput(const uint8_t * data, size_t len)`. + +The Fuzzer must be located in a Test Folder : `src/some_directory/tests/` + +``` +#include +#include + +/** + * @file + * This file describes a Fuzzer for ... + */ + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t * data, size_t len) +{ + + // Instantiate values as needed + // Call target function for the fuzzer with the fuzzing input (data and len) + + return 0; +} + +``` + +See +[FuzzBase38Decode.cpp](https://github.com/project-chip/connectedhomeip/blob/master/src/setup_payload/tests/FuzzBase38Decode.cpp) +for an example of a simple fuzz test. + +### Compiling and running + +- Add to `src/some_directory/tests/BUILD.gn` + + - Example + + ``` + import("${chip_root}/build/chip/fuzz_test.gni") + + if (enable_fuzz_test_targets) { + chip_fuzz_target("FuzzTargetName1") { + sources = [ "Fuzzer1.cpp" ] + public_deps = [ + // Dependencies go here. + ] + } + chip_fuzz_target("FuzzTargetName2") { + sources = [ "Fuzzer2.cpp" ] + public_deps = [ + // Dependencies go here. + ] + } + } + ``` + + - CHIP_FUZZ_TARGET : the name of the fuzz target + - SOURCES : file in the test folder containing the fuzzer + implementation + - PUBLIC_DEPS : Code Dependencies needed to build fuzzer + + - Another example: + [src/setup_payload/tests/BUILD.gn](https://github.com/project-chip/connectedhomeip/blob/b367512f519e5e109346e81a0d84fd85cd9192f7/src/setup_payload/tests/BUILD.gn#L43) + +- Add to `src/BUILD.gn` + + - Add the Fuzzing Target in this part of the code : + [src/BUILD.gn](https://github.com/project-chip/connectedhomeip/blob/b367512f519e5e109346e81a0d84fd85cd9192f7/BUILD.gn#L52) + + - Add Fuzzing Target like that + + ``` + if (enable_fuzz_test_targets) { + group("fuzz_tests") { + deps = [ + "${chip_root}/src/credentials/tests:fuzz-chip-cert", + "${chip_root}/src/lib/core/tests:fuzz-tlv-reader", + "${chip_root}/src/lib/dnssd/minimal_mdns/tests:fuzz-minmdns-packet-parsing", + "${chip_root}/src/lib/format/tests:fuzz-payload-decoder", + "${chip_root}/src/setup_payload/tests:fuzz-setup-payload-base38", + "${chip_root}/src/setup_payload/tests:fuzz-setup-payload-base38-decode", + // ADD HERE YOUR FUZZING TARGET + "${chip_root}/some_directory/tests:FuzzTargetName" + ] + } + } + ``` + +- Build all fuzzers + ``` + ./scripts/build/build_examples.py --target --tests-asan-libfuzzer-clang build + ``` + e.g. + ``` + ./scripts/build/build_examples.py --target darwin-arm64-tests-asan-libfuzzer-clang build + ``` + \*\* Make sure to put the right host and compiler +- Fuzzers binaries are compiled into: + + - `out/--tests-asan-libfuzzer-clang/tests` + - e.g. `darwin-arm64-tests-asan-libfuzzer-clang` + +- Running the fuzzer with a corpus + - `path_to_fuzzer_in_test_folder path_to_corpus` + ## `Google's FuzzTest` - Google FuzzTest is integrated through Pigweed diff --git a/examples/chef/common/chef-operational-state-delegate-impl.cpp b/examples/chef/common/chef-operational-state-delegate-impl.cpp index 2692417915d785..eedd141dc3b2e4 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.cpp +++ b/examples/chef/common/chef-operational-state-delegate-impl.cpp @@ -58,6 +58,7 @@ void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperat auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); if (error == CHIP_NO_ERROR) { + GetInstance()->UpdateCountdownTimeFromDelegate(); err.Set(to_underlying(ErrorStateEnum::kNoError)); } else @@ -72,6 +73,7 @@ void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOpera auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); if (error == CHIP_NO_ERROR) { + GetInstance()->UpdateCountdownTimeFromDelegate(); err.Set(to_underlying(ErrorStateEnum::kNoError)); } else @@ -95,6 +97,7 @@ void GenericOperationalStateDelegateImpl::HandleStartStateCallback(GenericOperat auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); if (error == CHIP_NO_ERROR) { + GetInstance()->UpdateCountdownTimeFromDelegate(); (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, this); err.Set(to_underlying(ErrorStateEnum::kNoError)); } @@ -112,6 +115,8 @@ void GenericOperationalStateDelegateImpl::HandleStopStateCallback(GenericOperati { (void) DeviceLayer::SystemLayer().CancelTimer(onOperationalStateTimerTick, this); + GetInstance()->UpdateCountdownTimeFromDelegate(); + OperationalState::GenericOperationalError current_err(to_underlying(OperationalState::ErrorStateEnum::kNoError)); GetInstance()->GetCurrentOperationalError(current_err); @@ -151,6 +156,11 @@ static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data delegate->mPausedTime++; } } + else if (!countdown_time.IsNull() && countdown_time.Value() <= 0) + { + OperationalState::GenericOperationalError noError(to_underlying(OperationalState::ErrorStateEnum::kNoError)); + delegate->HandleStopStateCallback(noError); + } if (state == OperationalState::OperationalStateEnum::kRunning || state == OperationalState::OperationalStateEnum::kPaused) { @@ -172,6 +182,11 @@ OperationalState::Instance * OperationalState::GetOperationalStateInstance() return gOperationalStateInstance; } +OperationalStateDelegate * OperationalState::GetOperationalStateDelegate() +{ + return gOperationalStateDelegate; +} + void OperationalState::Shutdown() { if (gOperationalStateInstance != nullptr) diff --git a/examples/chef/common/chef-operational-state-delegate-impl.h b/examples/chef/common/chef-operational-state-delegate-impl.h index 60b6b09e9b6511..badadd68cd30a9 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.h +++ b/examples/chef/common/chef-operational-state-delegate-impl.h @@ -138,6 +138,7 @@ class OperationalStateDelegate : public GenericOperationalStateDelegateImpl }; Instance * GetOperationalStateInstance(); +OperationalStateDelegate * GetOperationalStateDelegate(); void Shutdown(); diff --git a/examples/chef/dockerfile b/examples/chef/dockerfile index fb61266da5dd89..75458eb47e6b6c 100644 --- a/examples/chef/dockerfile +++ b/examples/chef/dockerfile @@ -1,10 +1,12 @@ -FROM debian:bullseye +FROM debian:trixie ARG DEVICE_NAME RUN apt-get update && \ apt-get install -y \ - libglib2.0-0 && \ + libglib2.0-0 \ + libc6 \ + libssl3 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt index 3f76143ffab36c..cbce6c27abf767 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -1,6 +1,7 @@ {{> header}} #include +#include using namespace chip::app::Clusters; diff --git a/examples/chip-tool/templates/logging/EntryToText-src.zapt b/examples/chip-tool/templates/logging/EntryToText-src.zapt index 646ee2ad872eaf..f7cf8ab51c533b 100644 --- a/examples/chip-tool/templates/logging/EntryToText-src.zapt +++ b/examples/chip-tool/templates/logging/EntryToText-src.zapt @@ -81,4 +81,14 @@ char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId i {{/zcl_clusters}} default: return "Unknown"; } +} + +char const * DeviceTypeIdToText(chip::DeviceTypeId id) { + switch(id) + { +{{#zcl_device_types}} + case {{asHex code 8}}: return "{{caption}}"; +{{/zcl_device_types}} + default: return "Unknown"; + } } \ No newline at end of file diff --git a/examples/chip-tool/templates/logging/EntryToText.zapt b/examples/chip-tool/templates/logging/EntryToText.zapt index d1a78f84dc218c..fa77ffc916dced 100644 --- a/examples/chip-tool/templates/logging/EntryToText.zapt +++ b/examples/chip-tool/templates/logging/EntryToText.zapt @@ -10,4 +10,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id); char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); -char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); \ No newline at end of file +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); + +char const * DeviceTypeIdToText(chip::DeviceTypeId id); \ No newline at end of file diff --git a/examples/chip-tool/templates/partials/StructLoggerImpl.zapt b/examples/chip-tool/templates/partials/StructLoggerImpl.zapt index 3dbd99e7400ef4..e4da56005b8064 100644 --- a/examples/chip-tool/templates/partials/StructLoggerImpl.zapt +++ b/examples/chip-tool/templates/partials/StructLoggerImpl.zapt @@ -3,12 +3,34 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const ch DataModelLogger::LogString(label, indent, "{"); {{#zcl_struct_items}} { +{{#if (isEqual type "devtype_id") }} +{{#if isNullable }} + if (value.{{asLowerCamelCase label}}.IsNull()) + { + CHIP_ERROR err = LogValue("{{asUpperCamelCase label}}", indent + 1, value.{{asLowerCamelCase label}}); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for '{{asUpperCamelCase label}}'"); + return err; + } + } + else + { + std::string item = std::to_string(value.{{asLowerCamelCase label}}.Value()) + " (" + DeviceTypeIdToText(value.{{asLowerCamelCase label}}.Value()) + ")"; + DataModelLogger::LogString("{{asUpperCamelCase label}}", indent + 1, item); + } +{{else}} + std::string item = std::to_string(value.{{asLowerCamelCase label}}) + " (" + DeviceTypeIdToText(value.{{asLowerCamelCase label}}) + ")"; + DataModelLogger::LogString("{{asUpperCamelCase label}}", indent + 1, item); +{{/if}} +{{else}} CHIP_ERROR err = LogValue("{{asUpperCamelCase label}}", indent + 1, value.{{asLowerCamelCase label}}); if (err != CHIP_NO_ERROR) { DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for '{{asUpperCamelCase label}}'"); return err; } +{{/if}} } {{/zcl_struct_items}} DataModelLogger::LogString(indent, "}"); diff --git a/examples/contact-sensor-app/nxp/README.md b/examples/contact-sensor-app/nxp/README.md index 473afb793f9700..133539e44ce3ec 100644 --- a/examples/contact-sensor-app/nxp/README.md +++ b/examples/contact-sensor-app/nxp/README.md @@ -24,6 +24,7 @@ The example is based on: ## Supported devices - [k32w1](k32w1/README.md) +- [mcxw71](mcxw71/README.md) ## Introduction diff --git a/.github/workflows/codeql.yml b/examples/contact-sensor-app/nxp/mcxw71/.gn similarity index 55% rename from .github/workflows/codeql.yml rename to examples/contact-sensor-app/nxp/mcxw71/.gn index 6b150397783138..146e2b9c27ec06 100644 --- a/.github/workflows/codeql.yml +++ b/examples/contact-sensor-app/nxp/mcxw71/.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Project CHIP Authors +# Copyright (c) 2020-2024 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. @@ -11,19 +11,21 @@ # 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. -name: "CodeQL" -on: - workflow_dispatch: -# push: -# branches: [ "master", "sve*", "test_event_*", "v1.*" ] -# pull_request: - schedule: - - cron: '0 5 * * *' +import("//build_overrides/build.gni") -jobs: - analyze: - uses: project-chip/connectedhomeip/.github/workflows/build.yaml@master - with: - run-codeql: true - +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") + + # Import default platform configs + import("${chip_root}/src/platform/nxp/mcxw71_k32w1/args.gni") +} diff --git a/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn new file mode 100644 index 00000000000000..02a0d7a78768dc --- /dev/null +++ b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn @@ -0,0 +1,260 @@ +# Copyright (c) 2021-2024 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("//build_overrides/nxp_sdk.gni") +import("//build_overrides/openthread.gni") + +import("${nxp_sdk_build_root}/nxp_sdk.gni") + +import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni") + +import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni") + +import("${chip_root}/src/app/icd/icd.gni") +import("${chip_root}/src/crypto/crypto.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni") + +declare_args() { + # Setup discriminator as argument + setup_discriminator = 3840 + chip_with_diag_logs_demo = true +} + +assert(current_os == "freertos") +assert(target_os == "freertos") + +example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" +common_example_dir = "${chip_root}/examples/platform/nxp/common" + +mcxw71_k32w1_sdk("sdk") { + defines = [] + include_dirs = [] + sources = [] + + # Indicate the path to CHIPProjectConfig.h + include_dirs += [ "include/config" ] + + # Indicate the default path to FreeRTOSConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/freeRTOS" ] + + # Indicate the default path to OpenThreadConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + + include_dirs += [ + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/MCXW716C", + ] + + sources += [ + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/MCXW716C/clock_config.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/MCXW716C/pin_mux.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/app_services_init.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_comp.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_dcdc.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + ] + + if (is_debug) { + defines += [ "BUILD_RELEASE=0" ] + } else { + defines += [ "BUILD_RELEASE=1" ] + } + + defines += [ + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}", + ] + + if (chip_key_storage == "littlefs") { + include_dirs += [ "${example_platform_dir}/board" ] + sources += [ + "${example_platform_dir}/board/peripherals.c", + "${example_platform_dir}/board/peripherals.h", + ] + } +} + +mcxw71_k32w1_executable("contact_sensor_app") { + output_name = "chip-mcxw71-contact-example" + + defines = [] + deps = [] + include_dirs = [] + sources = [] + + # Defines used by common code + defines += [ + "CONFIG_NET_L2_OPENTHREAD=1", + "CONFIG_NETWORK_LAYER_BLE=1", + "CONFIG_THREAD_DEVICE_TYPE=kThreadDeviceType_SleepyEndDevice", + "CONFIG_OPERATIONAL_KEYSTORE=1", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + ] + + if (chip_with_diag_logs_demo) { + defines += [ "CONFIG_DIAG_LOGS_DEMO=1" ] + } + + if (chip_with_low_power == 1) { + defines += [ "CONFIG_LOW_POWER=1" ] + } else { + defines += [ + "CONFIG_ENABLE_FEEDBACK=1", + "APP_QUEUE_TICKS_TO_WAIT=pdMS_TO_TICKS(10)", + ] + } + + # App common files + include_dirs += [ + "${common_example_dir}/app_task/include", + "${common_example_dir}/matter_button/include", + "${common_example_dir}/clusters/include", + "${common_example_dir}/device_callbacks/include", + "${common_example_dir}/device_manager/include", + "${common_example_dir}/diagnostic_logs/include", + "${common_example_dir}/factory_data/include", + "${common_example_dir}/led_widget/include", + "${common_example_dir}/low_power/include", + "${common_example_dir}/operational_keystore/include", + "${common_example_dir}/ui_feedback/include", + ] + + sources += [ + "${common_example_dir}/app_task/source/AppTaskBase.cpp", + "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp", + "${common_example_dir}/clusters/source/ZclCallbacks.cpp", + "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", + "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", + ] + + if (chip_with_low_power == 1) { + sources += [ "${common_example_dir}/low_power/source/LowPower.cpp" ] + } + + if (chip_with_factory_data == 1) { + include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] + } + + if (chip_enable_ota_requestor) { + defines += [ + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", + + # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. + "LED_MANAGER_ENABLE_STATUS_LED=0", + ] + + include_dirs += [ "${common_example_dir}/ota_requestor/include" ] + sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] + deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] + } + + if (chip_with_diag_logs_demo) { + sources += [ + "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsDemo.cpp", + "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsProviderDelegateImpl.cpp", + ] + } + + # Platform specific files + include_dirs += [ + "${example_platform_dir}/util", + "${example_platform_dir}/app/support", + "${example_platform_dir}/button", + ] + + sources += [ + "${example_platform_dir}/button/ButtonManager.cpp", + "${example_platform_dir}/clusters/Identify.cpp", + "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", + ] + + if (chip_enable_ota_requestor) { + sources += [ "${example_platform_dir}/ota/OtaUtils.cpp" ] + } + + include_dirs += [ + "include/config", + "../common/include", + ] + + sources += [ + "../common/AppTask.cpp", + "../common/DeviceCallbacks.cpp", + "../common/ZclCallbacks.cpp", + "../common/main.cpp", + ] + + if (chip_with_low_power == 0) { + sources += [ + "${common_example_dir}/ui_feedback/source/LedManager.cpp", + "${example_platform_dir}/util/LedOnOff.cpp", + ] + } + + deps += [ + "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/platform/logging:default", + ] + + #lit and sit are using different zap files + if (chip_enable_icd_lit) { + deps += [ "${chip_root}/examples/contact-sensor-app/nxp/zap-lit/" ] + } else { + deps += [ "${chip_root}/examples/contact-sensor-app/nxp/zap-sit/" ] + } + + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", + ] + } else { + deps += [ + "${openthread_root}:libopenthread-cli-mtd", + "${openthread_root}:libopenthread-mtd", + ] + } + + cflags = [ "-Wconversion" ] + + ldscript = "${nxp_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc/connectivity.ld" + + inputs = [ ldscript ] + + ldflags = [ + "-Wl,--defsym=__heap_size__=0", + "-Wl,--defsym=__stack_size__=0x480", + "-Wl,--defsym=lp_ram_lower_limit=0x04000000", + "-Wl,--defsym=lp_ram_upper_limit=0x2001C000", + "-Wl,-print-memory-usage", + "-Wl,--no-warn-rwx-segments", + "-T" + rebase_path(ldscript, root_build_dir), + ] + + if (chip_with_factory_data == 1) { + ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ] + } + + output_dir = root_out_dir +} + +group("default") { + deps = [ ":contact_sensor_app" ] +} diff --git a/examples/contact-sensor-app/nxp/mcxw71/README.md b/examples/contact-sensor-app/nxp/mcxw71/README.md new file mode 100644 index 00000000000000..50d33e10e1b841 --- /dev/null +++ b/examples/contact-sensor-app/nxp/mcxw71/README.md @@ -0,0 +1,194 @@ +# Matter `MCXW71` Contact Sensor Example Application + +For generic information related to contact sensor application, please see the +[common README](../README.md). + +- [Matter `MCXW71` Contact Sensor Example Application](#matter-mcxw71-contact-sensor-example-application) + - [Introduction](#introduction) + - [Device UI](#device-ui) + - [Building](#building) + - [Flashing](#flashing) + - [Flashing the `NBU` image](#flashing-the-nbu-image) + - [Flashing the host image](#flashing-the-host-image) + - [Debugging](#debugging) + - [OTA](#ota) + +## Introduction + +This is a contact sensor application implemented for an `mcxw71` device. + +The following board was used when testing this Matter reference app for an +`mcxw71` device: +![FRDM-MCXW71](../../../platform/nxp/mcxw71_k32w1/doc/images/frdm-mcxw71.jpg) + +## Device UI + +The state feedback is provided through LED effects: + +| widget | effect | description | +| ------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------- | +| LED2 | short flash on (50ms on/950ms off) | The device is in an unprovisioned (unpaired) state and is waiting for a commissioner to connect. | +| LED2 | rapid even flashing (100ms period) | The device is in an unprovisioned state and a commissioner is connected via BLE. | +| LED2 | short flash off (950ms on/50ms off) | The device is fully provisioned, but does not yet have full network (Thread) or service connectivity. | +| LED2 | solid on | The device is fully provisioned and has full network and service connectivity. | +| RGB LED | on | The `StateValue` attribute of the `BooleanState` cluster is `true` (simulating detection). | +| RGB LED | off | The `StateValue` attribute of the `BooleanState` cluster is `false` (simulating no detection). | + +NOTE: `LED2` will be disabled when OTA is used. On `FRDM-MCXW71` board, `PTB0` +is wired to both `LED2` and CS (Chip Select) of the External Flash Memory. Since +the OTA image is stored in external memory, `LED2` operations will affect OTA +operation by corrupting packages and OTA will not work. + +The user actions are summarized below: + +| button | action | state | output | +| ------ | ----------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| SW2 | short press | not commissioned | Enable BLE advertising | +| SW2 | short press | commissioned + device is LIT | Enable Active Mode | +| SW2 | long press | NA | Initiate a factory reset (can be cancelled by pressing the button again within the factory reset timeout limit - 6 seconds by default) | +| SW3 | short press | NA | Toggle attribute `StateValue` value | +| SW3 | long press | NA | Clean soft reset of the device (takes into account proper Matter shutdown procedure) | + +## Building + +Manually building requires running the following commands: + +``` +user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/contact-sensor-app/nxp/mcxw71 +user@ubuntu:~/Desktop/git/connectedhomeip/examples/contact-sensor-app/nxp/mcxw71$ gn gen out/debug +user@ubuntu:~/Desktop/git/connectedhomeip/examples/contact-sensor-app/nxp/mcxw71$ ninja -C out/debug +``` + +Please note that running `gn gen out/debug` without `--args` option will use the +default gn args values found in `args.gni`. + +After a successful build, the `elf` and `srec` files are found in `out/debug/`. +See the files prefixed with `chip-mcxw71-contact-example`. + +## Flashing + +Two images must be written to the board: one for the host (CM33) and one for the +`NBU` (CM3). + +### Flashing the `NBU` image + +`NBU` image should be written only when a new NXP SDK is released. + +1. Install + [Secure Provisioning SDK tool](https://www.nxp.com/design/design-center/software/development-software/secure-provisioning-sdk-spsdk:SPSDK) + using Python: + + ``` + pip install spsdk + ``` + + Note: There might be some dependencies that cause conflicts with already + installed Python modules. However, `blhost` tool is still installed and can + be used. + +2. Updating `NBU` for Wireless examples + + It is necessary to work with the matching `NBU` image for the SDK version of + the application you are working with. This means that when you download your + SDK, prior to loading any wireless SDK example, update your `NBU` image with + the SDK provided binaries. For `FRDM` users, please write the following + binary: + + `middleware\wireless\ieee-802.15.4\bin\mcxw71\mcxw71_nbu_ble_15_4_dyn_matter_.sb3` + + Please note that `` may vary depending on the SDK version. + + 1. Place your device in `ISP` mode. + + - Make sure a jumper is placed on `JP25` + - Press and hold `SW4`, press and release Reset, then release `SW4` + + 2. Once the device is connected, you may find the assigned port by running: + + ``` + nxpdevscan + ``` + + 3. Run the `blhost` command to write the `sb3` file: + + ``` + blhost -p receive-sb-file \middleware\wireless\ieee-802.15.4\bin\mcxw71\mcxw71_nbu_ble_15_4_dyn_matter_.sb3 + ``` + +### Flashing the host image + +Host image is the one found under `out/debug/`. It should be written after each +build process. + +If debugging is needed then jump directly to the [Debugging](#debugging) +section. Otherwise, if only flashing is needed then +[JLink](https://www.segger.com/downloads/jlink/) can be used: + +- Plug `MCXW71` to the USB port (no need to keep the `SW4` button pressed + while doing this, e.g. ISP mode is not needed for host flashing) + +- Connect JLink to the device: + + ```bash + JLinkExe -device MCXW71 -if SWD -speed 4000 -autoconnect 1 + ``` + +- Run the following commands: + ```bash + reset + halt + loadfile chip-mcxw71-contact-example.srec + reset + go + quit + ``` + +## Debugging + +One option for debugging would be to use MCUXpresso IDE. + +- Drag-and-drop the zip file containing the NXP SDK in the "Installed SDKs" + tab: + +![Installed SDKs](../../../platform/nxp/mcxw71_k32w1/doc/images/mcxw71_installed_sdks.jpg) + +- Import any demo application from the installed SDK: + +``` +Import SDK example(s).. -> choose a demo app (demo_apps -> hello_world) -> Finish +``` + +![Import demo](../../../platform/nxp/mcxw71_k32w1/doc/images/import_demo.jpg) + +- Flash the previously imported demo application on the board: + +``` +Right click on the application (from Project Explorer) -> Debug as -> JLink/CMSIS-DAP +``` + +After this step, a debug configuration specific for the `MCXW71` board was +created. This debug configuration will be used later on for debugging the +application resulted after ot-nxp compilation. + +- Import Matter repo in MCUXpresso IDE as Makefile Project. Use _none_ as + _Toolchain for Indexer Settings_: + +``` +File -> Import -> C/C++ -> Existing Code as Makefile Project +``` + +![New Project](../../../platform/nxp/mcxw71_k32w1/doc/images/new_project.jpg) + +- Replace the path of the existing demo application with the path of the + `MCXW71` application: + +``` +Run -> Debug Configurations... -> C/C++ Application +``` + +![](../../../platform/nxp/mcxw71_k32w1/doc/images/mcxw71_debug.jpg) + +## OTA + +Please see +[mcxw71 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). diff --git a/examples/contact-sensor-app/nxp/mcxw71/args.gni b/examples/contact-sensor-app/nxp/mcxw71/args.gni new file mode 100644 index 00000000000000..72634a2308d04b --- /dev/null +++ b/examples/contact-sensor-app/nxp/mcxw71/args.gni @@ -0,0 +1,43 @@ +# Copyright (c) 2020-2024 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") + +# SDK target. This is overridden to add our SDK app_config.h & defines. +nxp_sdk_target = get_label_info(":sdk", "label_no_toolchain") +nxp_device = "MCXW716C" + +chip_enable_ota_requestor = true +chip_stack_lock_tracking = "fatal" +chip_enable_ble = true +chip_generate_link_map_file = true + +chip_system_config_provide_statistics = false +chip_system_config_use_open_thread_inet_endpoints = true +chip_with_lwip = false + +chip_enable_icd_server = true +chip_enable_icd_lit = false +icd_enforce_sit_slow_poll_limit = true +chip_persist_subscriptions = true +chip_subscription_timeout_resumption = true + +is_debug = false + +chip_crypto = "platform" +chip_openthread_ftd = false +chip_with_ot_cli = 0 + +chip_with_diag_logs_demo = true diff --git a/examples/contact-sensor-app/nxp/mcxw71/build_overrides b/examples/contact-sensor-app/nxp/mcxw71/build_overrides new file mode 120000 index 00000000000000..ee19c065d619a2 --- /dev/null +++ b/examples/contact-sensor-app/nxp/mcxw71/build_overrides @@ -0,0 +1 @@ +../../../build_overrides/ \ No newline at end of file diff --git a/examples/contact-sensor-app/nxp/mcxw71/include/config/AppConfig.h b/examples/contact-sensor-app/nxp/mcxw71/include/config/AppConfig.h new file mode 100644 index 00000000000000..0c8019d8e7e33c --- /dev/null +++ b/examples/contact-sensor-app/nxp/mcxw71/include/config/AppConfig.h @@ -0,0 +1,29 @@ +/* + * Copyright 2024 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 + +/* ---- App Config ---- */ +#define APP_DEVICE_TYPE_ENDPOINT 1 +#define APP_CLUSTER_ATTRIBUTE chip::app::Clusters::BooleanState::Attributes::StateValue + +/* ---- Button Manager Config ---- */ +#define BUTTON_MANAGER_FACTORY_RESET_TIMEOUT_MS 6000 + +/* ---- LED Manager Config ---- */ +#define LED_MANAGER_STATUS_LED_INDEX 0 +#define LED_MANAGER_LIGHT_LED_INDEX 1 diff --git a/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h new file mode 100644 index 00000000000000..9e5cee6eb7b695 --- /dev/null +++ b/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2020-2023 Project CHIP Authors + * Copyright (c) 2020 Google LLC. + * 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. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// Use hard-coded test certificates already embedded in generic chip code => set it to 0 +// Use real/development certificates => set it to 1 + file the provisioning section from +// the internal flash +#ifndef CONFIG_CHIP_LOAD_REAL_FACTORY_DATA +#define CONFIG_CHIP_LOAD_REAL_FACTORY_DATA 0 +#endif + +#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA + +// VID/PID for product => will be used by Basic Information Cluster +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0x1037 +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xA401 + +// Set the following define to use the Certification Declaration from below and not use it stored in factory data section +#ifndef CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION +#define CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION 0 +#endif + +#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION +//-> format_version = 1 +//-> vendor_id = 0x1037 +//-> product_id_array = [ 0xA401 ] +//-> device_type_id = 0x0015 +//-> certificate_id = "ZIG20142ZB330003-24" +//-> security_level = 0 +//-> security_information = 0 +//-> version_number = 0x2694 +//-> certification_type = 1 +//-> dac_origin_vendor_id is not present +//-> dac_origin_product_id is not present +#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \ + { \ + 0x30, 0x81, 0xe7, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xd9, 0x30, 0x81, 0xd6, \ + 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \ + 0x44, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x37, 0x04, 0x35, 0x15, 0x24, 0x00, \ + 0x01, 0x25, 0x01, 0x37, 0x10, 0x36, 0x02, 0x05, 0x01, 0xa4, 0x18, 0x24, 0x03, 0x15, 0x2c, 0x04, 0x13, 0x5a, 0x49, \ + 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, 0x24, 0x05, \ + 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x76, 0x98, 0x24, 0x08, 0x01, 0x18, 0x31, 0x7c, 0x30, 0x7a, 0x02, 0x01, 0x03, \ + 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, \ + 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, \ + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x46, 0x30, 0x44, 0x02, 0x20, 0x12, 0xec, 0x79, 0xdc, \ + 0x03, 0xd3, 0x4f, 0xf9, 0x79, 0xef, 0x56, 0x4e, 0x5b, 0x4f, 0xfc, 0xf5, 0xb1, 0x5a, 0xdb, 0xdf, 0xd9, 0xf8, 0x47, \ + 0xff, 0x81, 0xc3, 0x82, 0x2f, 0xa3, 0x2b, 0xb8, 0x3f, 0x02, 0x20, 0x53, 0x0d, 0x5d, 0xbd, 0xc6, 0xa4, 0x80, 0x67, \ + 0x1f, 0x10, 0xfb, 0xab, 0x00, 0x08, 0xee, 0x15, 0xa0, 0x6c, 0x40, 0x97, 0x55, 0x80, 0x28, 0x3e, 0xf3, 0xd9, 0x61, \ + 0x1f, 0x5b, 0x1d, 0x51, 0x02 \ + } + +// All remaining data will be pulled from the provisioning region of flash. +#endif + +#else + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006 + +// Use a default setup PIN code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in CHIP NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +#endif // CONFIG_CHIP_LOAD_REAL_FACTORY_DATA + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100 + +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING NXP_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION NXP_CONFIG_DEVICE_SOFTWARE_VERSION +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME "NXP Semiconductors" +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "NXP Demo App" +#endif + +/** + * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT + * + * The amount of time in miliseconds after which BLE should change his advertisements + * from fast interval to slow interval. + * + * 30000 (30 secondes). + */ +#define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT (30 * 1000) + +/** + * CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT + * + * The amount of time in miliseconds after which BLE advertisement should be disabled, counting + * from the moment of slow advertisement commencement. + * + * Defaults to 9000000 (15 minutes). + */ +#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) + +/** + * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * + * NFC commissioning is not supported on K32W1 + */ +#define CONFIG_CHIP_NFC_COMMISSIONING 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 + +/** + * @def CHIP_CONFIG_MAX_FABRICS + * + * @brief + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. + */ +#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics + +#define CHIP_DEVICE_CONFIG_ENABLE_SED 1 + +/** + * @def CHIP_DEVICE_CONFIG_KVS_WEAR_STATS + * + * @brief Toggle support for key value store wear stats on or off. + */ +#define CHIP_DEVICE_CONFIG_KVS_WEAR_STATS 0 + +/** + * @def CHIP_IM_MAX_NUM_COMMAND_HANDLER + * + * @brief Defines the maximum number of CommandHandler, limits the number of active commands transactions on server. + */ +#define CHIP_IM_MAX_NUM_COMMAND_HANDLER 2 + +/** + * @def CHIP_IM_MAX_NUM_WRITE_HANDLER + * + * @brief Defines the maximum number of WriteHandler, limits the number of active write transactions on server. + */ +#define CHIP_IM_MAX_NUM_WRITE_HANDLER 2 + +/** + * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE + * + * For a development build, set the default importance of events to be logged as Debug. + * Since debug is the lowest importance level, this means all standard, critical, info and + * debug importance level vi events get logged. + */ +#if BUILD_RELEASE +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production +#else +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug +#endif // BUILD_RELEASE + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 + +#if CONFIG_DIAG_LOGS_DEMO +#define CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER 1 +#define CHIP_DEVICE_CONFIG_MAX_DIAG_LOG_SIZE 1024 +#endif diff --git a/examples/contact-sensor-app/nxp/mcxw71/third_party/connectedhomeip b/examples/contact-sensor-app/nxp/mcxw71/third_party/connectedhomeip new file mode 120000 index 00000000000000..59307833b4fee9 --- /dev/null +++ b/examples/contact-sensor-app/nxp/mcxw71/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../.. \ No newline at end of file diff --git a/examples/lighting-app/nxp/README.md b/examples/lighting-app/nxp/README.md index 74d0f9dc294813..67444a99e1bf8d 100644 --- a/examples/lighting-app/nxp/README.md +++ b/examples/lighting-app/nxp/README.md @@ -22,6 +22,7 @@ The example is based on: ## Supported devices - [k32w1](k32w1/README.md) +- [mcxw71](mcxw71/README.md) ## Introduction diff --git a/examples/lighting-app/nxp/k32w1/BUILD.gn b/examples/lighting-app/nxp/k32w1/BUILD.gn index 9544ca8486a2ff..541c288dd1eb5c 100644 --- a/examples/lighting-app/nxp/k32w1/BUILD.gn +++ b/examples/lighting-app/nxp/k32w1/BUILD.gn @@ -236,7 +236,7 @@ mcxw71_k32w1_executable("light_app") { } if (use_smu2_static) { - ldscript = "${example_platform_dir}/app/ldscripts/k32w1_app.ld" + ldscript = "${example_platform_dir}/app/ldscripts/app.ld" base_ldscript_dir = "${nxp_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc" } else { ldscript = "${nxp_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc/connectivity.ld" diff --git a/examples/lighting-app/nxp/k32w1/README.md b/examples/lighting-app/nxp/k32w1/README.md index ab54aab153e272..c47449bf249490 100644 --- a/examples/lighting-app/nxp/k32w1/README.md +++ b/examples/lighting-app/nxp/k32w1/README.md @@ -78,9 +78,9 @@ and global variables in the shared memory area from `NBU` domain. Note: These instances and global variables are placed in `SMU2` memory through name matching in the application linker script. They should not be changed or, -if changed, the names must be updated in `k32w1_app.ld`. See -[k32w1_app.ld](../../../platform/nxp/k32w1/app/ldscripts/k32w1_app.ld) for names -and `SMU2` memory range size. +if changed, the names must be updated in `app.ld`. See +[app.ld](../../../platform/nxp/mcxw71_k32w1/app/ldscripts/app.ld) for names and +`SMU2` memory range size. When compiling the application as an OT Full Thread Device (`chip_openthread_ftd=true`), using `use_smu2_static=true` gn arg will cause the diff --git a/.github/workflows/cert_test_checks.yaml b/examples/lighting-app/nxp/mcxw71/.gn similarity index 52% rename from .github/workflows/cert_test_checks.yaml rename to examples/lighting-app/nxp/mcxw71/.gn index 44d545a6636897..146e2b9c27ec06 100644 --- a/.github/workflows/cert_test_checks.yaml +++ b/examples/lighting-app/nxp/mcxw71/.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Project CHIP Authors +# Copyright (c) 2020-2024 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. @@ -12,24 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Certification test checks +import("//build_overrides/build.gni") -on: - pull_request: - paths: - - "src/app/tests/suites/certification/**" +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" -jobs: - check-certification-tests: - name: Check for common problems in certification tests - runs-on: ubuntu-latest +# CHIP uses angle bracket includes. +check_system_includes = true - container: - image: ghcr.io/project-chip/chip-build +default_args = { + target_cpu = "arm" + target_os = "freertos" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Run checks - run: | - python3 scripts/tests/matter_yaml_linter.py + import("//args.gni") + + # Import default platform configs + import("${chip_root}/src/platform/nxp/mcxw71_k32w1/args.gni") +} diff --git a/examples/lighting-app/nxp/mcxw71/BUILD.gn b/examples/lighting-app/nxp/mcxw71/BUILD.gn new file mode 100644 index 00000000000000..34733584a80cd9 --- /dev/null +++ b/examples/lighting-app/nxp/mcxw71/BUILD.gn @@ -0,0 +1,268 @@ +# Copyright (c) 2024 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("//build_overrides/nxp_sdk.gni") +import("//build_overrides/openthread.gni") + +import("${nxp_sdk_build_root}/nxp_sdk.gni") + +import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni") + +import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni") + +import("${chip_root}/src/crypto/crypto.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni") + +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") + +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") + import("${chip_root}/examples/platform/nxp/pw_rpc_server.gni") +} + +declare_args() { + # Setup discriminator as argument + setup_discriminator = 3840 +} + +assert(current_os == "freertos") +assert(target_os == "freertos") + +example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" +common_example_dir = "${chip_root}/examples/platform/nxp/common" + +mcxw71_k32w1_sdk("sdk") { + defines = [] + include_dirs = [] + sources = [] + + # Indicate the path to CHIPProjectConfig.h + include_dirs += [ "include/config" ] + + # Indicate the default path to FreeRTOSConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/freeRTOS" ] + + # Indicate the default path to OpenThreadConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + + include_dirs += [ + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/MCXW716C", + ] + + sources += [ + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/MCXW716C/clock_config.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/MCXW716C/pin_mux.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/app_services_init.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_comp.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_dcdc.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + ] + + if (is_debug) { + defines += [ "BUILD_RELEASE=0" ] + } else { + defines += [ "BUILD_RELEASE=1" ] + } + + if (chip_enable_pw_rpc) { + defines += [ + "CONFIG_ENABLE_PW_RPC", + "STREAMER_UART_FLUSH_DELAY_MS=0", + "STREAMER_UART_SERIAL_MANAGER_RING_BUFFER_SIZE=512", + "BOARD_APP_UART_CLK_FREQ=96000000", + ] + } + + defines += [ + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}", + ] + + if (chip_key_storage == "littlefs") { + include_dirs += [ "${example_platform_dir}/board" ] + sources += [ + "${example_platform_dir}/board/peripherals.c", + "${example_platform_dir}/board/peripherals.h", + ] + } +} + +mcxw71_k32w1_executable("light_app") { + output_name = "chip-mcxw71-light-example" + + defines = [] + deps = [] + sources = [] + + if (chip_enable_pw_rpc) { + forward_variables_from(pw_rpc_server, "*") + } else { + include_dirs = [] + cflags = [ "-Wconversion" ] + } + + # Defines used by common code + defines += [ + "CONFIG_NET_L2_OPENTHREAD=1", + "CONFIG_NETWORK_LAYER_BLE=1", + "CONFIG_OPERATIONAL_KEYSTORE=1", + "CONFIG_ENABLE_FEEDBACK=1", + "APP_QUEUE_TICKS_TO_WAIT=pdMS_TO_TICKS(10)", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + ] + + # App common files + include_dirs += [ + "${common_example_dir}/app_task/include", + "${common_example_dir}/matter_button/include", + "${common_example_dir}/clusters/include", + "${common_example_dir}/device_callbacks/include", + "${common_example_dir}/device_manager/include", + "${common_example_dir}/factory_data/include", + "${common_example_dir}/led_widget/include", + "${common_example_dir}/operational_keystore/include", + "${common_example_dir}/rpc/include", + "${common_example_dir}/ui_feedback/include", + ] + + sources += [ + "${common_example_dir}/app_task/source/AppTaskBase.cpp", + "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp", + "${common_example_dir}/clusters/source/ZclCallbacks.cpp", + "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", + "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", + ] + + if (chip_enable_ota_requestor) { + defines += [ + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", + + # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. + "LED_MANAGER_ENABLE_STATUS_LED=0", + ] + + include_dirs += [ "${common_example_dir}/ota_requestor/include" ] + sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] + deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] + } + + # Platform specific files + include_dirs += [ + "${example_platform_dir}/util", + "${example_platform_dir}/app/support", + "${example_platform_dir}/button", + ] + + sources += [ + "${example_platform_dir}/button/ButtonManager.cpp", + "${example_platform_dir}/clusters/Identify.cpp", + "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", + ] + + if (chip_enable_ota_requestor) { + sources += [ "${example_platform_dir}/ota/OtaUtils.cpp" ] + } + + if (chip_enable_pw_rpc) { + sources += [ "${example_platform_dir}/rpc/AppRpc.cpp" ] + } + + if (chip_with_factory_data == 1) { + include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] + } + + sources += [ + "../common/AppTask.cpp", + "../common/DeviceCallbacks.cpp", + "../common/main.cpp", + ] + + include_dirs += [ + "../common", + "../common/include", + "include/config", + ] + + deps += [ + "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/platform/logging:default", + ] + + if (chip_config_dimmable_led) { + defines += [ "LIGHTING_MANAGER_ENABLE_DIMMABLE_LED=1" ] + sources += [ + "${common_example_dir}/led_widget/include/LedDimmer.h", + "${example_platform_dir}/util/LedDimmer.cpp", + "${example_platform_dir}/util/LightingManagerDimmable.cpp", + ] + deps += [ "${chip_root}/examples/lighting-app/lighting-common/" ] + } else { + sources += [ + "${common_example_dir}/ui_feedback/source/LedManager.cpp", + "${example_platform_dir}/util/LedOnOff.cpp", + ] + deps += [ "${chip_root}/examples/lighting-app/nxp/zap/" ] + } + + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", + ] + } else { + deps += [ + "${openthread_root}:libopenthread-cli-mtd", + "${openthread_root}:libopenthread-mtd", + ] + } + + if (use_smu2_static) { + ldscript = "${example_platform_dir}/app/ldscripts/app.ld" + base_ldscript_dir = "${nxp_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc" + } else { + ldscript = "${nxp_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc/connectivity.ld" + } + + inputs = [ ldscript ] + + ldflags = [ + "-Wl,--defsym=__heap_size__=0", + "-Wl,--defsym=__stack_size__=0x480", + "-Wl,-print-memory-usage", + "-Wl,--no-warn-rwx-segments", + "-T" + rebase_path(ldscript, root_build_dir), + ] + + if (chip_with_factory_data == 1) { + ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ] + } + + if (use_smu2_static) { + ldflags += [ "-L" + rebase_path(base_ldscript_dir, root_build_dir) ] + } + + output_dir = root_out_dir +} + +group("default") { + deps = [ ":light_app" ] +} diff --git a/examples/lighting-app/nxp/mcxw71/README.md b/examples/lighting-app/nxp/mcxw71/README.md new file mode 100644 index 00000000000000..116fd6183e197d --- /dev/null +++ b/examples/lighting-app/nxp/mcxw71/README.md @@ -0,0 +1,270 @@ +# Matter `MCXW71` Lighting Example Application + +For generic information related to on/off light application, please see the +[common README](../README.md). + +- [Matter `MCXW71` Lighting Example Application](#matter-mcxw71-lighting-example-application) + - [Introduction](#introduction) + - [Device UI](#device-ui) + - [Building](#building) + - [`SMU2` Memory](#smu2-memory) + - [LED PWM](#led-pwm) + - [Flashing](#flashing) + - [Flashing the `NBU` image](#flashing-the-nbu-image) + - [Flashing the host image](#flashing-the-host-image) + - [Debugging](#debugging) + - [Running RPC console](#running-rpc-console) + - [OTA](#ota) + +## Introduction + +This is an on/off lighting application implemented for an `mcxw71` device. + +The following board was used when testing this Matter reference app for a +`mcxw71` device: +![FRDM-MCXW71](../../../platform/nxp/mcxw71_k32w1/doc/images/frdm-mcxw71.jpg) + +## Device UI + +The state feedback is provided through LED effects: + +| widget | effect | description | +| ------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------- | +| LED2 | short flash on (50ms on/950ms off) | The device is in an unprovisioned (unpaired) state and is waiting for a commissioner to connect. | +| LED2 | rapid even flashing (100ms period) | The device is in an unprovisioned state and a commissioner is connected via BLE. | +| LED2 | short flash off (950ms on/50ms off) | The device is fully provisioned, but does not yet have full network (Thread) or service connectivity. | +| LED2 | solid on | The device is fully provisioned and has full network and service connectivity. | +| RGB LED | on | The `OnOff` attribute of the `On/Off` cluster is `true` (simulating device turned on). | +| RGB LED | off | The `OnOff` attribute of the `On/Off` cluster is `false` (simulating device turned off). | + +NOTE: `LED2` will be disabled when OTA is used. On `FRDM-MCXW71` board, `PTB0` +is wired to both `LED2` and CS (Chip Select) of the External Flash Memory. Since +the OTA image is stored in external memory, `LED2` operations will affect OTA +operation by corrupting packages and OTA will not work. + +The user actions are summarized below: + +| button | action | output | +| ------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| SW2 | short press | Enable BLE advertising | +| SW2 | long press | Initiate a factory reset (can be cancelled by pressing the button again within the factory reset timeout limit - 6 seconds by default) | +| SW3 | short press | Toggle attribute `OnOff` value | +| SW3 | long press | Clean soft reset of the device (takes into account proper Matter shutdown procedure) | + +The example application provides a simple UI that depicts the state of the +device and offers basic user control. This UI is implemented via the +general-purpose LEDs and buttons built in the `MCXW71` board. + +## Building + +Manually building requires running the following commands: + +``` +user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lighting-app/nxp/mcxw71 +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/mcxw71$ gn gen out/debug +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/mcxw71$ ninja -C out/debug +``` + +Please note that running `gn gen out/debug` without `--args` option will use the +default gn args values found in `args.gni`. + +After a successful build, the `elf` and `srec` files are found in `out/debug/`. +See the files prefixed with `chip-mcxw71-light-example`. + +### `SMU2` Memory + +Additional memory is provided to the application by moving some Matter instances +and global variables in the shared memory area from `NBU` domain. + +Note: These instances and global variables are placed in `SMU2` memory through +name matching in the application linker script. They should not be changed or, +if changed, the names must be updated in `app.ld`. See +[app.ld](../../../platform/nxp/mcxw71_k32w1/app/ldscripts/app.ld) for names and +`SMU2` memory range size. + +When compiling the application as an OT Full Thread Device +(`chip_openthread_ftd=true`), using `use_smu2_static=true` gn arg will cause the +following symbols to be moved to `SMU2` area: + +| symbol name | file | +| ----------------------------------- | ---------------------------- | +| `gImageProcessor` | `OTAImageProcessorImpl.cpp` | +| `gApplicationProcessor` | `OTAHooks.cpp` | +| `Server::sServer` | `Server.cpp` | +| `ThreadStackManagerImpl::sInstance` | `ThreadStackManagerImpl.cpp` | + +Additionally, using `use_smu2_dynamic=true` will cause the OpenThread buffers to +be dynamically allocated from a 13KB `SMU2` range after a successful +commissioning process. + +`use_smu2_static` and `use_smu2_dynamic` are set to `true` in the default +example. + +### LED PWM + +In the default configuration, the onboard RGB LED pins are configured as GPIO +pins. In order to enable the dimming feature, the pins need to be configured in +PWM mode and synced with channels of the `TPM` (Timer PWM Module). To enable +this feature, compile the application with: `chip_config_dimmable_led=true` + +If the feature is enabled, the LED brightness can be controlled using +`LevelControl` cluster +[commands](../../../../docs/guides/chip_tool_guide.md#step-7-control-application-data-model-clusters). + +## Flashing + +Two images must be written to the board: one for the host (CM33) and one for the +`NBU` (CM3). + +The image needed on the host side is the one generated in `out/debug/` while the +one needed on the `NBU` side can be found in the downloaded NXP-SDK package at +path - +`middleware\wireless\ieee-802.15.4\bin\k32w1\k32w1_nbu_ble_15_4_dyn_matter.sb3`. + +### Flashing the `NBU` image + +`NBU` image should be written only when a new NXP SDK is released. + +1. Install + [Secure Provisioning SDK tool](https://www.nxp.com/design/design-center/software/development-software/secure-provisioning-sdk-spsdk:SPSDK) + using Python: + + ``` + pip install spsdk + ``` + + Note: There might be some dependencies that cause conflicts with already + installed Python modules. However, `blhost` tool is still installed and can + be used. + +2. Updating `NBU` for Wireless examples + + It is necessary to work with the matching `NBU` image for the SDK version of + the application you are working with. This means that when you download your + SDK, prior to loading any wireless SDK example, update your `NBU` image with + the SDK provided binaries. For `FRDM` users, please write the following + binary: + + `middleware\wireless\ieee-802.15.4\bin\mcxw71\mcxw71_nbu_ble_15_4_dyn_matter_.sb3` + + Please note that `` may vary depending on the SDK version. + + 1. Place your device in `ISP` mode. + + - Make sure a jumper is placed on `JP25` + - Press and hold `SW4`, press and release Reset, then release `SW4` + + 2. Once the device is connected, you may find the assigned port by running: + + ``` + nxpdevscan + ``` + + 3. Run the `blhost` command to write the `sb3` file: + + ``` + blhost -p receive-sb-file \middleware\wireless\ieee-802.15.4\bin\mcxw71\mcxw71_nbu_ble_15_4_dyn_matter_.sb3 + ``` + +### Flashing the host image + +Host image is the one found under `out/debug/`. It should be written after each +build process. + +If debugging is needed then jump directly to the [Debugging](#debugging) +section. Otherwise, if only flashing is needed then +[JLink](https://www.segger.com/downloads/jlink/) can be used: + +- Plug `MCXW71` to the USB port (no need to keep the `SW4` button pressed + while doing this, e.g. ISP mode is not needed for host flashing) + +- Connect JLink to the device: + + ```bash + JLinkExe -device MCXW71 -if SWD -speed 4000 -autoconnect 1 + ``` + +- Run the following commands: + ```bash + reset + halt + loadfile chip-mcxw71-light-example.srec + reset + go + quit + ``` + +## Debugging + +One option for debugging would be to use MCUXpresso IDE. + +- Drag-and-drop the zip file containing the NXP SDK in the "Installed SDKs" + tab: + +![Installed SDKs](../../../platform/nxp/mcxw71_k32w1/doc/images/mcxw71_installed_sdks.jpg) + +- Import any demo application from the installed SDK: + +``` +Import SDK example(s).. -> choose a demo app (demo_apps -> hello_world) -> Finish +``` + +![Import demo](../../../platform/nxp/mcxw71_k32w1/doc/images/import_demo.jpg) + +- Flash the previously imported demo application on the board: + +``` +Right click on the application (from Project Explorer) -> Debug as -> JLink/CMSIS-DAP +``` + +After this step, a debug configuration specific for the `MCXW71` board was +created. This debug configuration will be used later on for debugging the +application resulted after ot-nxp compilation. + +- Import Matter repo in MCUXpresso IDE as Makefile Project. Use _none_ as + _Toolchain for Indexer Settings_: + +``` +File -> Import -> C/C++ -> Existing Code as Makefile Project +``` + +![New Project](../../../platform/nxp/mcxw71_k32w1/doc/images/new_project.jpg) + +- Replace the path of the existing demo application with the path of the + `MCXW71` application: + +``` +Run -> Debug Configurations... -> C/C++ Application +``` + +![Debug MCXW71](../../../platform/nxp/mcxw71_k32w1/doc/images/mcxw71_debug.jpg) + +## Running RPC console + +To build example with RPC enabled, use the following gn command: +`gn gen out/debug --args='import("//with_pw_rpc.gni") treat_warnings_as_errors=false'` + +The application runs an RPC server and processes events coming from an RPC +client. An example of an RPC client is the `chip-console`, which can be accessed +by running: +`chip-console --device /dev/tty. -b 115200 -o pw_log.out` + +The console should have already been installed in the virtual environment. From +the `chip-console`, a user can send specific commands to the device. + +For button commands, please run `rpcs.chip.rpc.Button.Event(index)` based on the +table below: + +| index | action | +| ----- | --------------------------------------------- | +| 0 | Start/stop BLE advertising | +| 1 | Factory reset the device | +| 2 | Application specific action (e.g. toggle LED) | +| 3 | Soft reset the device | + +To reboot the device, please run `rpcs.chip.rpc.Device.Reboot()`. + +## OTA + +Please see +[mcxw71 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). diff --git a/examples/lighting-app/nxp/mcxw71/args.gni b/examples/lighting-app/nxp/mcxw71/args.gni new file mode 100644 index 00000000000000..6a27d6605ea2b8 --- /dev/null +++ b/examples/lighting-app/nxp/mcxw71/args.gni @@ -0,0 +1,39 @@ +# Copyright (c) 2020-2024 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") + +# SDK target. This is overridden to add our SDK app_config.h & defines. +nxp_sdk_target = get_label_info(":sdk", "label_no_toolchain") +nxp_device = "MCXW716C" + +chip_config_dimmable_led = false +chip_enable_ota_requestor = true +chip_stack_lock_tracking = "fatal" +chip_enable_ble = true +chip_generate_link_map_file = true + +is_debug = false + +chip_crypto = "platform" +chip_openthread_ftd = true +chip_with_ot_cli = 0 + +chip_system_config_provide_statistics = false +chip_system_config_use_open_thread_inet_endpoints = true +chip_with_lwip = false + +use_smu2_static = true +use_smu2_dynamic = true diff --git a/examples/lighting-app/nxp/mcxw71/build_overrides b/examples/lighting-app/nxp/mcxw71/build_overrides new file mode 120000 index 00000000000000..ee19c065d619a2 --- /dev/null +++ b/examples/lighting-app/nxp/mcxw71/build_overrides @@ -0,0 +1 @@ +../../../build_overrides/ \ No newline at end of file diff --git a/examples/lighting-app/nxp/mcxw71/include/config/AppConfig.h b/examples/lighting-app/nxp/mcxw71/include/config/AppConfig.h new file mode 100644 index 00000000000000..6dcccf749bbebe --- /dev/null +++ b/examples/lighting-app/nxp/mcxw71/include/config/AppConfig.h @@ -0,0 +1,29 @@ +/* + * Copyright 2024 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 + +/* ---- App Config ---- */ +#define APP_DEVICE_TYPE_ENDPOINT 1 +#define APP_CLUSTER_ATTRIBUTE chip::app::Clusters::OnOff::Attributes::OnOff + +/* ---- Button Manager Config ---- */ +#define BUTTON_MANAGER_FACTORY_RESET_TIMEOUT_MS 6000 + +/* ---- LED Manager Config ---- */ +#define LED_MANAGER_STATUS_LED_INDEX 0 +#define LED_MANAGER_LIGHT_LED_INDEX 1 diff --git a/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h new file mode 100644 index 00000000000000..20f126aa23a0d5 --- /dev/null +++ b/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2020 Google LLC. + * 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. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// Security and Authentication disabled for development build. +// For convenience, enable CHIP Security Test Mode and disable the requirement for +// authentication in various protocols. +// WARNING: These options make it possible to circumvent basic CHIP security functionality, +// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 + +// Use hard-coded test certificates already embedded in generic chip code => set it to 0 +// Use real/development certificates => set it to 1 + file the provisioning section from +// the internal flash +#ifndef CONFIG_CHIP_LOAD_REAL_FACTORY_DATA +#define CONFIG_CHIP_LOAD_REAL_FACTORY_DATA 0 +#endif + +#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA + +// VID/PID for product => will be used by Basic Information Cluster +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0x1037 +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xA401 + +// Set the following define to use the Certification Declaration from below and not use it stored in factory data section +#ifndef CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION +#define CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION 0 +#endif + +#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION +//-> format_version = 1 +//-> vendor_id = 0x1037 +//-> product_id_array = [ 0xA401 ] +//-> device_type_id = 0x0100 +//-> certificate_id = "ZIG20142ZB330003-24" +//-> security_level = 0 +//-> security_information = 0 +//-> version_number = 0x2694 +//-> certification_type = 1 +//-> dac_origin_vendor_id is not present +//-> dac_origin_product_id is not present +#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \ + { \ + 0x30, 0x81, 0xe8, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xda, 0x30, 0x81, 0xd7, \ + 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \ + 0x45, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x38, 0x04, 0x36, 0x15, 0x24, 0x00, \ + 0x01, 0x25, 0x01, 0x37, 0x10, 0x36, 0x02, 0x05, 0x01, 0xa4, 0x18, 0x25, 0x03, 0x00, 0x01, 0x2c, 0x04, 0x13, 0x5a, \ + 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, 0x24, \ + 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x76, 0x98, 0x24, 0x08, 0x01, 0x18, 0x31, 0x7c, 0x30, 0x7a, 0x02, 0x01, \ + 0x03, 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, \ + 0x04, 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, \ + 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x46, 0x30, 0x44, 0x02, 0x20, 0x11, 0xc4, 0xe4, \ + 0x54, 0xcc, 0xdb, 0x09, 0xa9, 0x31, 0xd7, 0xbd, 0x6e, 0x28, 0x95, 0x9b, 0xab, 0x3e, 0xec, 0x76, 0x09, 0x8c, 0x39, \ + 0x93, 0x43, 0x6e, 0x89, 0x07, 0x7d, 0x8b, 0xe9, 0x3a, 0x0a, 0x02, 0x20, 0x71, 0xc6, 0xac, 0x09, 0x11, 0x7b, 0x1a, \ + 0x61, 0x5e, 0x3a, 0xc6, 0x4a, 0x4f, 0xf3, 0xd4, 0x3b, 0x62, 0x54, 0x3a, 0xf3, 0x60, 0xeb, 0x47, 0xd4, 0x8f, 0x18, \ + 0x0d, 0xa3, 0xd1, 0xef, 0xd0, 0x70 \ + } + +// All remaining data will be pulled from the provisioning region of flash. +#endif + +#else + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x8005: example lighting-app + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005 + +// Use a default setup PIN code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in CHIP NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +#endif // CONFIG_CHIP_LOAD_REAL_FACTORY_DATA + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100 + +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING NXP_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION NXP_CONFIG_DEVICE_SOFTWARE_VERSION +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME "NXP Semiconductors" +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "NXP Demo App" +#endif + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote CHIP Time service + * using the CHIP Time Sync protocol. + */ +// #define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1 + +/** + * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT + * + * The amount of time in miliseconds after which BLE should change his advertisements + * from fast interval to slow interval. + * + * 30000 (30 secondes). + */ +#define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT (30 * 1000) + +/** + * CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT + * + * The amount of time in miliseconds after which BLE advertisement should be disabled, counting + * from the moment of slow advertisement commencement. + * + * Defaults to 9000000 (15 minutes). + */ +#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) + +/** + * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * + * NFC commissioning is not supported on K32W1 + */ +#define CONFIG_CHIP_NFC_COMMISSIONING 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 + +/** + * @def CHIP_CONFIG_MAX_FABRICS + * + * @brief + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. + */ +#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics + +/** + * @def CHIP_IM_MAX_NUM_COMMAND_HANDLER + * + * @brief Defines the maximum number of CommandHandler, limits the number of active commands transactions on server. + */ +#define CHIP_IM_MAX_NUM_COMMAND_HANDLER 2 + +/** + * @def CHIP_IM_MAX_NUM_WRITE_HANDLER + * + * @brief Defines the maximum number of WriteHandler, limits the number of active write transactions on server. + */ +#define CHIP_IM_MAX_NUM_WRITE_HANDLER 2 + +/** + * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE + * + * For a development build, set the default importance of events to be logged as Debug. + * Since debug is the lowest importance level, this means all standard, critical, info and + * debug importance level vi events get logged. + */ +#if BUILD_RELEASE +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production +#else +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug +#endif // BUILD_RELEASE + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lighting-app/nxp/mcxw71/third_party/connectedhomeip b/examples/lighting-app/nxp/mcxw71/third_party/connectedhomeip new file mode 120000 index 00000000000000..59307833b4fee9 --- /dev/null +++ b/examples/lighting-app/nxp/mcxw71/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../.. \ No newline at end of file diff --git a/examples/lighting-app/nxp/mcxw71/with_pw_rpc.gni b/examples/lighting-app/nxp/mcxw71/with_pw_rpc.gni new file mode 100644 index 00000000000000..c2dc1950544640 --- /dev/null +++ b/examples/lighting-app/nxp/mcxw71/with_pw_rpc.gni @@ -0,0 +1,37 @@ +# 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. + +# add this gni as import in your build args to use pigweed in the example +# 'import("//with_pw_rpc.gni")' + +import("//build_overrides/chip.gni") +import("${chip_root}/config/nxp/lib/pw_rpc/pw_rpc.gni") + +nxp_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +chip_crypto = "platform" +chip_enable_ble = true +chip_enable_ota_requestor = true +chip_enable_pw_rpc = true +chip_openthread_ftd = true +chip_stack_lock_tracking = "fatal" + +chip_system_config_provide_statistics = false +chip_system_config_use_open_thread_inet_endpoints = true + +chip_with_lwip = false +chip_with_ot_cli = 0 + +cpp_standard = "gnu++17" +is_debug = false diff --git a/examples/ota-provider-app/esp32/main/BdxOtaSender.cpp b/examples/ota-provider-app/esp32/main/BdxOtaSender.cpp index 272187870f49df..5ff0e55b33355c 100644 --- a/examples/ota-provider-app/esp32/main/BdxOtaSender.cpp +++ b/examples/ota-provider-app/esp32/main/BdxOtaSender.cpp @@ -174,7 +174,6 @@ void BdxOtaSender::HandleTransferSessionOutput(TransferSession::OutputEvent & ev { ChipLogError(BDX, "onTransferComplete Callback not set"); } - mStopPolling = true; // Stop polling the TransferSession only after receiving BlockAckEOF Reset(); break; case TransferSession::OutputEventType::kStatusReceived: @@ -228,7 +227,7 @@ void BdxOtaSender::Reset() { mFabricIndex.ClearValue(); mNodeId.ClearValue(); - mTransfer.Reset(); + ResetTransfer(); if (mExchangeCtx != nullptr) { mExchangeCtx->Close(); diff --git a/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp b/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp index 5c3f2213427035..871d8bfb19de86 100644 --- a/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp +++ b/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp @@ -180,7 +180,6 @@ void BdxOtaSender::HandleTransferSessionOutput(TransferSession::OutputEvent & ev break; case TransferSession::OutputEventType::kAckEOFReceived: ChipLogDetail(BDX, "Transfer completed, got AckEOF"); - mStopPolling = true; // Stop polling the TransferSession only after receiving BlockAckEOF Reset(); break; case TransferSession::OutputEventType::kStatusReceived: @@ -212,7 +211,7 @@ void BdxOtaSender::Reset() { mFabricIndex.ClearValue(); mNodeId.ClearValue(); - Responder::ResetTransfer(); + ResetTransfer(); if (mExchangeCtx != nullptr) { mExchangeCtx->Close(); diff --git a/examples/platform/nxp/mcxw71_k32w1/app/ldscripts/k32w1_app.ld b/examples/platform/nxp/mcxw71_k32w1/app/ldscripts/app.ld similarity index 100% rename from examples/platform/nxp/mcxw71_k32w1/app/ldscripts/k32w1_app.ld rename to examples/platform/nxp/mcxw71_k32w1/app/ldscripts/app.ld diff --git a/examples/platform/nxp/mcxw71_k32w1/doc/images/frdm-mcxw71.jpg b/examples/platform/nxp/mcxw71_k32w1/doc/images/frdm-mcxw71.jpg new file mode 100755 index 00000000000000..a54f70f062c6a0 Binary files /dev/null and b/examples/platform/nxp/mcxw71_k32w1/doc/images/frdm-mcxw71.jpg differ diff --git a/examples/platform/nxp/mcxw71_k32w1/doc/images/mcxw71_debug.jpg b/examples/platform/nxp/mcxw71_k32w1/doc/images/mcxw71_debug.jpg new file mode 100755 index 00000000000000..21bd041ebd3f14 Binary files /dev/null and b/examples/platform/nxp/mcxw71_k32w1/doc/images/mcxw71_debug.jpg differ diff --git a/examples/platform/nxp/mcxw71_k32w1/doc/images/mcxw71_installed_sdks.jpg b/examples/platform/nxp/mcxw71_k32w1/doc/images/mcxw71_installed_sdks.jpg new file mode 100755 index 00000000000000..22ce6ccbdbb878 Binary files /dev/null and b/examples/platform/nxp/mcxw71_k32w1/doc/images/mcxw71_installed_sdks.jpg differ diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index cbef67996c4528..37efb09fe5c207 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -621,7 +621,7 @@ void BaseApplication::CancelFactoryResetSequence() if (sIsFactoryResetTriggered) { sIsFactoryResetTriggered = false; - ChipLogProgress(AppServer, "Factory Reset has been Canceled"); + ChipLogProgress(AppServer, "Factory Reset has been cancelled"); } } @@ -802,6 +802,10 @@ void BaseApplication::ScheduleFactoryReset() { Provision::Manager::GetInstance().SetProvisionRequired(true); } +#if SL_WIFI + // Removing the matter services on factory reset + chip::Dnssd::ServiceAdvertiser::Instance().RemoveServices(); +#endif PlatformMgr().HandleServerShuttingDown(); // HandleServerShuttingDown calls OnShutdown() which is only implemented for the // basic information cluster it seems. And triggers and Event flush, which is not // relevant when there are no fabrics left @@ -851,19 +855,23 @@ void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t) case DeviceEventType::kThreadConnectivityChange: case DeviceEventType::kInternetConnectivityChange: { #ifdef DIC_ENABLE - VerifyOrReturn(event->InternetConnectivityChange.IPv4 == kConnectivity_Established); - if (DIC_OK != dic_init(dic::control::subscribeCB)) + if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established) { - SILABS_LOG("Failed to initialize DIC module\n"); + if (DIC_OK != dic_init(dic::control::subscribeCB)) + { + ChipLogError(AppServer, "dic_init failed"); + } } #endif // DIC_ENABLE #ifdef DISPLAY_ENABLED SilabsLCD::Screen_e screen; AppTask::GetLCD().GetScreen(screen); // Update the LCD screen with SSID and connected state - VerifyOrReturn(screen == SilabsLCD::Screen_e::StatusScreen); - BaseApplication::UpdateLCDStatusScreen(false); - AppTask::GetLCD().SetScreen(screen); + if (screen == SilabsLCD::Screen_e::StatusScreen) + { + BaseApplication::UpdateLCDStatusScreen(false); + AppTask::GetLCD().SetScreen(screen); + } #endif // DISPLAY_ENABLED if ((event->ThreadConnectivityChange.Result == kConnectivity_Established) || (event->InternetConnectivityChange.IPv6 == kConnectivity_Established)) diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp index 64b294ef081187..c65a97ea3a569f 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp @@ -36,8 +36,12 @@ #include "task.h" #include "wfx_host_events.h" #include "wfx_rsi.h" + #include #include +#include +#include +#include #include extern "C" { @@ -123,7 +127,7 @@ static void DHCPTimerEventHandler(void * arg) WfxPostEvent(&event); } -static void CancelDHCPTimer() +static void CancelDHCPTimer(void) { osStatus_t status; @@ -167,8 +171,10 @@ int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t * ap) { sl_status_t status = SL_STATUS_OK; int32_t rssi = 0; + ap->ssid_length = wfx_rsi.sec.ssid_length; ap->security = wfx_rsi.sec.security; ap->chan = wfx_rsi.ap_chan; + chip::Platform::CopyString(ap->ssid, ap->ssid_length, wfx_rsi.sec.ssid); memcpy(&ap->bssid[0], &wfx_rsi.ap_mac.octet[0], BSSID_LEN); sl_wifi_get_signal_strength(SL_WIFI_CLIENT_INTERFACE, &rssi); ap->rssi = rssi; @@ -200,14 +206,14 @@ int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info) } /****************************************************************** - * @fn int32_t wfx_rsi_reset_count() + * @fn int32_t wfx_rsi_reset_count(void) * @brief * Getting the driver reset count * @param[in] None * @return * status *********************************************************************/ -int32_t wfx_rsi_reset_count() +int32_t wfx_rsi_reset_count(void) { sl_wifi_statistics_t test = { 0 }; sl_status_t status = SL_STATUS_OK; @@ -224,14 +230,14 @@ int32_t wfx_rsi_reset_count() } /****************************************************************** - * @fn wfx_rsi_disconnect() + * @fn wfx_rsi_disconnect(void) * @brief * Getting the driver disconnect status * @param[in] None * @return * status *********************************************************************/ -int32_t wfx_rsi_disconnect() +int32_t wfx_rsi_disconnect(void) { return sl_wifi_disconnect(SL_WIFI_CLIENT_INTERFACE); } @@ -254,18 +260,17 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t */ ChipLogDetail(DeviceLayer, "join_callback_handler: success"); memset(&temp_reset, 0, sizeof(temp_reset)); - - WfxEvent.eventType = WFX_EVT_STA_CONN; - WfxPostEvent(&WfxEvent); wfx_rsi.join_retries = 0; callback_status = SL_STATUS_OK; + WfxEvent.eventType = WFX_EVT_STA_CONN; + WfxPostEvent(&WfxEvent); return SL_STATUS_OK; } #if CHIP_CONFIG_ENABLE_ICD_SERVER #if SLI_SI91X_MCU_INTERFACE // Required to invoke button press event during sleep as falling edge is not detected -void sl_si91x_invoke_btn_press_event() +void sl_si91x_invoke_btn_press_event(void) { // TODO: should be removed once we are getting the press interrupt for button 0 with sleep if (!RSI_NPSSGPIO_GetPin(SL_BUTTON_BTN0_PIN) && !btn0_pressed) @@ -301,12 +306,12 @@ void sl_si91x_invoke_btn_press_event() #endif // SLI_SI91X_MCU_INTERFACE /****************************************************************** - * @fn wfx_rsi_power_save() + * @fn wfx_rsi_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_si91x_performance_profile_t sl_si91x_wifi_state) * @brief * Setting the RS911x in DTIM sleep based mode * * @param[in] sl_si91x_ble_state : State to set for the BLE - sl_si91x_wifi_state : State to set for the WiFi + * @param[in] sl_si91x_wifi_state : State to set for the WiFi * @return * None *********************************************************************/ @@ -342,7 +347,7 @@ int32_t wfx_rsi_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_ *****************************************************************************************/ int32_t wfx_wifi_rsi_init(void) { - ChipLogDetail(DeviceLayer, "wfx_wifi_rsi_init started"); + ChipLogDetail(DeviceLayer, "wfx_wifi_rsi_init: started"); sl_status_t status; status = sl_wifi_init(&config, NULL, sl_wifi_default_event_handler); VerifyOrReturnError(status == SL_STATUS_OK, status); @@ -537,7 +542,10 @@ sl_status_t show_scan_results(sl_wifi_scan_result_t * scan_result) for (int idx = 0; idx < (int) scan_result->scan_count; idx++) { memset(&cur_scan_result, 0, sizeof(cur_scan_result)); - strncpy(cur_scan_result.ssid, (char *) &scan_result->scan_info[idx].ssid, WFX_MAX_SSID_LENGTH); + + cur_scan_result.ssid_length = strnlen((char *) scan_result->scan_info[idx].ssid, + chip::min(sizeof(scan_result->scan_info[idx].ssid), WFX_MAX_SSID_LENGTH)); + chip::Platform::CopyString(cur_scan_result.ssid, cur_scan_result.ssid_length, (char *) scan_result->scan_info[idx].ssid); // if user has provided ssid, then check if the current scan result ssid matches the user provided ssid if (wfx_rsi.scan_ssid != NULL && @@ -562,10 +570,10 @@ sl_status_t show_scan_results(sl_wifi_scan_result_t * scan_result) // cleanup and return wfx_rsi.dev_state &= ~WFX_RSI_ST_SCANSTARTED; wfx_rsi.scan_cb((wfx_wifi_scan_result_t *) 0); - wfx_rsi.scan_cb = NULL; + wfx_rsi.scan_cb = nullptr; if (wfx_rsi.scan_ssid) { - vPortFree(wfx_rsi.scan_ssid); + chip::Platform::MemoryFree(wfx_rsi.scan_ssid); wfx_rsi.scan_ssid = NULL; } return SL_STATUS_OK; @@ -579,14 +587,14 @@ sl_status_t bg_scan_callback_handler(sl_wifi_event_t event, sl_wifi_scan_result_ return SL_STATUS_OK; } /*************************************************************************************** - * @fn static void wfx_rsi_save_ap_info() + * @fn static void wfx_rsi_save_ap_info(void) * @brief * Saving the details of the AP * @param[in] None * @return * None *******************************************************************************************/ -static void wfx_rsi_save_ap_info() // translation +static void wfx_rsi_save_ap_info(void) // translation { sl_status_t status = SL_STATUS_OK; #ifndef EXP_BOARD @@ -595,8 +603,8 @@ static void wfx_rsi_save_ap_info() // translation #endif sl_wifi_ssid_t ssid_arg; memset(&ssid_arg, 0, sizeof(ssid_arg)); - ssid_arg.length = strnlen(wfx_rsi.sec.ssid, WFX_MAX_SSID_LENGTH); - strncpy((char *) &ssid_arg.value[0], wfx_rsi.sec.ssid, WFX_MAX_SSID_LENGTH); + ssid_arg.length = wfx_rsi.sec.ssid_length; + chip::Platform::CopyString((char *) &ssid_arg.value[0], ssid_arg.length, wfx_rsi.sec.ssid); sl_wifi_set_scan_callback(scan_callback_handler, NULL); scan_results_complete = false; #ifndef EXP_BOARD @@ -622,7 +630,7 @@ static sl_status_t wfx_rsi_do_join(void) sl_status_t status = SL_STATUS_OK; sl_wifi_client_configuration_t ap; memset(&ap, 0, sizeof(ap)); - WfxEvent_t event; + switch (wfx_rsi.sec.security) { case WFX_SEC_WEP: @@ -665,19 +673,17 @@ static sl_status_t wfx_rsi_do_join(void) status = sl_wifi_set_advanced_client_configuration(SL_WIFI_CLIENT_INTERFACE, &client_config); VerifyOrReturnError(status == SL_STATUS_OK, status); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER - size_t psk_length = strlen(wfx_rsi.sec.passkey); - VerifyOrReturnError(psk_length <= SL_WIFI_MAX_PSK_LENGTH, SL_STATUS_SI91X_INVALID_PSK_LENGTH); sl_net_credential_id_t id = SL_NET_DEFAULT_WIFI_CLIENT_CREDENTIAL_ID; - status = sl_net_set_credential(id, SL_NET_WIFI_PSK, &wfx_rsi.sec.passkey[0], psk_length); + status = sl_net_set_credential(id, SL_NET_WIFI_PSK, &wfx_rsi.sec.passkey[0], wfx_rsi.sec.passkey_length); VerifyOrReturnError(status == SL_STATUS_OK, status); uint32_t timeout_ms = 0; - ap.ssid.length = strnlen(wfx_rsi.sec.ssid, WFX_MAX_SSID_LENGTH); + ap.ssid.length = wfx_rsi.sec.ssid_length; ap.encryption = SL_WIFI_NO_ENCRYPTION; ap.credential_id = id; - memset(&ap.ssid.value, 0, (sizeof(ap.ssid.value) / sizeof(ap.ssid.value[0]))); - strncpy((char *) &ap.ssid.value[0], wfx_rsi.sec.ssid, WFX_MAX_SSID_LENGTH); + memcpy((char *) &ap.ssid.value[0], wfx_rsi.sec.ssid, wfx_rsi.sec.ssid_length); ChipLogDetail(DeviceLayer, "wfx_rsi_do_join: SSID: %s, SECURITY: %d(%d)", ap.ssid.value, ap.security, wfx_rsi.sec.security); + status = sl_wifi_connect(SL_WIFI_CLIENT_INTERFACE, &ap, timeout_ms); // sl_wifi_connect returns SL_STATUS_IN_PROGRESS if join is in progress // after the initial scan is done, the scan does not check for SSID @@ -690,24 +696,25 @@ static sl_status_t wfx_rsi_do_join(void) wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED); ChipLogProgress(DeviceLayer, "wfx_rsi_do_join: retry attempt %d", wfx_rsi.join_retries); wfx_retry_connection(++wfx_rsi.join_retries); + + WfxEvent_t event; event.eventType = WFX_EVT_STA_START_JOIN; WfxPostEvent(&event); + return status; } /// NotifyConnectivity /// @brief Notify the application about the connectivity status if it has not been notified yet. /// Helper function for HandleDHCPPolling. -void NotifyConnectivity() +void NotifyConnectivity(void) { - if (!hasNotifiedWifiConnectivity) - { - wfx_connected_notify(CONNECTION_STATUS_SUCCESS, &wfx_rsi.ap_mac); - hasNotifiedWifiConnectivity = true; - } + VerifyOrReturn(!hasNotifiedWifiConnectivity); + wfx_connected_notify(CONNECTION_STATUS_SUCCESS, &wfx_rsi.ap_mac); + hasNotifiedWifiConnectivity = true; } -void HandleDHCPPolling() +void HandleDHCPPolling(void) { struct netif * sta_netif; WfxEvent_t event; @@ -725,6 +732,8 @@ void HandleDHCPPolling() { wfx_dhcp_got_ipv4((uint32_t) sta_netif->ip_addr.u_addr.ip4.addr); hasNotifiedIPV4 = true; + event.eventType = WFX_EVT_STA_DHCP_DONE; + WfxPostEvent(&event); NotifyConnectivity(); } else if (dhcp_state == DHCP_OFF) @@ -763,7 +772,7 @@ void WfxPostEvent(WfxEvent_t * event) /// ResetDHCPNotificationFlags /// @brief Reset the flags that are used to notify the application about DHCP connectivity /// and emits a WFX_EVT_STA_DO_DHCP event to trigger DHCP polling checks. Helper function for ProcessEvent. -void ResetDHCPNotificationFlags() +void ResetDHCPNotificationFlags(void) { WfxEvent_t outEvent; @@ -880,7 +889,7 @@ void ProcessEvent(WfxEvent_t inEvent) /********************************************************************************* * @fn void wfx_rsi_task(void *arg) * @brief - * The main WLAN task - started by wfx_wifi_start () that interfaces with RSI. + * The main WLAN task - started by wfx_wifi_start() that interfaces with RSI. * The rest of RSI stuff come in call-backs. * The initialization has been already done. * @param[in] arg: diff --git a/examples/platform/silabs/efr32/rs911x/rsi_if.cpp b/examples/platform/silabs/efr32/rs911x/rsi_if.cpp index d5560d69e97219..02500c80f78e35 100644 --- a/examples/platform/silabs/efr32/rs911x/rsi_if.cpp +++ b/examples/platform/silabs/efr32/rs911x/rsi_if.cpp @@ -54,10 +54,10 @@ extern "C" { #include "silabs_utils.h" #include "wfx_rsi.h" -// TODO convert this file to cpp and use CodeUtils.h -#ifndef MIN -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif +#include +#include +#include +#include #define WFX_QUEUE_SIZE 10 @@ -112,21 +112,21 @@ static void DHCPTimerEventHandler(void * arg) WfxPostEvent(&event); } -static void CancelDHCPTimer() +static void CancelDHCPTimer(void) { osStatus_t status; // Check if timer started if (!osTimerIsRunning(sDHCPTimer)) { - SILABS_LOG("CancelDHCPTimer: timer not running"); + ChipLogError(DeviceLayer, "CancelDHCPTimer: timer not running"); return; } status = osTimerStop(sDHCPTimer); if (status != osOK) { - SILABS_LOG("CancelDHCPTimer: failed to stop timer with status: %d", status); + ChipLogError(DeviceLayer, "CancelDHCPTimer: failed to stop timer with status: %d", status); } } @@ -140,7 +140,7 @@ static void StartDHCPTimer(uint32_t timeout) status = osTimerStart(sDHCPTimer, pdMS_TO_TICKS(timeout)); if (status != osOK) { - SILABS_LOG("StartDHCPTimer: failed to start timer with status: %d", status); + ChipLogError(DeviceLayer, "StartDHCPTimer: failed to start timer with status: %d", status); } } @@ -154,7 +154,7 @@ static void StartDHCPTimer(uint32_t timeout) *********************************************************************/ int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t * ap) { - int32_t status; + int32_t status = RSI_SUCCESS; uint8_t rssi; ap->security = wfx_rsi.sec.security; ap->chan = wfx_rsi.ap_chan; @@ -182,70 +182,65 @@ int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info) status = rsi_wlan_get(RSI_WLAN_EXT_STATS, buff, sizeof(buff)); if (status != RSI_SUCCESS) { - SILABS_LOG("Failed, Error Code : 0x%lX", status); - } - else - { - rsi_wlan_ext_stats_t * test = (rsi_wlan_ext_stats_t *) buff; - extra_info->beacon_lost_count = test->beacon_lost_count - temp_reset.beacon_lost_count; - extra_info->beacon_rx_count = test->beacon_rx_count - temp_reset.beacon_rx_count; - extra_info->mcast_rx_count = test->mcast_rx_count - temp_reset.mcast_rx_count; - extra_info->mcast_tx_count = test->mcast_tx_count - temp_reset.mcast_tx_count; - extra_info->ucast_rx_count = test->ucast_rx_count - temp_reset.ucast_rx_count; - extra_info->ucast_tx_count = test->ucast_tx_count - temp_reset.ucast_tx_count; - extra_info->overrun_count = test->overrun_count - temp_reset.overrun_count; + ChipLogError(DeviceLayer, "Failed, Error Code : 0x%lX", status); + return status; } + rsi_wlan_ext_stats_t * test = (rsi_wlan_ext_stats_t *) buff; + extra_info->beacon_lost_count = test->beacon_lost_count - temp_reset.beacon_lost_count; + extra_info->beacon_rx_count = test->beacon_rx_count - temp_reset.beacon_rx_count; + extra_info->mcast_rx_count = test->mcast_rx_count - temp_reset.mcast_rx_count; + extra_info->mcast_tx_count = test->mcast_tx_count - temp_reset.mcast_tx_count; + extra_info->ucast_rx_count = test->ucast_rx_count - temp_reset.ucast_rx_count; + extra_info->ucast_tx_count = test->ucast_tx_count - temp_reset.ucast_tx_count; + extra_info->overrun_count = test->overrun_count - temp_reset.overrun_count; return status; } /****************************************************************** - * @fn int32_t wfx_rsi_reset_count() + * @fn int32_t wfx_rsi_reset_count(void) * @brief * Getting the driver reset count * @param[in] None * @return * status *********************************************************************/ -int32_t wfx_rsi_reset_count() +int32_t wfx_rsi_reset_count(void) { int32_t status; uint8_t buff[RSI_RESPONSE_MAX_SIZE] = { 0 }; status = rsi_wlan_get(RSI_WLAN_EXT_STATS, buff, sizeof(buff)); if (status != RSI_SUCCESS) { - SILABS_LOG("Failed, Error Code : 0x%lX", status); - } - else - { - rsi_wlan_ext_stats_t * test = (rsi_wlan_ext_stats_t *) buff; - temp_reset.beacon_lost_count = test->beacon_lost_count; - temp_reset.beacon_rx_count = test->beacon_rx_count; - temp_reset.mcast_rx_count = test->mcast_rx_count; - temp_reset.mcast_tx_count = test->mcast_tx_count; - temp_reset.ucast_rx_count = test->ucast_rx_count; - temp_reset.ucast_tx_count = test->ucast_tx_count; - temp_reset.overrun_count = test->overrun_count; + ChipLogError(DeviceLayer, "Failed, Error Code : 0x%lX", status); + return status; } + rsi_wlan_ext_stats_t * test = (rsi_wlan_ext_stats_t *) buff; + temp_reset.beacon_lost_count = test->beacon_lost_count; + temp_reset.beacon_rx_count = test->beacon_rx_count; + temp_reset.mcast_rx_count = test->mcast_rx_count; + temp_reset.mcast_tx_count = test->mcast_tx_count; + temp_reset.ucast_rx_count = test->ucast_rx_count; + temp_reset.ucast_tx_count = test->ucast_tx_count; + temp_reset.overrun_count = test->overrun_count; return status; } /****************************************************************** - * @fn wfx_rsi_disconnect() + * @fn wfx_rsi_disconnect(void) * @brief * Getting the driver disconnect status * @param[in] None * @return * status *********************************************************************/ -int32_t wfx_rsi_disconnect() +int32_t wfx_rsi_disconnect(void) { - int32_t status = rsi_wlan_disconnect(); - return status; + return rsi_wlan_disconnect(); } #if SL_ICD_ENABLED /****************************************************************** - * @fn wfx_rsi_power_save() + * @fn wfx_rsi_power_save(void) * @brief * Setting the RS911x in DTIM sleep based mode * @@ -253,14 +248,14 @@ int32_t wfx_rsi_disconnect() * @return * None *********************************************************************/ -int32_t wfx_rsi_power_save() +int32_t wfx_rsi_power_save(void) { int32_t status; #ifdef RSI_BLE_ENABLE status = rsi_bt_power_save_profile(RSI_SLEEP_MODE_2, RSI_MAX_PSP); if (status != RSI_SUCCESS) { - SILABS_LOG("BT Powersave Config Failed, Error Code : 0x%lX", status); + ChipLogError(DeviceLayer, "BT Powersave Config Failed, Error Code : 0x%lX", status); return status; } #endif /* RSI_BLE_ENABLE */ @@ -268,10 +263,10 @@ int32_t wfx_rsi_power_save() status = rsi_wlan_power_save_profile(RSI_SLEEP_MODE_2, RSI_MAX_PSP); if (status != RSI_SUCCESS) { - SILABS_LOG("Powersave Config Failed, Error Code : 0x%lX", status); + ChipLogError(DeviceLayer, "Powersave Config Failed, Error Code : 0x%lX", status); return status; } - SILABS_LOG("Powersave Config Success"); + ChipLogDetail(DeviceLayer, "Powersave Config Success"); return status; } #endif /* SL_ICD_ENABLED */ @@ -295,20 +290,19 @@ static void wfx_rsi_join_cb(uint16_t status, const uint8_t * buf, const uint16_t /* * We should enable retry.. (Need config variable for this) */ - SILABS_LOG("wfx_rsi_join_cb: failed. retry: %d", wfx_rsi.join_retries); + ChipLogProgress(DeviceLayer, "wfx_rsi_join_cb: failed. retry: %d", wfx_rsi.join_retries); wfx_retry_connection(++wfx_rsi.join_retries); + return; } - else - { - /* - * Join was complete - Do the DHCP - */ - memset(&temp_reset, 0, sizeof(wfx_wifi_scan_ext_t)); - SILABS_LOG("wfx_rsi_join_cb: join completed."); - WfxEvent.eventType = WFX_EVT_STA_CONN; - WfxPostEvent(&WfxEvent); - wfx_rsi.join_retries = 0; - } + + /* + * Join was complete - Do the DHCP + */ + ChipLogProgress(DeviceLayer, "wfx_rsi_join_cb: success"); + memset(&temp_reset, 0, sizeof(wfx_wifi_scan_ext_t)); + WfxEvent.eventType = WFX_EVT_STA_CONN; + WfxPostEvent(&WfxEvent); + wfx_rsi.join_retries = 0; } /****************************************************************** @@ -323,7 +317,7 @@ static void wfx_rsi_join_cb(uint16_t status, const uint8_t * buf, const uint16_t *********************************************************************/ static void wfx_rsi_join_fail_cb(uint16_t status, uint8_t * buf, uint32_t len) { - SILABS_LOG("wfx_rsi_join_fail_cb: error: failed status: %02x", status); + ChipLogError(DeviceLayer, "wfx_rsi_join_fail_cb: status: %d", status); WfxEvent_t WfxEvent; wfx_rsi.join_retries += 1; wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED); @@ -363,30 +357,27 @@ static int32_t wfx_rsi_init(void) uint8_t buf[RSI_RESPONSE_HOLD_BUFF_SIZE]; extern void rsi_hal_board_init(void); - SILABS_LOG("wfx_rsi_init: starting(HEAP_SZ = %d)", SL_HEAP_SIZE); + ChipLogProgress(DeviceLayer, "wfx_rsi_init: starting(HEAP_SZ = %d)", SL_HEAP_SIZE); //! Driver initialization status = rsi_driver_init(wfx_rsi_drv_buf, WFX_RSI_BUF_SZ); if ((status < RSI_DRIVER_STATUS) || (status > WFX_RSI_BUF_SZ)) { - SILABS_LOG("wfx_rsi_init: error: RSI Driver initialization failed with status: %02x", status); + ChipLogError(DeviceLayer, "wfx_rsi_init: rsi_driver_init failed: %ld", status); return status; } - - SILABS_LOG("wfx_rsi_init: rsi_device_init", __func__); /* ! Redpine module intialisation */ if ((status = rsi_device_init(LOAD_NWP_FW)) != RSI_SUCCESS) { - SILABS_LOG("wfx_rsi_init: error: rsi_device_init failed with status: %02x", status); + ChipLogError(DeviceLayer, "wfx_rsi_init: rsi_device_init failed: %ld", status); return status; } - SILABS_LOG("wfx_rsi_init: start wireless drv task", __func__); /* * Create the driver wrapper thread */ sDrvThread = osThreadNew(rsi_wireless_driver_task_wrapper, NULL, &kDrvTaskAttr); if (NULL == sDrvThread) { - SILABS_LOG("wfx_rsi_init: error: rsi_wireless_driver_task failed", __func__); + ChipLogError(DeviceLayer, "wfx_rsi_init: failed to create task"); return RSI_ERROR_INVALID_PARAM; } @@ -397,41 +388,40 @@ static int32_t wfx_rsi_init(void) if ((status = rsi_wireless_init(OPER_MODE_0, COEX_MODE_0)) != RSI_SUCCESS) { #endif - SILABS_LOG("wfx_rsi_init: error: Initialize WiSeConnect failed with status: %02x", status); + ChipLogError(DeviceLayer, "wfx_rsi_init: rsi_wireless_init failed: %ld", status); return status; } - SILABS_LOG("wfx_rsi_init: get FW version..", __func__); /* * Get the MAC and other info to let the user know about it. */ if (rsi_wlan_get(RSI_FW_VERSION, buf, sizeof(buf)) != RSI_SUCCESS) { - SILABS_LOG("wfx_rsi_init: error: rsi_wlan_get(RSI_FW_VERSION) failed with status: %02x", status); + ChipLogError(DeviceLayer, "wfx_rsi_init: rsi_wlan_get(RSI_FW_VERSION) failed: %ld", status); return status; } buf[sizeof(buf) - 1] = 0; - SILABS_LOG("wfx_rsi_init: RSI firmware version: %s", buf); + ChipLogProgress(DeviceLayer, "RSI firmware version: %s", buf); //! Send feature frame if ((status = rsi_send_feature_frame()) != RSI_SUCCESS) { - SILABS_LOG("wfx_rsi_init: error: rsi_send_feature_frame failed with status: %02x", status); + ChipLogError(DeviceLayer, "error: rsi_send_feature_frame failed: %ld", status); return status; } - SILABS_LOG("wfx_rsi_init: sent rsi_send_feature_frame", __func__); /* initializes wlan radio parameters and WLAN supplicant parameters. */ (void) rsi_wlan_radio_init(); /* Required so we can get MAC address */ if ((status = rsi_wlan_get(RSI_MAC_ADDRESS, &wfx_rsi.sta_mac.octet[0], RESP_BUFF_SIZE)) != RSI_SUCCESS) { - SILABS_LOG("wfx_rsi_init: error: rsi_wlan_get failed with status: %02x", status); + ChipLogError(DeviceLayer, "wfx_rsi_init: rsi_wlan_get(RSI_MAC_ADDRESS) failed: %ld", status); return status; } - SILABS_LOG("wfx_rsi_init: WLAN: MAC %02x:%02x:%02x %02x:%02x:%02x", wfx_rsi.sta_mac.octet[0], wfx_rsi.sta_mac.octet[1], - wfx_rsi.sta_mac.octet[2], wfx_rsi.sta_mac.octet[3], wfx_rsi.sta_mac.octet[4], wfx_rsi.sta_mac.octet[5]); + ChipLogDetail(DeviceLayer, "wfx_rsi_init: MAC: %02x:%02x:%02x %02x:%02x:%02x", wfx_rsi.sta_mac.octet[0], + wfx_rsi.sta_mac.octet[1], wfx_rsi.sta_mac.octet[2], wfx_rsi.sta_mac.octet[3], wfx_rsi.sta_mac.octet[4], + wfx_rsi.sta_mac.octet[5]); // Create the message queue sWifiEventQueue = osMessageQueueNew(WFX_QUEUE_SIZE, sizeof(WfxEvent_t), NULL); @@ -453,12 +443,12 @@ static int32_t wfx_rsi_init(void) */ if ((status = rsi_wlan_register_callbacks(RSI_JOIN_FAIL_CB, wfx_rsi_join_fail_cb)) != RSI_SUCCESS) { - SILABS_LOG("wfx_rsi_init: RSI callback register join failed with status: %02x", status); + ChipLogError(DeviceLayer, "wfx_rsi_init: rsi_wlan_register_callbacks failed: %ld", status); return status; } if ((status = rsi_wlan_register_callbacks(RSI_WLAN_DATA_RECEIVE_NOTIFY_CB, wfx_rsi_wlan_pkt_cb)) != RSI_SUCCESS) { - SILABS_LOG("wfx_rsi_init: RSI callback register data-notify failed with status: %02x", status); + ChipLogError(DeviceLayer, "wfx_rsi_init: rsi_wlan_register_callbacks failed: %ld", status); return status; } @@ -467,26 +457,26 @@ static int32_t wfx_rsi_init(void) #endif wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY; - SILABS_LOG("wfx_rsi_init: RSI: OK", __func__); + ChipLogProgress(DeviceLayer, "wfx_rsi_init: success"); return RSI_SUCCESS; } /*************************************************************************************** - * @fn static void wfx_rsi_save_ap_info() + * @fn static void wfx_rsi_save_ap_info(void) * @brief * Saving the details of the AP * @param[in] None * @return * None *******************************************************************************************/ -static void wfx_rsi_save_ap_info() // translation +static void wfx_rsi_save_ap_info(void) // translation { int32_t status; rsi_rsp_scan_t rsp; status = rsi_wlan_scan_with_bitmap_options((int8_t *) &wfx_rsi.sec.ssid[0], AP_CHANNEL_NO_0, &rsp, sizeof(rsp), SCAN_BITMAP_OPTN_1); - if (status) + if (status != RSI_SUCCESS) { /* * Scan is done - failed @@ -496,7 +486,7 @@ static void wfx_rsi_save_ap_info() // translation #else /* !WIFI_ENABLE_SECURITY_WPA3_TRANSITION */ wfx_rsi.sec.security = WFX_SEC_WPA2; #endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */ - SILABS_LOG("wfx_rsi_save_ap_info: warn: failed with status: %02x", status); + ChipLogProgress(DeviceLayer, "warn: scan failed: %ld", status); return; } wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED; @@ -532,8 +522,8 @@ static void wfx_rsi_save_ap_info() // translation break; } - SILABS_LOG("wfx_rsi_save_ap_info: WLAN: connecting to %s, sec=%d, status=%02x", &wfx_rsi.sec.ssid[0], wfx_rsi.sec.security, - status); + ChipLogProgress(DeviceLayer, "wfx_rsi_save_ap_info: connecting to %s, sec=%d, status=%ld", &wfx_rsi.sec.ssid[0], + wfx_rsi.sec.security, status); } /******************************************************************************************** @@ -550,58 +540,56 @@ static void wfx_rsi_do_join(void) if (wfx_rsi.dev_state & (WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED)) { - SILABS_LOG("wfx_rsi_do_join: not joining - already in progress"); + ChipLogProgress(DeviceLayer, "wfx_rsi_do_join: already in progress"); + return; } - else - { - switch (wfx_rsi.sec.security) - { - case WFX_SEC_WEP: - connect_security_mode = RSI_WEP; - break; - case WFX_SEC_WPA: - case WFX_SEC_WPA2: - connect_security_mode = RSI_WPA_WPA2_MIXED; - break; + switch (wfx_rsi.sec.security) + { + case WFX_SEC_WEP: + connect_security_mode = RSI_WEP; + break; + case WFX_SEC_WPA: + case WFX_SEC_WPA2: + connect_security_mode = RSI_WPA_WPA2_MIXED; + break; #if WIFI_ENABLE_SECURITY_WPA3_TRANSITION - case WFX_SEC_WPA3: - connect_security_mode = RSI_WPA3_PERSONAL_TRANSITION; - break; + case WFX_SEC_WPA3: + connect_security_mode = RSI_WPA3_PERSONAL_TRANSITION; + break; #endif // WIFI_ENABLE_SECURITY_WPA3_TRANSITION - case WFX_SEC_NONE: - connect_security_mode = RSI_OPEN; - break; - default: - SILABS_LOG("wfx_rsi_do_join: error: unknown security type."); - return; - } + case WFX_SEC_NONE: + connect_security_mode = RSI_OPEN; + break; + default: + ChipLogError(DeviceLayer, "wfx_rsi_do_join: error: unknown security type."); + return; + } - SILABS_LOG("wfx_rsi_do_join: WLAN: connecting to %s, sec=%d", &wfx_rsi.sec.ssid[0], wfx_rsi.sec.security); + ChipLogProgress(DeviceLayer, "wfx_rsi_do_join: connecting to %s, sec=%d", &wfx_rsi.sec.ssid[0], wfx_rsi.sec.security); - /* - * Join the network - */ - /* TODO - make the WFX_SECURITY_xxx - same as RSI_xxx - * Right now it's done by hand - we need something better - */ - wfx_rsi.dev_state |= WFX_RSI_ST_STA_CONNECTING; + /* + * Join the network + */ + /* TODO - make the WFX_SECURITY_xxx - same as RSI_xxx + * Right now it's done by hand - we need something better + */ + wfx_rsi.dev_state |= WFX_RSI_ST_STA_CONNECTING; - if ((status = rsi_wlan_register_callbacks(RSI_JOIN_FAIL_CB, wfx_rsi_join_fail_cb)) != RSI_SUCCESS) - { - SILABS_LOG("wfx_rsi_do_join: RSI callback register join failed with status: %02x", status); - } + if ((status = rsi_wlan_register_callbacks(RSI_JOIN_FAIL_CB, wfx_rsi_join_fail_cb)) != RSI_SUCCESS) + { + ChipLogError(DeviceLayer, "wfx_rsi_do_join: rsi_wlan_register_callbacks failed: %ld", status); + } - /* Try to connect Wifi with given Credentials - * untill there is a success or maximum number of tries allowed - */ - if ((status = rsi_wlan_connect_async((int8_t *) &wfx_rsi.sec.ssid[0], connect_security_mode, &wfx_rsi.sec.passkey[0], - wfx_rsi_join_cb)) != RSI_SUCCESS) - { - wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTING; - SILABS_LOG("wfx_rsi_do_join: rsi_wlan_connect_async failed with status: %02x on try %d", status, wfx_rsi.join_retries); - wfx_retry_connection(++wfx_rsi.join_retries); - } + /* Try to connect Wifi with given Credentials + * until there is a success or maximum number of tries allowed + */ + if ((status = rsi_wlan_connect_async((int8_t *) &wfx_rsi.sec.ssid[0], connect_security_mode, &wfx_rsi.sec.passkey[0], + wfx_rsi_join_cb)) != RSI_SUCCESS) + { + wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTING; + ChipLogProgress(DeviceLayer, "wfx_rsi_do_join: rsi_wlan_connect_async failed: %ld on try %d", status, wfx_rsi.join_retries); + wfx_retry_connection(++wfx_rsi.join_retries); } } @@ -609,7 +597,7 @@ static void wfx_rsi_do_join(void) * @brief Notify the application about the connectivity status if it has not been notified yet. * Helper function for HandleDHCPPolling. */ -void NotifyConnectivity() +void NotifyConnectivity(void) { if (!hasNotifiedWifiConnectivity) { @@ -618,7 +606,7 @@ void NotifyConnectivity() } } -void HandleDHCPPolling() +void HandleDHCPPolling(void) { struct netif * sta_netif; WfxEvent_t event; @@ -628,7 +616,7 @@ void HandleDHCPPolling() { // TODO: Notify the application that the interface is not set up or Chipdie here because we // are in an unkonwn state - SILABS_LOG("HandleDHCPPolling: failed to get STA netif"); + ChipLogError(DeviceLayer, "HandleDHCPPolling: failed to get STA netif"); return; } #if (CHIP_DEVICE_CONFIG_ENABLE_IPV4) @@ -662,7 +650,7 @@ void HandleDHCPPolling() * @brief Reset the flags that are used to notify the application about DHCP connectivity * and emits a WFX_EVT_STA_DO_DHCP event to trigger DHCP polling checks. Helper function for ProcessEvent. */ -void ResetDHCPNotificationFlags() +void ResetDHCPNotificationFlags(void) { WfxEvent_t outEvent; @@ -685,19 +673,27 @@ void WfxPostEvent(WfxEvent_t * event) if (status != osOK) { - SILABS_LOG("WfxPostEvent: failed to post event with status: %d", status); + ChipLogError(DeviceLayer, "WfxPostEvent: failed to post event with status: %ld", status); // TODO: Handle error, requeue event depending on queue size or notify relevant task, // Chipdie, etc. } } +/** + * @brief Process the Wi-Fi event. + * + * This function is responsible for processing different types of Wi-Fi events and taking appropriate actions based on the event + * type. + * + * @param inEvent The input Wi-Fi event to be processed. + */ void ProcessEvent(WfxEvent_t inEvent) { // Process event switch (inEvent.eventType) { case WFX_EVT_STA_CONN: { - SILABS_LOG("Starting LwIP STA"); + ChipLogDetail(DeviceLayer, "_onWFXEvent: WFX_EVT_STA_CONN"); wfx_rsi.dev_state |= WFX_RSI_ST_STA_CONNECTED; ResetDHCPNotificationFlags(); wfx_lwip_set_sta_link_up(); @@ -709,10 +705,10 @@ void ProcessEvent(WfxEvent_t inEvent) } break; case WFX_EVT_STA_DISCONN: { + ChipLogDetail(DeviceLayer, "_onWFXEvent: WFX_EVT_STA_DISCONN"); // TODO: This event is not being posted anywhere, seems to be a dead code or we are missing something wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_READY | WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE); - SILABS_LOG("Disconnect notify"); /* TODO: Implement disconnect notify */ ResetDHCPNotificationFlags(); wfx_lwip_set_sta_link_down(); // Internally dhcpclient_poll(netif) -> @@ -732,48 +728,64 @@ void ProcessEvent(WfxEvent_t inEvent) case WFX_EVT_SCAN: { #ifdef SL_WFX_CONFIG_SCAN rsi_rsp_scan_t scan_rsp = { 0 }; - int32_t status = rsi_wlan_bgscan_profile(1, &scan_rsp, sizeof(scan_rsp)); + memset(&scan_rsp, 0, sizeof(scan_rsp)); + int32_t status = rsi_wlan_bgscan_profile(1, &scan_rsp, sizeof(scan_rsp)); - if (status) + if (status != RSI_SUCCESS) { - SILABS_LOG("SSID scan failed: %02x ", status); + ChipLogError(DeviceLayer, "rsi_wlan_bgscan failed: %ld ", status); + return; } - else + + if (wfx_rsi.scan_cb == NULL) + { + ChipLogError(DeviceLayer, "wfx_rsi.scan_cb is NULL"); + return; + } + + rsi_scan_info_t * scan; + wfx_wifi_scan_result_t ap; + + for (int x = 0; x < scan_rsp.scan_count[0]; x++) { - rsi_scan_info_t * scan; - wfx_wifi_scan_result_t ap; - for (int x = 0; x < scan_rsp.scan_count[0]; x++) + scan = &scan_rsp.scan_info[x]; + // clear structure and calculate size of SSID + memset(&ap, 0, sizeof(ap)); + ap.ssid_length = + strnlen(reinterpret_cast(scan->ssid), chip::min(sizeof(scan->ssid), WFX_MAX_SSID_LENGTH)); + chip::Platform::CopyString(ap.ssid, ap.ssid_length, reinterpret_cast(scan->ssid)); + + // check if the scanned ssid is the one we are looking for + if (wfx_rsi.scan_ssid_length != 0 && strncmp(wfx_rsi.scan_ssid, ap.ssid, WFX_MAX_SSID_LENGTH) != CMP_SUCCESS) { - scan = &scan_rsp.scan_info[x]; - // is it a scan all or target scan - if (wfx_rsi.scan_ssid != NULL && - (strncmp(wfx_rsi.scan_ssid, (char *) scan->ssid, MIN(strlen(wfx_rsi.scan_ssid), sizeof(scan->ssid))) == - CMP_SUCCESS)) - { - strncpy(ap.ssid, (char *) scan->ssid, MIN(sizeof(ap.ssid), sizeof(scan->ssid))); - ap.security = static_cast(scan->security_mode); - ap.rssi = (-1) * scan->rssi_val; - configASSERT(sizeof(ap.bssid) >= BSSID_LEN); - configASSERT(sizeof(scan->bssid) >= BSSID_LEN); - memcpy(ap.bssid, scan->bssid, BSSID_LEN); - (*wfx_rsi.scan_cb)(&ap); - - if (wfx_rsi.scan_ssid) - { - break; // we found the targeted ssid. - } - } + continue; // we found the targeted ssid. } + // TODO: convert security mode from RSI to WFX + ap.security = static_cast(scan->security_mode); + ap.rssi = (-1) * scan->rssi_val; + + configASSERT(sizeof(ap.bssid) == BSSID_LEN); + configASSERT(sizeof(scan->bssid) == BSSID_LEN); + memcpy(ap.bssid, scan->bssid, BSSID_LEN); + (*wfx_rsi.scan_cb)(&ap); + + // no ssid filter set, return all results + if (wfx_rsi.scan_ssid_length == 0) + { + continue; + } + + break; } /* Terminate with end of scan which is no ap sent back */ - (*wfx_rsi.scan_cb)((wfx_wifi_scan_result_t *) 0); - wfx_rsi.scan_cb = (void (*)(wfx_wifi_scan_result_t *)) 0; + (*wfx_rsi.scan_cb)((wfx_wifi_scan_result_t *) NULL); + wfx_rsi.scan_cb = nullptr; if (wfx_rsi.scan_ssid) { - vPortFree(wfx_rsi.scan_ssid); - wfx_rsi.scan_ssid = (char *) 0; + chip::Platform::MemoryFree(wfx_rsi.scan_ssid); + wfx_rsi.scan_ssid = NULL; } #endif /* SL_WFX_CONFIG_SCAN */ } @@ -819,14 +831,14 @@ void wfx_rsi_task(void * arg) uint32_t rsi_status = wfx_rsi_init(); if (rsi_status != RSI_SUCCESS) { - SILABS_LOG("wfx_rsi_task: error: wfx_rsi_init with status: %02x", rsi_status); + ChipLogError(DeviceLayer, "wfx_rsi_task: wfx_rsi_init failed: %ld", rsi_status); return; } WfxEvent_t wfxEvent; wfx_lwip_start(); wfx_started_notify(); - SILABS_LOG("Starting event loop"); + ChipLogProgress(DeviceLayer, "wfx_rsi_task: starting event loop"); for (;;) { osStatus_t status = osMessageQueueGet(sWifiEventQueue, &wfxEvent, NULL, osWaitForever); @@ -836,7 +848,7 @@ void wfx_rsi_task(void * arg) } else { - SILABS_LOG("Failed to get event with status: %x", status); + ChipLogProgress(DeviceLayer, "wfx_rsi_task: get event failed: %x", status); } } } @@ -859,8 +871,8 @@ void wfx_dhcp_got_ipv4(uint32_t ip) wfx_rsi.ip4_addr[1] = (ip >> 8) & HEX_VALUE_FF; wfx_rsi.ip4_addr[2] = (ip >> 16) & HEX_VALUE_FF; wfx_rsi.ip4_addr[3] = (ip >> 24) & HEX_VALUE_FF; - SILABS_LOG("wfx_dhcp_got_ipv4: DHCP OK: IP=%d.%d.%d.%d", wfx_rsi.ip4_addr[0], wfx_rsi.ip4_addr[1], wfx_rsi.ip4_addr[2], - wfx_rsi.ip4_addr[3]); + ChipLogProgress(DeviceLayer, "DHCP OK: IP=%d.%d.%d.%d", wfx_rsi.ip4_addr[0], wfx_rsi.ip4_addr[1], wfx_rsi.ip4_addr[2], + wfx_rsi.ip4_addr[3]); /* Notify the Connectivity Manager - via the app */ wfx_rsi.dev_state |= WFX_RSI_ST_STA_DHCP_DONE; wfx_ip_changed_notify(IP_STATUS_SUCCESS); @@ -875,14 +887,14 @@ void wfx_dhcp_got_ipv4(uint32_t ip) * see also: int32_t rsi_wlan_send_data_xx(uint8_t *buffer, uint32_t length) */ /******************************************************************************************** - * @fn void *wfx_rsi_alloc_pkt() + * @fn void *wfx_rsi_alloc_pkt(void) * @brief * Allocate packet to send data * @param[in] None * @return * None **********************************************************************************************/ -void * wfx_rsi_alloc_pkt() +void * wfx_rsi_alloc_pkt(void) { rsi_pkt_t * pkt; diff --git a/examples/platform/silabs/efr32/wf200/host_if.cpp b/examples/platform/silabs/efr32/wf200/host_if.cpp index 8247e385f61bcf..044ecc6e978cbd 100644 --- a/examples/platform/silabs/efr32/wf200/host_if.cpp +++ b/examples/platform/silabs/efr32/wf200/host_if.cpp @@ -42,6 +42,9 @@ #include "dhcp_client.h" #include "ethernetif.h" +#include +#include +#include #include using namespace ::chip; @@ -91,7 +94,7 @@ struct netif * sta_netif; wfx_wifi_provision_t wifi_provision; sl_wfx_get_counters_cnf_t * counters; sl_wfx_get_counters_cnf_t * Tempcounters; -#define PUT_COUNTER(name) SILABS_LOG("%-24s %lu\r\n", #name, (unsigned long) counters->body.count_##name); +#define PUT_COUNTER(name) ChipLogDetail(DeviceLayer, "%-24s %lu", #name, (unsigned long) counters->body.count_##name); bool hasNotifiedIPV6 = false; bool hasNotifiedIPV4 = false; @@ -108,6 +111,7 @@ static struct scan_result_holder static uint8_t scan_count = 0; static void (*scan_cb)(wfx_wifi_scan_result_t *); /* user-callback - when scan is done */ static char * scan_ssid; /* Which one are we scanning for */ +size_t scan_ssid_length = 0; static void sl_wfx_scan_result_callback(sl_wfx_scan_result_ind_body_t * scan_result); static void sl_wfx_scan_complete_callback(uint32_t status); #endif /* SL_WFX_CONFIG_SCAN */ @@ -133,7 +137,7 @@ extern uint32_t gOverrunCount; * @brief * Creates WFX events processing task. ******************************************************************************/ -static void wfx_events_task_start() +static void wfx_events_task_start(void) { /* create an event group to track Wi-Fi events */ sl_wfx_event_group = xEventGroupCreateStatic(&wfxEventGroup); @@ -142,7 +146,7 @@ static void wfx_events_task_start() wfxEventTaskStack, &wfxEventTaskBuffer); if (NULL == wfx_events_task_handle) { - SILABS_LOG("Failed to create WFX wfx_events"); + ChipLogError(DeviceLayer, "Failed to create WFX wfx_events"); } } @@ -159,7 +163,7 @@ sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload) { /******** INDICATION ********/ case SL_WFX_STARTUP_IND_ID: { - SILABS_LOG("WFX Startup Completed\r\n"); + ChipLogProgress(DeviceLayer, "startup completed."); PlatformMgrImpl().HandleWFXSystemEvent(WIFI_EVENT, event_payload); break; } @@ -237,34 +241,21 @@ sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload) } case SL_WFX_EXCEPTION_IND_ID: { sl_wfx_exception_ind_t * firmware_exception = (sl_wfx_exception_ind_t *) event_payload; - uint8_t * exception_tmp = (uint8_t *) firmware_exception; - SILABS_LOG("firmware exception\r\n"); - for (uint16_t i = 0; i < firmware_exception->header.length; i += 16) - { - SILABS_LOG("hif: %.8x:", i); - for (uint8_t j = 0; (j < 16) && ((i + j) < firmware_exception->header.length); j++) - { - SILABS_LOG(" %.2x", *exception_tmp); - exception_tmp++; - } - SILABS_LOG("\r\n"); - } + ChipLogError(DeviceLayer, "event: SL_WFX_EXCEPTION_IND_ID"); + ChipLogError(DeviceLayer, "firmware_exception->header.length: %d", firmware_exception->header.length); + // create a bytespan header.length with exception payload + ByteSpan exception_byte_span = ByteSpan((uint8_t *) firmware_exception, firmware_exception->header.length); + ChipLogByteSpan(DeviceLayer, exception_byte_span); break; } case SL_WFX_ERROR_IND_ID: { sl_wfx_error_ind_t * firmware_error = (sl_wfx_error_ind_t *) event_payload; - uint8_t * error_tmp = (uint8_t *) firmware_error; - SILABS_LOG("firmware error %lu\r\n", firmware_error->body.type); - for (uint16_t i = 0; i < firmware_error->header.length; i += 16) - { - SILABS_LOG("hif: %.8x:", i); - for (uint8_t j = 0; (j < 16) && ((i + j) < firmware_error->header.length); j++) - { - SILABS_LOG(" %.2x", *error_tmp); - error_tmp++; - } - SILABS_LOG("\r\n"); - } + ChipLogError(DeviceLayer, "event: SL_WFX_ERROR_IND_ID"); + ChipLogError(DeviceLayer, "firmware_error->type: %lu", firmware_error->body.type); + ChipLogError(DeviceLayer, "firmware_error->header.length: %d", firmware_error->header.length); + // create a bytespan header.length with error payload + ByteSpan error_byte_span = ByteSpan((uint8_t *) firmware_error, firmware_error->header.length); + ChipLogByteSpan(DeviceLayer, error_byte_span); break; } } @@ -282,28 +273,26 @@ static void sl_wfx_scan_result_callback(sl_wfx_scan_result_ind_body_t * scan_res { struct scan_result_holder * ap; - SILABS_LOG("# %2d %2d %03d %02X:%02X:%02X:%02X:%02X:%02X %s", scan_count, scan_result->channel, - ((int16_t) (scan_result->rcpi - 220) / 2), scan_result->mac[0], scan_result->mac[1], scan_result->mac[2], - scan_result->mac[3], scan_result->mac[4], scan_result->mac[5], scan_result->ssid_def.ssid); - /*Report one AP information*/ - SILABS_LOG("\r\n"); + ChipLogDetail(DeviceLayer, "# %2d %2d %03d %02X:%02X:%02X:%02X:%02X:%02X %s", scan_count, scan_result->channel, + ((int16_t) (scan_result->rcpi - 220) / 2), scan_result->mac[0], scan_result->mac[1], scan_result->mac[2], + scan_result->mac[3], scan_result->mac[4], scan_result->mac[5], scan_result->ssid_def.ssid); + /* Report one AP information */ /* don't save if filter only wants specific ssid */ - if (scan_ssid != (char *) 0) + if (scan_ssid != nullptr) { if (strcmp(scan_ssid, (char *) &scan_result->ssid_def.ssid[0]) != CMP_SUCCESS) return; } - if ((ap = (struct scan_result_holder *) pvPortMalloc(sizeof(*ap))) == (struct scan_result_holder *) 0) + if ((ap = (struct scan_result_holder *) (chip::Platform::MemoryAlloc(sizeof(*ap)))) == (struct scan_result_holder *) 0) { - SILABS_LOG("*ERR*Scan: No Mem"); + ChipLogError(DeviceLayer, "Scan: No Mem"); } else { ap->next = scan_save; scan_save = ap; /* Not checking if scan_result->ssid_length is < 33 */ - memcpy(ap->scan.ssid, scan_result->ssid_def.ssid, scan_result->ssid_def.ssid_length); - ap->scan.ssid[scan_result->ssid_def.ssid_length] = 0; /* make sure about null terminate */ + chip::Platform::CopyString(ap->scan.ssid, sizeof(ap->scan.ssid), (char *) &scan_result->ssid_def.ssid[0]); /* We do it in this order WPA3 first */ /* No EAP supported - Is this required */ ap->scan.security = WFX_SEC_UNSPECIFIED; @@ -363,7 +352,7 @@ static void sl_wfx_connect_callback(sl_wfx_connect_ind_body_t connect_indication switch (status) { case WFM_STATUS_SUCCESS: { - SILABS_LOG("STA-Connected\r\n"); + ChipLogProgress(DeviceLayer, "STA-Connected"); memcpy(&ap_mac.octet[0], mac, MAC_ADDRESS_FIRST_OCTET); sl_wfx_context->state = static_cast(static_cast(sl_wfx_context->state) | static_cast(SL_WFX_STA_INTERFACE_CONNECTED)); @@ -371,27 +360,27 @@ static void sl_wfx_connect_callback(sl_wfx_connect_ind_body_t connect_indication break; } case WFM_STATUS_NO_MATCHING_AP: { - SILABS_LOG("WFX Connection failed, access point not found\r\n"); + ChipLogError(DeviceLayer, "Connection failed, access point not found"); break; } case WFM_STATUS_CONNECTION_ABORTED: { - SILABS_LOG("WFX Connection aborted\r\n"); + ChipLogError(DeviceLayer, "Connection aborted"); break; } case WFM_STATUS_CONNECTION_TIMEOUT: { - SILABS_LOG("WFX Connection timeout\r\n"); + ChipLogError(DeviceLayer, "Connection timeout"); break; } case WFM_STATUS_CONNECTION_REJECTED_BY_AP: { - SILABS_LOG("WFX Connection rejected by the access point\r\n"); + ChipLogError(DeviceLayer, "Connection rejected by the access point"); break; } case WFM_STATUS_CONNECTION_AUTH_FAILURE: { - SILABS_LOG("WFX Connection authentication failure\r\n"); + ChipLogError(DeviceLayer, "Connection authentication failure"); break; } default: { - SILABS_LOG("WF Connection attempt error\r\n"); + ChipLogError(DeviceLayer, "Connection attempt error"); } } @@ -399,7 +388,7 @@ static void sl_wfx_connect_callback(sl_wfx_connect_ind_body_t connect_indication { retryJoin += 1; retryInProgress = false; - SILABS_LOG("WFX Retry to connect to network count: %d", retryJoin); + ChipLogProgress(DeviceLayer, "Retry to connect to network count: %d", retryJoin); sl_wfx_context->state = static_cast(static_cast(sl_wfx_context->state) & ~static_cast(SL_WFX_STARTED)); wfx_retry_connection(retryJoin); @@ -415,7 +404,7 @@ static void sl_wfx_connect_callback(sl_wfx_connect_ind_body_t connect_indication static void sl_wfx_disconnect_callback(uint8_t * mac, uint16_t reason) { (void) (mac); - SILABS_LOG("WFX Disconnected %d\r\n", reason); + ChipLogProgress(DeviceLayer, "Disconnected %d", reason); sl_wfx_context->state = static_cast(static_cast(sl_wfx_context->state) & ~static_cast(SL_WFX_STA_INTERFACE_CONNECTED)); retryInProgress = false; @@ -430,18 +419,10 @@ static void sl_wfx_disconnect_callback(uint8_t * mac, uint16_t reason) *****************************************************************************/ static void sl_wfx_start_ap_callback(uint32_t status) { - if (status == AP_START_SUCCESS) - { - SILABS_LOG("AP started\r\n"); - sl_wfx_context->state = - static_cast(static_cast(sl_wfx_context->state) | static_cast(SL_WFX_AP_INTERFACE_UP)); - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_START_AP); - } - else - { - SILABS_LOG("AP start failed\r\n"); - strcpy(event_log, "AP start failed"); - } + VerifyOrReturnLogError(status == AP_START_SUCCESS, CHIP_ERROR_INTERNAL); + sl_wfx_context->state = + static_cast(static_cast(sl_wfx_context->state) | static_cast(SL_WFX_AP_INTERFACE_UP)); + xEventGroupSetBits(sl_wfx_event_group, SL_WFX_START_AP); } /**************************************************************************** @@ -452,7 +433,7 @@ static void sl_wfx_stop_ap_callback(void) { // TODO // dhcpserver_clear_stored_mac(); - SILABS_LOG("SoftAP stopped\r\n"); + ChipLogProgress(DeviceLayer, "SoftAP stopped"); sl_wfx_context->state = static_cast(static_cast(sl_wfx_context->state) & ~static_cast(SL_WFX_AP_INTERFACE_UP)); xEventGroupSetBits(sl_wfx_event_group, SL_WFX_STOP_AP); @@ -465,9 +446,8 @@ static void sl_wfx_stop_ap_callback(void) *****************************************************************************/ static void sl_wfx_client_connected_callback(uint8_t * mac) { - SILABS_LOG("Client connected, MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - // TODO - SILABS_LOG("Open a web browser and go to http://%d.%d.%d.%d\r\n", ap_ip_addr0, ap_ip_addr1, ap_ip_addr2, ap_ip_addr3); + ChipLogProgress(DeviceLayer, "Client connected, MAC: %02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], + mac[5]); } /**************************************************************************** @@ -478,8 +458,8 @@ static void sl_wfx_client_connected_callback(uint8_t * mac) *****************************************************************************/ static void sl_wfx_ap_client_rejected_callback(uint32_t status, uint8_t * mac) { - SILABS_LOG("Client rejected, reason: %d, MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", (int) status, mac[0], mac[1], mac[2], mac[3], - mac[4], mac[5]); + ChipLogError(DeviceLayer, "Client rejected, reason: %d, MAC: %02X:%02X:%02X:%02X:%02X:%02X", (int) status, mac[0], mac[1], + mac[2], mac[3], mac[4], mac[5]); } /**************************************************************************** @@ -490,9 +470,8 @@ static void sl_wfx_ap_client_rejected_callback(uint32_t status, uint8_t * mac) *****************************************************************************/ static void sl_wfx_ap_client_disconnected_callback(uint32_t status, uint8_t * mac) { - // TODO - SILABS_LOG("Client disconnected, reason: %d, MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", (int) status, mac[0], mac[1], mac[2], - mac[3], mac[4], mac[5]); + ChipLogError(DeviceLayer, "Client disconnected, reason: %d, MAC: %02X:%02X:%02X:%02X:%02X:%02X", (int) status, mac[0], mac[1], + mac[2], mac[3], mac[4], mac[5]); } #endif /* SL_WFX_CONFIG_SOFTAP */ @@ -504,7 +483,6 @@ static void sl_wfx_ap_client_disconnected_callback(uint32_t status, uint8_t * ma static void sl_wfx_generic_status_callback(sl_wfx_generic_ind_t * frame) { (void) (frame); - SILABS_LOG("WFX Generic status received\r\n"); } /*************************************************************************** @@ -534,7 +512,7 @@ static void wfx_events_task(void * p_arg) pdTRUE, pdFALSE, pdMS_TO_TICKS(250)); /* 250 msec delay converted to ticks */ if (flags & SL_WFX_RETRY_CONNECT) { - SILABS_LOG("WFX sending the connect command"); + ChipLogProgress(DeviceLayer, "sending the connect command"); wfx_connect_to_ap(); } @@ -551,7 +529,7 @@ static void wfx_events_task(void * p_arg) hasNotifiedIPV4 = true; if (!hasNotifiedWifiConnectivity) { - SILABS_LOG("WIFI: Has Notified Wifi Connectivity"); + ChipLogProgress(DeviceLayer, "will notify WiFi connectivity"); wfx_connected_notify(CONNECTION_STATUS_SUCCESS, &ap_mac); hasNotifiedWifiConnectivity = true; } @@ -585,7 +563,7 @@ static void wfx_events_task(void * p_arg) wfx_ipv6_notify(GET_IPV6_FAIL); hasNotifiedIPV6 = false; hasNotifiedWifiConnectivity = false; - SILABS_LOG("WIFI: Connected to AP"); + ChipLogProgress(DeviceLayer, "connected to AP"); wifi_extra |= WE_ST_STA_CONN; retryJoin = 0; wfx_lwip_set_sta_link_up(); @@ -593,7 +571,7 @@ static void wfx_events_task(void * p_arg) if (!(wfx_get_wifi_state() & SL_WFX_AP_INTERFACE_UP)) { // Enable the power save - SILABS_LOG("WF200 going to DTIM based sleep"); + ChipLogProgress(DeviceLayer, "WF200 going to DTIM based sleep"); sl_wfx_set_power_mode(WFM_PM_MODE_DTIM, WFM_PM_POLL_FAST_PS, BEACON_1, 0 /*timeout*/); sl_wfx_enable_device_power_save(); } @@ -637,9 +615,10 @@ static void wfx_events_task(void * p_arg) sp = (sl_wfx_ssid_def_t *) 0; } - SILABS_LOG("WIFI Scan Paramter set to Active channel time %d, Passive " - "Channel Time: %d, Number of prob: %d", - ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); + ChipLogDetail(DeviceLayer, + "WIFI Scan Paramter set to Active channel time %d, Passive " + "Channel Time: %d, Number of prob: %d", + ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); (void) sl_wfx_set_scan_parameters(ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); (void) sl_wfx_send_scan_command(WFM_SCAN_MODE_ACTIVE, CHANNEL_LIST, /* Channel list */ CHANNEL_COUNT, /* Scan all chans */ @@ -650,20 +629,20 @@ static void wfx_events_task(void * p_arg) { struct scan_result_holder *hp, *next; - SILABS_LOG("WIFI: Return %d scan results", scan_count); + ChipLogDetail(DeviceLayer, "WIFI: Return %d scan results", scan_count); for (hp = scan_save; hp; hp = next) { next = hp->next; (*scan_cb)(&hp->scan); - vPortFree(hp); + chip::Platform::MemoryFree(hp); } (*scan_cb)((wfx_wifi_scan_result *) 0); scan_save = (struct scan_result_holder *) 0; scan_count = 0; if (scan_ssid) { - vPortFree(scan_ssid); - scan_ssid = (char *) 0; + chip::Platform::MemoryFree(scan_ssid); + scan_ssid = NULL; } /* Terminate scan */ scan_cb = 0; @@ -681,15 +660,15 @@ static sl_status_t wfx_init(void) /* Initialize the WF200 used by the two interfaces */ wfx_events_task_start(); sl_status_t status = sl_wfx_init(&wifiContext); - SILABS_LOG("FMAC Driver version %s", FMAC_DRIVER_VERSION_STRING); + ChipLogProgress(DeviceLayer, "FMAC Driver version: %s", FMAC_DRIVER_VERSION_STRING); switch (status) { case SL_STATUS_OK: - SILABS_LOG("WF200 FW ver:%d.%d.%d [MAC %02x:%02x:%02x-%02x:%02x:%02x]", wifiContext.firmware_major, - wifiContext.firmware_minor, wifiContext.firmware_build, wifiContext.mac_addr_0.octet[0], - wifiContext.mac_addr_0.octet[1], wifiContext.mac_addr_0.octet[2], wifiContext.mac_addr_0.octet[3], - wifiContext.mac_addr_0.octet[4], wifiContext.mac_addr_0.octet[5]); - SILABS_LOG("WF200 Init OK"); + ChipLogProgress(DeviceLayer, "WF200 FW ver:%d.%d.%d [MAC %02x:%02x:%02x-%02x:%02x:%02x]", wifiContext.firmware_major, + wifiContext.firmware_minor, wifiContext.firmware_build, wifiContext.mac_addr_0.octet[0], + wifiContext.mac_addr_0.octet[1], wifiContext.mac_addr_0.octet[2], wifiContext.mac_addr_0.octet[3], + wifiContext.mac_addr_0.octet[4], wifiContext.mac_addr_0.octet[5]); + ChipLogProgress(DeviceLayer, "WF200 Init OK"); if (wifiContext.state == SL_WFX_STA_INTERFACE_CONNECTED) { @@ -698,19 +677,19 @@ static sl_status_t wfx_init(void) break; case SL_STATUS_WIFI_INVALID_KEY: - SILABS_LOG("*ERR*WF200: F/W keyset invalid"); + ChipLogError(DeviceLayer, "WF200: F/W keyset invalid"); break; case SL_STATUS_WIFI_FIRMWARE_DOWNLOAD_TIMEOUT: - SILABS_LOG("*ERR*WF200: F/W download timo"); + ChipLogError(DeviceLayer, "WF200: F/W download timo"); break; case SL_STATUS_TIMEOUT: - SILABS_LOG("*ERR*WF200: Poll for value timo"); + ChipLogError(DeviceLayer, "WF200: Poll for value timo"); break; case SL_STATUS_FAIL: - SILABS_LOG("*ERR*WF200: Error"); + ChipLogError(DeviceLayer, "WF200: Error"); break; default: - SILABS_LOG("*ERR*WF200: Unknown"); + ChipLogError(DeviceLayer, "WF200: Unknown"); } return status; @@ -728,22 +707,22 @@ static void wfx_wifi_hw_start(void) if (wifi_extra & WE_ST_HW_STARTED) return; - SILABS_LOG("STARTING WF200\n"); + ChipLogDetail(DeviceLayer, "STARTING WF200"); wifi_extra |= WE_ST_HW_STARTED; sl_wfx_host_gpio_init(); if ((status = wfx_init()) == SL_STATUS_OK) { /* Initialize the LwIP stack */ - SILABS_LOG("WF200:Start LWIP"); + ChipLogDetail(DeviceLayer, "WF200:Start LWIP"); wfx_lwip_start(); wfx_started_notify(); wifiContext.state = SL_WFX_STARTED; /* Really this is a bit mask */ - SILABS_LOG("WF200:ready.."); + ChipLogDetail(DeviceLayer, "WF200:ready.."); } else { - SILABS_LOG("*ERR*WF200:init failed"); + ChipLogError(DeviceLayer, "WF200:init failed"); } } @@ -756,23 +735,22 @@ static void wfx_wifi_hw_start(void) int32_t wfx_get_ap_info(wfx_wifi_scan_result_t * ap) { int32_t signal_strength; - SILABS_LOG("WIFI:SSID:: %s", &ap_info.ssid[0]); - memcpy(ap->ssid, ap_info.ssid, sizeof(ap_info.ssid)); - SILABS_LOG("WIFI:Mac addr:: %02x:%02x:%02x:%02x:%02x:%02x", ap_info.bssid[0], ap_info.bssid[1], ap_info.bssid[2], - ap_info.bssid[3], ap_info.bssid[4], ap_info.bssid[5]); + + ap->ssid_length = strnlen(ap_info.ssid, chip::min(sizeof(ap_info.ssid), WFX_MAX_SSID_LENGTH)); + chip::Platform::CopyString(ap->ssid, ap->ssid_length, ap_info.ssid); memcpy(ap->bssid, ap_info.bssid, sizeof(ap_info.bssid)); ap->security = ap_info.security; - SILABS_LOG("WIFI:security:: %d", ap->security); - ap->chan = ap_info.chan; - SILABS_LOG("WIFI:Channel:: to %d", ap->chan); + ap->chan = ap_info.chan; + ChipLogDetail(DeviceLayer, "WIFI:SSID :: %s", &ap_info.ssid[0]); + ChipLogDetail(DeviceLayer, "WIFI:BSSID :: %02x:%02x:%02x:%02x:%02x:%02x", ap_info.bssid[0], ap_info.bssid[1], + ap_info.bssid[2], ap_info.bssid[3], ap_info.bssid[4], ap_info.bssid[5]); + ChipLogDetail(DeviceLayer, "WIFI:security :: %d", ap->security); + ChipLogDetail(DeviceLayer, "WIFI:channel :: %d", ap->chan); sl_status_t status = sl_wfx_get_signal_strength((uint32_t *) &signal_strength); - - if (status == SL_STATUS_OK) - { - SILABS_LOG("status SL_STATUS_OK & signal_strength:: %d", signal_strength); - ap->rssi = (signal_strength - 220) / 2; - } + VerifyOrReturnError(status == SL_STATUS_OK, status); + ChipLogDetail(DeviceLayer, "signal_strength: %ld", signal_strength); + ap->rssi = (signal_strength - 220) / 2; return status; } @@ -788,7 +766,7 @@ int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t * extra_info) status = get_all_counters(); if (status != SL_STATUS_OK) { - SILABS_LOG("Failed to get the couters"); + ChipLogError(DeviceLayer, "Failed to get the couters"); } else { @@ -808,15 +786,13 @@ sl_status_t get_all_counters(void) sl_status_t result; uint8_t command_id = 0x05; uint16_t mib_id = 0x2035; - sl_wfx_mib_req_t * request = NULL; + sl_wfx_mib_req_t * request = nullptr; uint32_t request_length = SL_WFX_ROUND_UP_EVEN(sizeof(sl_wfx_header_mib_t) + sizeof(sl_wfx_mib_req_body_t)); result = sl_wfx_allocate_command_buffer((sl_wfx_generic_message_t **) &request, command_id, SL_WFX_CONTROL_BUFFER, request_length); - if (request == NULL) - { - } + VerifyOrReturnError(request != nullptr, SL_STATUS_NULL_POINTER); request->body.mib_id = mib_id; request->header.interface = 0x2; @@ -828,8 +804,8 @@ sl_status_t get_all_counters(void) result = sl_wfx_host_wait_for_confirmation(command_id, SL_WFX_DEFAULT_REQUEST_TIMEOUT_MS, (void **) &counters); SL_WFX_ERROR_CHECK(result); - SILABS_LOG("%-24s %12s \r\n", "", "Debug Counters Content"); - SILABS_LOG("%-24s %lu\r\n", "rcpi", (unsigned long) counters->body.rcpi); + ChipLogDetail(DeviceLayer, "%-24s %12s ", "", "Debug Counters Content"); + ChipLogDetail(DeviceLayer, "%-24s %lu", "rcpi", (unsigned long) counters->body.rcpi); PUT_COUNTER(plcp_errors); PUT_COUNTER(fcs_errors); PUT_COUNTER(tx_packets); @@ -865,7 +841,7 @@ sl_status_t get_all_counters(void) sl_wfx_context->used_buffers--; } } - if (request != NULL) + if (request != nullptr) { sl_wfx_free_command_buffer((sl_wfx_generic_message_t *) request, command_id, SL_WFX_CONTROL_BUFFER); } @@ -878,7 +854,7 @@ sl_status_t get_all_counters(void) * reset the count * @return returns -1 **************************************************************************/ -int32_t wfx_reset_counts() +int32_t wfx_reset_counts(void) { /* TODO */ return -1; @@ -893,7 +869,7 @@ sl_status_t wfx_wifi_start(void) { if (wifi_extra & WE_ST_STARTED) { - SILABS_LOG("WIFI: Already started"); + ChipLogDetail(DeviceLayer, "WIFI: Already started"); return SL_STATUS_OK; } wifi_extra |= WE_ST_STARTED; @@ -921,7 +897,7 @@ sl_wfx_state_t wfx_get_wifi_state(void) *****************************************************************************/ struct netif * wfx_GetNetif(sl_wfx_interface_t interface) { - struct netif * SelectedNetif = NULL; + struct netif * SelectedNetif = nullptr; if (interface == SL_WFX_STA_INTERFACE) { SelectedNetif = sta_netif; @@ -955,10 +931,10 @@ sl_wfx_mac_address_t wfx_get_wifi_mac_addr(sl_wfx_interface_t interface) *****************************************************************************/ void wfx_set_wifi_provision(wfx_wifi_provision_t * wifiConfig) { - memcpy(wifi_provision.ssid, wifiConfig->ssid, sizeof(wifiConfig->ssid)); - memcpy(wifi_provision.passkey, wifiConfig->passkey, sizeof(wifiConfig->passkey)); + Platform::CopyString(wifi_provision.ssid, sizeof(wifi_provision.ssid), wifiConfig->ssid); + Platform::CopyString(wifi_provision.passkey, sizeof(wifi_provision.passkey), wifiConfig->passkey); wifi_provision.security = wifiConfig->security; - SILABS_LOG("WIFI: Provision SSID=%s", &wifi_provision.ssid[0]); + ChipLogProgress(DeviceLayer, "WIFI: Provision SSID=%s", &wifi_provision.ssid[0]); } /**************************************************************************** @@ -970,12 +946,8 @@ void wfx_set_wifi_provision(wfx_wifi_provision_t * wifiConfig) *****************************************************************************/ bool wfx_get_wifi_provision(wfx_wifi_provision_t * wifiConfig) { - if (wifiConfig == NULL) - { - return false; - } + VerifyOrReturnError(wifiConfig != nullptr, false); memcpy(wifiConfig, &wifi_provision, sizeof(wfx_wifi_provision_t)); - return true; } @@ -1012,15 +984,13 @@ sl_status_t wfx_connect_to_ap(void) sl_status_t result; sl_wfx_security_mode_t connect_security_mode; - if (wifi_provision.ssid[0] == 0) - { - return SL_STATUS_NOT_AVAILABLE; - } - SILABS_LOG("WIFI:JOIN to %s", &wifi_provision.ssid[0]); + VerifyOrReturnError(wifi_provision.ssid[0], SL_STATUS_NOT_AVAILABLE); + ChipLogDetail(DeviceLayer, "WIFI:JOIN to %s", &wifi_provision.ssid[0]); - SILABS_LOG("WIFI Scan Paramter set to Active channel time %d, Passive Channel " - "Time: %d, Number of prob: %d", - ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); + ChipLogDetail(DeviceLayer, + "WIFI Scan Paramter set to Active channel time %d, Passive Channel " + "Time: %d, Number of prob: %d", + ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); (void) sl_wfx_set_scan_parameters(ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); switch (wifi_provision.security) { @@ -1038,7 +1008,7 @@ sl_status_t wfx_connect_to_ap(void) connect_security_mode = sl_wfx_security_mode_e::WFM_SECURITY_MODE_OPEN; break; default: - SILABS_LOG("%s: error: unknown security type."); + ChipLogError(DeviceLayer, "error: unknown security type."); return SL_STATUS_INVALID_STATE; } result = sl_wfx_send_join_command((uint8_t *) wifi_provision.ssid, strlen(wifi_provision.ssid), NULL, CHANNEL_0, @@ -1064,8 +1034,8 @@ void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * mac = &wifiContext.mac_addr_0; #endif *addr = *mac; - SILABS_LOG("WLAN:Get WiFi Mac addr %02x:%02x:%02x:%02x:%02x:%02x", mac->octet[0], mac->octet[1], mac->octet[2], mac->octet[3], - mac->octet[4], mac->octet[5]); + ChipLogDetail(DeviceLayer, "WLAN:Get WiFi Mac addr %02x:%02x:%02x:%02x:%02x:%02x", mac->octet[0], mac->octet[1], mac->octet[2], + mac->octet[3], mac->octet[4], mac->octet[5]); memcpy(&ap_info.bssid[0], &mac->octet[0], 6); } @@ -1078,14 +1048,8 @@ void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * *****************************************************************************/ bool wfx_have_ipv4_addr(sl_wfx_interface_t which_if) { - if (which_if == SL_WFX_STA_INTERFACE) - { - return (sta_ip == STA_IP_FAIL) ? false : true; - } - else - { - return false; /* TODO */ - } + VerifyOrReturnError(which_if == SL_WFX_STA_INTERFACE, false); + return (sta_ip == STA_IP_FAIL) ? false : true; } /**************************************************************************** @@ -1097,18 +1061,8 @@ bool wfx_have_ipv4_addr(sl_wfx_interface_t which_if) *****************************************************************************/ bool wfx_have_ipv6_addr(sl_wfx_interface_t which_if) { - SILABS_LOG("%s: started.", __func__); - bool status = false; - if (which_if == SL_WFX_STA_INTERFACE) - { - status = wfx_is_sta_connected(); - } - else - { - status = false; /* TODO */ - } - SILABS_LOG("%s: status: %d", __func__, status); - return status; + VerifyOrReturnError(which_if == SL_WFX_STA_INTERFACE, false); + return wfx_is_sta_connected(); } /**************************************************************************** @@ -1119,7 +1073,7 @@ bool wfx_have_ipv6_addr(sl_wfx_interface_t which_if) *****************************************************************************/ sl_status_t wfx_sta_discon(void) { - SILABS_LOG("STA-Disconnecting"); + ChipLogProgress(DeviceLayer, "STA-Disconnecting"); int32_t status = sl_wfx_send_disconnect_command(); wifi_extra &= ~WE_ST_STA_CONN; xEventGroupSetBits(sl_wfx_event_group, SL_WFX_RETRY_CONNECT); @@ -1145,11 +1099,7 @@ bool wfx_is_sta_mode_enabled(void) bool wfx_is_sta_connected(void) { bool val; - val = (wifi_extra & WE_ST_STA_CONN) ? true : false; - - SILABS_LOG("WLAN: STA %s connected", (val ? "IS" : "NOT")); - return val; } @@ -1159,10 +1109,7 @@ bool wfx_is_sta_connected(void) * @return returns true if sucessful, * false otherwise *****************************************************************************/ -void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif) -{ - SILABS_LOG("Setup-IP6: TODO"); /* It is automatically done when lwip link up */ -} +void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif) {} /**************************************************************************** * @brief @@ -1170,7 +1117,7 @@ void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif) * @return returns WIFI_MODE_NULL if sucessful, * WIFI_MODE_STA otherwise *****************************************************************************/ -wifi_mode_t wfx_get_wifi_mode() +wifi_mode_t wfx_get_wifi_mode(void) { if (wifiContext.state & SL_WFX_STARTED) return WIFI_MODE_STA; @@ -1234,22 +1181,16 @@ void wfx_enable_sta_mode(void) #ifdef SL_WFX_CONFIG_SCAN bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *)) { - int sz; - - if (scan_cb) - return false; /* Already in progress */ + VerifyOrReturnError(scan_cb != nullptr, false); if (ssid) { - sz = strlen(ssid); - if ((scan_ssid = (char *) pvPortMalloc(sz + 1)) == (char *) 0) - { - return false; - } - strcpy(scan_ssid, ssid); + scan_ssid_length = strnlen(ssid, WFX_MAX_SSID_LENGTH); + scan_ssid = reinterpret_cast(chip::Platform::MemoryAlloc(scan_ssid_length)); + VerifyOrReturnError(scan_ssid != nullptr, false); + Platform::CopyString(scan_ssid, scan_ssid_length, ssid); } scan_cb = callback; xEventGroupSetBits(sl_wfx_event_group, SL_WFX_SCAN_START); - return true; } @@ -1261,23 +1202,20 @@ void wfx_cancel_scan(void) { struct scan_result_holder *hp, *next; /* Not possible */ - if (!scan_cb) - { - return; - } + VerifyOrReturn(scan_cb != nullptr); sl_wfx_send_stop_scan_command(); for (hp = scan_save; hp; hp = next) { next = hp->next; - vPortFree(hp); + chip::Platform::MemoryFree(hp); } scan_save = (struct scan_result_holder *) 0; scan_count = 0; if (scan_ssid) { - vPortFree(scan_ssid); - scan_ssid = (char *) 0; + chip::Platform::MemoryFree(scan_ssid); + scan_ssid = nullptr; } - scan_cb = 0; + scan_cb = nullptr; } #endif /* SL_WFX_CONFIG_SCAN */ diff --git a/examples/platform/silabs/wfx_rsi.h b/examples/platform/silabs/wfx_rsi.h index 5e7358e0d02cb1..0e62cb78029a79 100644 --- a/examples/platform/silabs/wfx_rsi.h +++ b/examples/platform/silabs/wfx_rsi.h @@ -77,6 +77,7 @@ typedef struct wfx_rsi_s #ifdef SL_WFX_CONFIG_SCAN void (*scan_cb)(wfx_wifi_scan_result_t *); char * scan_ssid; /* Which one are we scanning for */ + size_t scan_ssid_length; #endif #ifdef SL_WFX_CONFIG_SOFTAP sl_wfx_mac_address_t softap_mac; diff --git a/examples/platform/silabs/wifi/wfx_notify.cpp b/examples/platform/silabs/wifi/wfx_notify.cpp index e1d3c81abf8504..de1becacb33b30 100644 --- a/examples/platform/silabs/wifi/wfx_notify.cpp +++ b/examples/platform/silabs/wifi/wfx_notify.cpp @@ -60,13 +60,13 @@ static void RetryConnectionTimerHandler(void * arg) } } /*********************************************************************************** - * @fn wfx_started_notify() + * @fn wfx_started_notify(void) * @brief * Wifi device started notification * @param[in]: None * @return None *************************************************************************************/ -void wfx_started_notify() +void wfx_started_notify(void) { sl_wfx_startup_ind_t evt; sl_wfx_mac_address_t mac; diff --git a/examples/platform/silabs/wifi/wfx_rsi_host.cpp b/examples/platform/silabs/wifi/wfx_rsi_host.cpp index 921ec82587fe77..130d9c90d19817 100644 --- a/examples/platform/silabs/wifi/wfx_rsi_host.cpp +++ b/examples/platform/silabs/wifi/wfx_rsi_host.cpp @@ -15,16 +15,20 @@ * limitations under the License. */ -#include "stdbool.h" +#include #include #include #include #include "FreeRTOS.h" #include "event_groups.h" -#include "silabs_utils.h" -#include "sl_status.h" #include "task.h" + +#include +#include +#include +#include + #include "wfx_host_events.h" #include "wfx_rsi.h" @@ -54,22 +58,15 @@ constexpr osThreadAttr_t kWlanTaskAttr = { .name = "wlan_rsi", ***********************************************************************/ sl_status_t wfx_wifi_start(void) { - if (wfx_rsi.dev_state & WFX_RSI_ST_STARTED) - { - return SL_STATUS_OK; - } - + VerifyOrReturnError(!(wfx_rsi.dev_state & WFX_RSI_ST_STARTED), SL_STATUS_OK); wfx_rsi.dev_state |= WFX_RSI_ST_STARTED; - SILABS_LOG("%s: starting..", __func__); - /* - * Create the Wifi driver task - */ // Creating a Wi-Fi driver thread sWlanThread = osThreadNew(wfx_rsi_task, NULL, &kWlanTaskAttr); VerifyOrReturnError(sWlanThread != NULL, SL_STATUS_FAIL); + ChipLogProgress(DeviceLayer, "wfx_rsi_task created successfully"); return SL_STATUS_OK; } @@ -110,14 +107,12 @@ bool wfx_is_sta_mode_enabled(void) ***********************************************************************/ void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * addr) { - if (addr) - { + VerifyOrReturn(addr != nullptr); #ifdef SL_WFX_CONFIG_SOFTAP - *addr = (interface == SL_WFX_SOFTAP_INTERFACE) ? wfx_rsi.softap_mac : wfx_rsi.sta_mac; + *addr = (interface == SL_WFX_SOFTAP_INTERFACE) ? wfx_rsi.softap_mac : wfx_rsi.sta_mac; #else - *addr = wfx_rsi.sta_mac; + *addr = wfx_rsi.sta_mac; #endif - } } /********************************************************************* @@ -130,11 +125,9 @@ void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * ***********************************************************************/ void wfx_set_wifi_provision(wfx_wifi_provision_t * cfg) { - if (cfg) - { - wfx_rsi.sec = *cfg; - wfx_rsi.dev_state |= WFX_RSI_ST_STA_PROVISIONED; - } + VerifyOrReturn(cfg != nullptr); + wfx_rsi.sec = *cfg; + wfx_rsi.dev_state |= WFX_RSI_ST_STA_PROVISIONED; } /********************************************************************* @@ -147,15 +140,10 @@ void wfx_set_wifi_provision(wfx_wifi_provision_t * cfg) ***********************************************************************/ bool wfx_get_wifi_provision(wfx_wifi_provision_t * wifiConfig) { - if (wifiConfig != NULL) - { - if (wfx_rsi.dev_state & WFX_RSI_ST_STA_PROVISIONED) - { - *wifiConfig = wfx_rsi.sec; - return true; - } - } - return false; + VerifyOrReturnError(wifiConfig != nullptr, false); + VerifyOrReturnError(wfx_rsi.dev_state & WFX_RSI_ST_STA_PROVISIONED, false); + *wifiConfig = wfx_rsi.sec; + return true; } /********************************************************************* @@ -169,7 +157,7 @@ void wfx_clear_wifi_provision(void) { memset(&wfx_rsi.sec, 0, sizeof(wfx_rsi.sec)); wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_PROVISIONED; - SILABS_LOG("%s: completed.", __func__); + ChipLogProgress(DeviceLayer, "Clear WiFi Provision"); } /************************************************************************* @@ -177,30 +165,25 @@ void wfx_clear_wifi_provision(void) * @brief * Start a JOIN command to the AP - Done by the wfx_rsi task * @param[in] None - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_INVALID_CONFIGURATION otherwise + * @return returns SL_STATUS_OK if successful ****************************************************************************/ sl_status_t wfx_connect_to_ap(void) { + VerifyOrReturnError(wfx_rsi.dev_state & WFX_RSI_ST_STA_PROVISIONED, SL_STATUS_INVALID_CONFIGURATION); + VerifyOrReturnError(wfx_rsi.sec.ssid_length, SL_STATUS_INVALID_CREDENTIALS); + VerifyOrReturnError(wfx_rsi.sec.ssid_length <= WFX_MAX_SSID_LENGTH, SL_STATUS_HAS_OVERFLOWED); + ChipLogProgress(DeviceLayer, "connect to access point: %s", wfx_rsi.sec.ssid); WfxEvent_t event; - if (wfx_rsi.dev_state & WFX_RSI_ST_STA_PROVISIONED) - { - SILABS_LOG("Connecting to access point -> SSID: %s", &wfx_rsi.sec.ssid[0]); - event.eventType = WFX_EVT_STA_START_JOIN; - WfxPostEvent(&event); - } - else - { - SILABS_LOG("Error: access point not provisioned."); - return SL_STATUS_INVALID_CONFIGURATION; - } + event.eventType = WFX_EVT_STA_START_JOIN; + WfxPostEvent(&event); return SL_STATUS_OK; } #if SL_ICD_ENABLED #if SLI_SI917 /********************************************************************* - * @fn sl_status_t wfx_power_save() + * @fn sl_status_t wfx_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_si91x_performance_profile_t + sl_si91x_wifi_state) * @brief * Implements the power save in sleepy application * @param[in] sl_si91x_ble_state : State to set for the BLE @@ -214,14 +197,14 @@ sl_status_t wfx_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_ } #else // For RS9116 /********************************************************************* - * @fn sl_status_t wfx_power_save() + * @fn sl_status_t wfx_power_save(void) * @brief * Implements the power save in sleepy application * @param[in] None * @return SL_STATUS_OK if successful, * SL_STATUS_FAIL otherwise ***********************************************************************/ -sl_status_t wfx_power_save() +sl_status_t wfx_power_save(void) { return (wfx_rsi_power_save() ? SL_STATUS_FAIL : SL_STATUS_OK); } @@ -241,7 +224,6 @@ void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif) * TODO: Implement IPV6 setup, currently in wfx_rsi_task() * This is hooked with MATTER code. */ - SILABS_LOG("%s: warning: not implemented.", __func__); } /********************************************************************* @@ -255,19 +237,18 @@ void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif) bool wfx_is_sta_connected(void) { bool status = (wfx_rsi.dev_state & WFX_RSI_ST_STA_CONNECTED) > 0; - SILABS_LOG("%s: %s", __func__, (status ? "Connected" : "Disconnected")); return status; } /********************************************************************* - * @fn wifi_mode_t wfx_get_wifi_mode() + * @fn wifi_mode_t wfx_get_wifi_mode(void) * @brief * get the wifi mode * @param[in] None * @return return WIFI_MODE_NULL if successful, * WIFI_MODE_STA otherwise ***********************************************************************/ -wifi_mode_t wfx_get_wifi_mode() +wifi_mode_t wfx_get_wifi_mode(void) { if (wfx_rsi.dev_state & WFX_RSI_ST_DEV_READY) return WIFI_MODE_STA; @@ -284,11 +265,9 @@ wifi_mode_t wfx_get_wifi_mode() ***********************************************************************/ sl_status_t wfx_sta_discon(void) { - SILABS_LOG("%s: started.", __func__); - int32_t status; + sl_status_t status; status = wfx_rsi_disconnect(); wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTED; - SILABS_LOG("%s: completed.", __func__); return status; } #if CHIP_DEVICE_CONFIG_ENABLE_IPV4 @@ -302,17 +281,8 @@ sl_status_t wfx_sta_discon(void) ***********************************************************************/ bool wfx_have_ipv4_addr(sl_wfx_interface_t which_if) { - bool status = false; - if (which_if == SL_WFX_STA_INTERFACE) - { - status = (wfx_rsi.dev_state & WFX_RSI_ST_STA_DHCP_DONE) > 0; - } - else - { - status = false; /* TODO */ - } - SILABS_LOG("%s: status: %d", __func__, status); - return status; + VerifyOrReturnError(which_if == SL_WFX_STA_INTERFACE, false); + return ((wfx_rsi.dev_state & WFX_RSI_ST_STA_DHCP_DONE) > 0); } #endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */ @@ -326,17 +296,9 @@ bool wfx_have_ipv4_addr(sl_wfx_interface_t which_if) ***********************************************************************/ bool wfx_have_ipv6_addr(sl_wfx_interface_t which_if) { - bool status = false; - if (which_if == SL_WFX_STA_INTERFACE) - { - status = (wfx_rsi.dev_state & WFX_RSI_ST_STA_CONNECTED) > 0; - } - else - { - status = false; /* TODO */ - } - SILABS_LOG("%s: %d", __func__, status); - return status; + VerifyOrReturnError(which_if == SL_WFX_STA_INTERFACE, false); + // TODO: WFX_RSI_ST_STA_CONNECTED does not guarantee SLAAC IPv6 LLA, maybe use a different FLAG + return ((wfx_rsi.dev_state & WFX_RSI_ST_STA_CONNECTED) > 0); } /********************************************************************* @@ -379,14 +341,14 @@ int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t * extra_info) } /*************************************************************************** - * @fn int32_t wfx_reset_counts(){ + * @fn int32_t wfx_reset_counts(void) * @brief * get the driver reset count * @param[in] None * @return * reset count *****************************************************************************/ -int32_t wfx_reset_counts() +int32_t wfx_reset_counts(void) { return wfx_rsi_reset_count(); } @@ -402,21 +364,17 @@ int32_t wfx_reset_counts() *******************************************************************************/ bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *)) { - int sz; - WfxEvent_t event; - if (wfx_rsi.scan_cb) - return false; /* Already in progress */ - if (ssid) - { - sz = strlen(ssid); - if ((wfx_rsi.scan_ssid = (char *) pvPortMalloc(sz + 1)) == (char *) 0) - { - return false; - } - strcpy(wfx_rsi.scan_ssid, ssid); - } + // check if already in progress + VerifyOrReturnError(wfx_rsi.scan_cb != nullptr, false); wfx_rsi.scan_cb = callback; + VerifyOrReturnError(ssid != nullptr, false); + wfx_rsi.scan_ssid_length = strnlen(ssid, chip::min(sizeof(ssid), WFX_MAX_SSID_LENGTH)); + wfx_rsi.scan_ssid = reinterpret_cast(chip::Platform::MemoryAlloc(wfx_rsi.scan_ssid_length)); + VerifyOrReturnError(wfx_rsi.scan_ssid != nullptr, false); + chip::Platform::CopyString(wfx_rsi.scan_ssid, wfx_rsi.scan_ssid_length, ssid); + + WfxEvent_t event; event.eventType = WFX_EVT_SCAN; WfxPostEvent(&event); @@ -434,6 +392,6 @@ bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *)) void wfx_cancel_scan(void) { /* Not possible */ - SILABS_LOG("%s: cannot cancel scan", __func__); + ChipLogError(DeviceLayer, "cannot cancel scan"); } #endif /* SL_WFX_CONFIG_SCAN */ diff --git a/examples/rvc-app/rvc-common/src/rvc-device.cpp b/examples/rvc-app/rvc-common/src/rvc-device.cpp index 88b8095ddf8bdd..02a75c51f56074 100644 --- a/examples/rvc-app/rvc-common/src/rvc-device.cpp +++ b/examples/rvc-app/rvc-common/src/rvc-device.cpp @@ -168,7 +168,7 @@ bool RvcDevice::SaIsSetSelectedAreasAllowed(MutableCharSpan & statusText) { if (mOperationalStateInstance.GetCurrentOperationalState() == to_underlying(OperationalState::OperationalStateEnum::kRunning)) { - CopyCharSpanToMutableCharSpan("cannot set the Selected Areas while the device is running"_span, statusText); + CopyCharSpanToMutableCharSpanWithTruncation("cannot set the Selected Areas while the device is running"_span, statusText); return false; } return true; @@ -179,14 +179,14 @@ bool RvcDevice::SaHandleSkipArea(uint32_t skippedArea, MutableCharSpan & skipSta if (mServiceAreaInstance.GetCurrentArea() != skippedArea) { // This device only supports skipping the current location. - CopyCharSpanToMutableCharSpan("the skipped area does not match the current area"_span, skipStatusText); + CopyCharSpanToMutableCharSpanWithTruncation("the skipped area does not match the current area"_span, skipStatusText); return false; } if (mOperationalStateInstance.GetCurrentOperationalState() != to_underlying(OperationalState::OperationalStateEnum::kRunning)) { // This device only accepts the skip are command while in the running state - CopyCharSpanToMutableCharSpan("skip area is only accepted when the device is running"_span, skipStatusText); + CopyCharSpanToMutableCharSpanWithTruncation("skip area is only accepted when the device is running"_span, skipStatusText); return false; } diff --git a/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp b/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp index b46206ec50ee75..1a6ba6d8c95999 100644 --- a/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp +++ b/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp @@ -134,7 +134,7 @@ bool RvcServiceAreaDelegate::IsValidSelectAreasSet(const Span & if (!GetInstance()->GetSupportedAreaById(selectedAreas[0], ignoredIndex, tempArea)) { areaStatus = SelectAreasStatus::kUnsupportedArea; - CopyCharSpanToMutableCharSpan("unable to find selected area in supported areas"_span, statusText); + CopyCharSpanToMutableCharSpanWithTruncation("unable to find selected area in supported areas"_span, statusText); return false; } @@ -145,14 +145,14 @@ bool RvcServiceAreaDelegate::IsValidSelectAreasSet(const Span & if (!GetInstance()->GetSupportedAreaById(areaId, ignoredIndex, tempArea)) { areaStatus = SelectAreasStatus::kUnsupportedArea; - CopyCharSpanToMutableCharSpan("unable to find selected area in supported areas"_span, statusText); + CopyCharSpanToMutableCharSpanWithTruncation("unable to find selected area in supported areas"_span, statusText); return false; } if (tempArea.mapID.Value() != mapId) { areaStatus = SelectAreasStatus::kInvalidSet; - CopyCharSpanToMutableCharSpan("all selected areas must be in the same map"_span, statusText); + CopyCharSpanToMutableCharSpanWithTruncation("all selected areas must be in the same map"_span, statusText); return false; } } diff --git a/examples/shell/shell_common/BUILD.gn b/examples/shell/shell_common/BUILD.gn index e4aa2973f8cc04..645c8ddb510220 100644 --- a/examples/shell/shell_common/BUILD.gn +++ b/examples/shell/shell_common/BUILD.gn @@ -13,13 +13,12 @@ # limitations under the License. import("//build_overrides/chip.gni") -import("//build_overrides/openthread.gni") - +import("${chip_root}/config/recommended.gni") import("${chip_root}/src/platform/device.gni") declare_args() { - # Enable server command only on linux for now. - chip_shell_cmd_server = current_os == "linux" || current_os == "mac" + chip_shell_cmd_server = matter_enable_recommended && + (current_os == "linux" || current_os == "mac") } config("shell_common_config") { diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 7cd7c157a54403..4c90164b2d1c12 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -507,7 +507,8 @@ def BuildNxpTarget(): target.AppendFixedTargets([ TargetPart('k32w0', board=NxpBoard.K32W0), TargetPart('k32w1', board=NxpBoard.K32W1), - TargetPart('rw61x', board=NxpBoard.RW61X) + TargetPart('rw61x', board=NxpBoard.RW61X), + TargetPart('mcxw71', board=NxpBoard.MCXW71) ]) # OS @@ -518,8 +519,8 @@ def BuildNxpTarget(): # apps target.AppendFixedTargets([ - TargetPart('lighting', app=NxpApp.LIGHTING).OnlyIfRe('(k32w0|k32w1)'), - TargetPart('contact-sensor', app=NxpApp.CONTACT).OnlyIfRe('(k32w0|k32w1)'), + TargetPart('lighting', app=NxpApp.LIGHTING).OnlyIfRe('(k32w0|k32w1|mcxw71)'), + TargetPart('contact-sensor', app=NxpApp.CONTACT).OnlyIfRe('(k32w0|k32w1|mcxw71)'), TargetPart('all-clusters', app=NxpApp.ALLCLUSTERS).OnlyIfRe('rw61x'), TargetPart('laundry-washer', app=NxpApp.LAUNDRYWASHER).OnlyIfRe('rw61x'), TargetPart('thermostat', app=NxpApp.THERMOSTAT).OnlyIfRe('rw61x') @@ -529,7 +530,7 @@ def BuildNxpTarget(): target.AppendModifier(name="low-power", low_power=True).OnlyIfRe('contact-sensor') target.AppendModifier(name="lit", enable_lit=True).OnlyIfRe('contact-sensor') target.AppendModifier(name="fro32k", use_fro32k=True).OnlyIfRe('k32w0') - target.AppendModifier(name="smu2", smu2=True).OnlyIfRe('k32w1-freertos-lighting') + target.AppendModifier(name="smu2", smu2=True).OnlyIfRe('(k32w1|mcxw71)-freertos-lighting') target.AppendModifier(name="dac-conversion", convert_dac_pk=True).OnlyIfRe('factory').ExceptIfRe('(k32w0|rw61x)') target.AppendModifier(name="rotating-id", enable_rotating_id=True).ExceptIfRe('rw61x') target.AppendModifier(name="sw-v2", has_sw_version_2=True) diff --git a/scripts/build/builders/nxp.py b/scripts/build/builders/nxp.py index 3592400fc0c631..1124a03142472c 100644 --- a/scripts/build/builders/nxp.py +++ b/scripts/build/builders/nxp.py @@ -38,6 +38,7 @@ class NxpBoard(Enum): K32W0 = auto() K32W1 = auto() RW61X = auto() + MCXW71 = auto() def Name(self, os_env): if self == NxpBoard.K32W0: @@ -49,6 +50,8 @@ def Name(self, os_env): return 'rd_rw612_bga' else: return 'rw61x' + elif self == NxpBoard.MCXW71: + return 'mcxw71' else: raise Exception('Unknown board type: %r' % self) @@ -62,6 +65,8 @@ def FolderName(self, os_env): return 'zephyr' else: return 'rt/rw61x' + elif self == NxpBoard.MCXW71: + return 'mcxw71' else: raise Exception('Unknown board type: %r' % self) diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 6639429b31bb75..df54baa2ffec81 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -13,7 +13,7 @@ linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,therm linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage][-trustm] -nxp-{k32w0,k32w1,rw61x}-{zephyr,freertos}-{lighting,contact-sensor,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-thread][-matter-shell] +nxp-{k32w0,k32w1,rw61x,mcxw71}-{zephyr,freertos}-{lighting,contact-sensor,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-thread][-matter-shell] mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,ota-requestor,shell}[-release][-develop][-debug] mw320-all-clusters-app nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc] diff --git a/scripts/build_python.sh b/scripts/build_python.sh index 9bb919605e229c..eaf1ad9c0e3050 100755 --- a/scripts/build_python.sh +++ b/scripts/build_python.sh @@ -217,8 +217,8 @@ if [ -n "$install_virtual_env" ]; then fi source "$ENVIRONMENT_ROOT"/bin/activate - "$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip - "$ENVIRONMENT_ROOT"/bin/pip install --upgrade "${WHEEL[@]}" + "$ENVIRONMENT_ROOT"/bin/python -m ensurepip --upgrade + "$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade "${WHEEL[@]}" if [ "$install_pytest_requirements" = "yes" ]; then YAMLTESTS_GN_LABEL="//scripts:matter_yamltests_distribution._build_wheel" diff --git a/scripts/build_python_device.sh b/scripts/build_python_device.sh index 9b21d28954c409..17824403184c12 100755 --- a/scripts/build_python_device.sh +++ b/scripts/build_python_device.sh @@ -104,8 +104,8 @@ virtualenv --clear "$ENVIRONMENT_ROOT" WHEEL=("$OUTPUT_ROOT"/controller/python/chip_core*.whl) source "$ENVIRONMENT_ROOT"/bin/activate -"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip -"$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}" +"$ENVIRONMENT_ROOT"/bin/python -m ensurepip --upgrade +"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}" echo "" echo_green "Compilation completed and WHL package installed in: " diff --git a/scripts/tools/generate_esp32_chip_factory_bin.py b/scripts/tools/generate_esp32_chip_factory_bin.py index 892f0609927cd2..ef23dc61b337ef 100755 --- a/scripts/tools/generate_esp32_chip_factory_bin.py +++ b/scripts/tools/generate_esp32_chip_factory_bin.py @@ -209,6 +209,11 @@ class Product_Color_Enum(Enum): 'encoding': 'string', 'value': None, }, + 'device-type': { + 'type': 'data', + 'encoding': 'u32', + 'value': None, + }, } @@ -372,6 +377,8 @@ def populate_factory_data(args, spake2p_params): FACTORY_DATA['product-url']['value'] = args.product_url if args.product_label: FACTORY_DATA['product-label']['value'] = args.product_label + if args.device_type is not None: + FACTORY_DATA['device-type']['value'] = args.device_type # SupportedModes are stored as multiple entries # - sm-sz/ : number of supported modes for the endpoint @@ -554,6 +561,8 @@ def any_base_int(s): return int(s, 0) parser.add_argument("--product-label", type=str, help='human readable product label') parser.add_argument("--product-url", type=str, help='link to product specific web page') + parser.add_argument("--device-type", type=any_base_int, help='commissionable device type') + parser.add_argument('-s', '--size', type=any_base_int, default=0x6000, help='The size of the partition.bin, default: 0x6000') parser.add_argument('--target', default='esp32', diff --git a/scripts/tools/telink/requirements.txt b/scripts/tools/telink/requirements.txt index bb4359b5319da3..58b519dc924bfa 100644 --- a/scripts/tools/telink/requirements.txt +++ b/scripts/tools/telink/requirements.txt @@ -1,4 +1,4 @@ -cryptography==41.0.4 +cryptography==43.0.1 cffi==1.15.0 future==0.18.3 pycparser==2.21 diff --git a/scripts/tools/zap/update_cluster_revisions.py b/scripts/tools/zap/update_cluster_revisions.py index e29a274cf47087..797fd1733f3771 100755 --- a/scripts/tools/zap/update_cluster_revisions.py +++ b/scripts/tools/zap/update_cluster_revisions.py @@ -24,11 +24,15 @@ import sys from pathlib import Path +BASIC_INFORMATION_CLUSTER_ID = int("0x0039", 16) CHIP_ROOT_DIR = os.path.realpath( os.path.join(os.path.dirname(__file__), '../../..')) +EXCLUDE_FROM_UPDATE_DICTIONARY = { + BASIC_INFORMATION_CLUSTER_ID: ["lighting-app-data-mode-no-unique-id"] +} -def getTargets(): +def getTargets(cluster_id: int): ROOTS_TO_SEARCH = [ './examples', './src/controller/data_model', @@ -40,6 +44,10 @@ def getTargets(): for filepath in Path(root).rglob('*.zap'): targets.append(filepath) + if cluster_id in EXCLUDE_FROM_UPDATE_DICTIONARY: + for target_to_exclude in EXCLUDE_FROM_UPDATE_DICTIONARY[cluster_id]: + targets = [target for target in targets if target_to_exclude not in target.parts] + return targets @@ -130,7 +138,7 @@ def main(): os.chdir(CHIP_ROOT_DIR) - targets = getTargets() + targets = getTargets(args.cluster_id) if args.dry_run: for target in targets: diff --git a/src/app/clusters/service-area-server/service-area-delegate.h b/src/app/clusters/service-area-server/service-area-delegate.h index 3983e8d6ed7c25..f82f71fea31d13 100644 --- a/src/app/clusters/service-area-server/service-area-delegate.h +++ b/src/app/clusters/service-area-server/service-area-delegate.h @@ -55,9 +55,10 @@ class Delegate * @brief Can the selected locations be set by the client in the current operating mode? * @param[out] statusText text describing why the selected locations cannot be set (if return is false). * Max size kMaxSizeStatusText. - * Note: If the return is false and statusText is not successfully set, for example due to a string that can be longer than - * kMaxSizeStatusText, the size of this value should be set to 0 with .reduce_size(0) to avoid callers using un-initialized - * memory. + * Note: statusText must be successfully set if the return is false. Use CopyCharSpanToMutableCharSpanWithTruncation to + * ensure that a message is copied successfully. Otherwise, ensure that if setting the statusText can fail (e.g., due + * to exceeding kMaxSizeStatusText) the size of this value is set to 0 with .reduce_size(0) to avoid callers using + * un-initialized memory. * @return true if the current device state allows selected locations to be set by user. * * @note The statusText field SHOULD indicate why the request is not allowed, given the current mode @@ -77,9 +78,10 @@ class Delegate * @param[in] selectedAreas List of new selected locations. * @param[out] locationStatus Success if all checks pass, error code if failure. * @param[out] statusText text describing failure (see description above). Max size kMaxSizeStatusText. - * Note: If the return is false and statusText is not successfully set, for example due to a string that can be longer than - * kMaxSizeStatusText, the size of this value should be set to 0 with .reduce_size(0) to avoid callers using un-initialized - * memory. + * Note: statusText must be successfully set if the return is false. Use CopyCharSpanToMutableCharSpanWithTruncation to + * ensure that a message is copied successfully. Otherwise, ensure that if setting the statusText can fail (e.g., due + * to exceeding kMaxSizeStatusText) the size of this value is set to 0 with .reduce_size(0) to avoid callers using + * un-initialized memory. * @return true if success. * * @note If the SelectAreas command is allowed when the device is operating and the selected locations change to none, the @@ -93,9 +95,10 @@ class Delegate * calling this method. * @param[in] skippedArea the area ID to skip. * @param[out] skipStatusText text describing why the current location cannot be skipped. Max size kMaxSizeStatusText. - * Note: If the return is false and skipStatusText is not successfully set, for example due to a string that can be longer than - * kMaxSizeStatusText, the size of this value should be set to 0 with .reduce_size(0) to avoid callers using un-initialized - * memory. + * Note: skipStatusText must be successfully set if the return is false. Use CopyCharSpanToMutableCharSpanWithTruncation to + * ensure that a message is copied successfully. Otherwise, ensure that if setting the skipStatusText can fail (e.g., due + * to exceeding kMaxSizeStatusText) the size of this value is set to 0 with .reduce_size(0) to avoid callers using + * un-initialized memory. * @return true if command is successful, false if the received skip request cannot be handled due to the current mode of the * device. * @@ -120,7 +123,7 @@ class Delegate virtual bool HandleSkipArea(uint32_t skippedArea, MutableCharSpan & skipStatusText) { // device support of this command is optional - CopyCharSpanToMutableCharSpan("Skip Current Area command not supported by device"_span, skipStatusText); + CopyCharSpanToMutableCharSpanWithTruncation("Skip Current Area command not supported by device"_span, skipStatusText); return false; } diff --git a/src/app/common_flags.gni b/src/app/common_flags.gni index 953afc23a20650..d3e7ce34bf0338 100644 --- a/src/app/common_flags.gni +++ b/src/app/common_flags.gni @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/chip.gni") +import("${chip_root}/config/recommended.gni") + declare_args() { # Temporary flag for interaction model and echo protocols, set it to true to enable chip_app_use_echo = false @@ -26,7 +29,7 @@ declare_args() { # - disabled: does not use data model interface at all # - check: runs BOTH datamodel and non-data-model (if possible) functionality and compares results # - enabled: runs only the data model interface (does not use the legacy code) - if (current_os == "linux") { + if (matter_enable_recommended && current_os == "linux") { chip_use_data_model_interface = "check" } else { chip_use_data_model_interface = "disabled" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_7.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_7.yaml index 19183ba79aff8d..5915fd6357bd67 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_7.yaml @@ -58,9 +58,9 @@ tests: } - label: - "Step 0b: TH binds GroupIds 0x0001 and 0x0002 with GroupKeySetID - 0x01a1 in the GroupKeyMap attribute list on GroupKeyManagement cluster - by writing the GroupKeyMap attribute with two entries as follows:" + "Step 0b: TH binds GroupIds 0x0001 with GroupKeySetID 0x01a1 in the + GroupKeyMap attribute list on GroupKeyManagement cluster by writing + the GroupKeyMap attribute with two entries as follows:" cluster: "Group Key Management" endpoint: 0 command: "writeAttribute" @@ -142,7 +142,7 @@ tests: value: 0 - label: - "Step 2b: TH sends a StoreScene command to DUT with the GroupID field + "Step 3: TH sends a StoreScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01." command: "StoreScene" arguments: @@ -160,7 +160,7 @@ tests: - name: "SceneID" value: 0x01 - - label: "Step 3: TH sends a AddScene command to DUT with the GroupID field + - label: "Step 4: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x02, the TransitionTime field set to 1000 (1s) and the ExtensionFieldSets set to: '[{ ClusterID: 0x0006, AttributeValueList: [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }]}]' @@ -195,7 +195,7 @@ tests: value: 0x02 - label: - "Step 4a: TH sends a RecallScene command to DUT with the GroupID field + "Step 5a: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x02." PICS: S.S.C05.Rsp command: "RecallScene" @@ -214,7 +214,7 @@ tests: - name: "ms" value: 2000 - - label: "Step 4b: after a few seconds, TH reads OnOff attribute from DUT" + - label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT" cluster: "On/Off" command: "readAttribute" attribute: "OnOff" @@ -222,7 +222,7 @@ tests: value: 1 - label: - "Step 5a: TH sends a RecallScene command to DUT with the GroupID field + "Step 6a: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01." PICS: S.S.C05.Rsp command: "RecallScene" @@ -241,7 +241,7 @@ tests: - name: "ms" value: 1000 - - label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT" + - label: "Step 6b: after a few seconds, TH reads OnOff attribute from DUT" cluster: "On/Off" command: "readAttribute" attribute: "OnOff" diff --git a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml index 1e66f4c803834d..b3498affd8fd20 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml @@ -239,7 +239,8 @@ tests: - label: "Step 2: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to - 1000 (1s) and a set of extension fields appropriate to AC1." + 1,000(1s) and a set of extension fields appropriate to produce a + device state that will be referred as AC1 in further steps." PICS: S.S.C00.Rsp && PICS_SDK_CI_ONLY command: "AddScene" arguments: @@ -278,9 +279,10 @@ tests: - label: "Step 2: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to - 1000 (1s) and a set of extension fields appropriate to AC1." + 1,000(1s) and a set of extension fields appropriate to produce a + device state that will be referred as AC1 in further steps." verification: | - ./chip-tool scenesmanagement add-scene 0x0101 0x01 1000 "scene name" '[{"clusterID": "0x0006", "attributeValueList":[{"attributeID": "0x0000", "ValueUnsigned8": "0x01"}, ]}, {"clusterID": "0x0008", "attributeValueList":[{"attributeID": "0x0000", "ValueUnsigned8": "0x64"}, ]}]' 1 1 + ./chip-tool scenesmanagement add-scene 0x0101 0x01 1000 "scene name" '[{"clusterID": "0x0008", "attributeValueList":[{"attributeID": "0x0000", "valueUnsigned8": "0x64"}, ]}]' 1 1 Verify DUT sends a AddSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to 257 and the SceneID field set to 0x01 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: @@ -350,35 +352,24 @@ tests: Verify DUT sends a ViewSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to 1000 and a set of extension fields appropriate to AC1 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - NOTE: The values below are expected to match the values from the specific AC tested - - [1708071897.294470][7731:7733] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 - [1708071897.294486][7731:7733] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 - [1708071897.294520][7731:7733] CHIP:TOO: ViewSceneResponse: { - [1708071897.294527][7731:7733] CHIP:TOO: status: 0 - [1708071897.294530][7731:7733] CHIP:TOO: groupID: 257 - [1708071897.294533][7731:7733] CHIP:TOO: sceneID: 1 - [1708071897.294536][7731:7733] CHIP:TOO: transitionTime: 1000 - [1708071897.294540][7731:7733] CHIP:TOO: sceneName: scene name - [1708071897.294554][7731:7733] CHIP:TOO: extensionFieldSets: 2 entries - [1708071897.294569][7731:7733] CHIP:TOO: [1]: { - [1708071897.294574][7731:7733] CHIP:TOO: ClusterID: 6 - [1708071897.294580][7731:7733] CHIP:TOO: AttributeValueList: 1 entries - [1708071897.294589][7731:7733] CHIP:TOO: [1]: { - [1708071897.294593][7731:7733] CHIP:TOO: AttributeID: 0 - [1708071897.294596][7731:7733] CHIP:TOO: ValueUnsigned8: 1 - [1708071897.294599][7731:7733] CHIP:TOO: } - [1708071897.294603][7731:7733] CHIP:TOO: } - [1708071897.294611][7731:7733] CHIP:TOO: [2]: { - [1708071897.294615][7731:7733] CHIP:TOO: ClusterID: 8 - [1708071897.294621][7731:7733] CHIP:TOO: AttributeValueList: 1 entries - [1708071897.294628][7731:7733] CHIP:TOO: [1]: { - [1708071897.294633][7731:7733] CHIP:TOO: AttributeID: 0 - [1708071897.294636][7731:7733] CHIP:TOO: ValueUnsigned8: 100 - [1708071897.294639][7731:7733] CHIP:TOO: } - [1708071897.294643][7731:7733] CHIP:TOO: } - [1708071897.294647][7731:7733] CHIP:TOO: } + [1722518510.318] [187478:187480] [DMG] Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 + [1722518510.318] [187478:187480] [TOO] Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 + [1722518510.318] [187478:187480] [TOO] ViewSceneResponse: { + [1722518510.318] [187478:187480] [TOO] status: 0 + [1722518510.318] [187478:187480] [TOO] groupID: 257 + [1722518510.318] [187478:187480] [TOO] sceneID: 1 + [1722518510.318] [187478:187480] [TOO] transitionTime: 1000 + [1722518510.318] [187478:187480] [TOO] sceneName: scene name + [1722518510.318] [187478:187480] [TOO] extensionFieldSets: 1 entries + [1722518510.318] [187478:187480] [TOO] [1]: { + [1722518510.318] [187478:187480] [TOO] ClusterID: 8 + [1722518510.318] [187478:187480] [TOO] AttributeValueList: 1 entries + [1722518510.318] [187478:187480] [TOO] [1]: { + [1722518510.318] [187478:187480] [TOO] AttributeID: 0 + [1722518510.318] [187478:187480] [TOO] ValueUnsigned8: 100 + [1722518510.318] [187478:187480] [TOO] } + [1722518510.318] [187478:187480] [TOO] } + [1722518510.318] [187478:187480] [TOO] } cluster: "LogCommands" command: "UserPrompt" arguments: @@ -433,7 +424,14 @@ tests: "Step 5a: TH configures AC2 on DUT for all implemented application clusters supporting scenesmanagement." verification: | - Is DUT configured with AC2? + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -479,7 +477,16 @@ tests: - label: "Verify DUT returns to AC1." verification: | - Is DUT configured with AC1? + Read CurrentLevel attribute from level control cluster + + ./chip-tool levelcontrol read current-level 1 1 + + Verify CurrentLevel attribute value on TH(chip-tool) + + [1708072116.730389][7757:7759] CHIP:DMG: } + [1708072116.730518][7757:7759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_0000 DataVersion: 2359286215 + [1708072116.730552][7757:7759] CHIP:TOO: CurrentLevel: 100 + cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -528,8 +535,9 @@ tests: field set to G1, the SceneID field set to 0x03, the TransitionTime field set to G1 and a set of extension fields appropriate to AC1." verification: | - ./chip-tool scenesmanagement add-scene 0x0101 0x03 1 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4002", "ValueUnsigned8": "0x01"}]}]' 0xffffffffffff0101 1 - Note: As this is a multicast command, no log is expected. + ./chip-tool scenesmanagement add-scene 0x0101 0x03 1000 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4002", "valueUnsigned8": "0x01"}]}]' 0xffffffffffff0101 1 + + There is no Status response since this was a groupcast cluster: "LogCommands" command: "UserPrompt" PICS: S.S.C00.Rsp && PICS_SKIP_SAMPLE_APP @@ -589,25 +597,24 @@ tests: NOTE: The values below are expected to match the values from the specific AC tested - [1707285444.028460][13682:13684] CHIP:DMG: }, - [1707285444.028553][13682:13684] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 - [1707285444.028579][13682:13684] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 - [1707285444.028670][13682:13684] CHIP:TOO: ViewSceneResponse: { - [1707285444.028685][13682:13684] CHIP:TOO: status: 0 - [1707285444.028696][13682:13684] CHIP:TOO: groupID: 257 - [1707285444.028706][13682:13684] CHIP:TOO: sceneID: 3 - [1707285444.028717][13682:13684] CHIP:TOO: transitionTime: 1 - [1707285444.028728][13682:13684] CHIP:TOO: sceneName: scene name - [1707285444.028766][13682:13684] CHIP:TOO: extensionFieldSets: 1 entries - [1707285444.028814][13682:13684] CHIP:TOO: [1]: { - [1707285444.028828][13682:13684] CHIP:TOO: ClusterID: 768 - [1707285444.028853][13682:13684] CHIP:TOO: AttributeValueList: 1 entries - [1707285444.028882][13682:13684] CHIP:TOO: [1]: { - [1707285444.028896][13682:13684] CHIP:TOO: AttributeID: 16386 - [1707285444.028913][13682:13684] CHIP:TOO: ValueUnsigned16: 1 - [1707285444.028925][13682:13684] CHIP:TOO: } - [1707285444.028937][13682:13684] CHIP:TOO: } - [1707285444.028950][13682:13684] CHIP:TOO: } + [1720504218.414] [3432:3434] [DMG] Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 + [1720504218.414] [3432:3434] [TOO] Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 + [1720504218.414] [3432:3434] [TOO] ViewSceneResponse: { + [1720504218.414] [3432:3434] [TOO] status: 0 + [1720504218.414] [3432:3434] [TOO] groupID: 257 + [1720504218.414] [3432:3434] [TOO] sceneID: 3 + [1720504218.414] [3432:3434] [TOO] transitionTime: 1000 + [1720504218.414] [3432:3434] [TOO] sceneName: scene name + [1720504218.414] [3432:3434] [TOO] extensionFieldSets: 1 entries + [1720504218.414] [3432:3434] [TOO] [1]: { + [1720504218.414] [3432:3434] [TOO] ClusterID: 768 + [1720504218.414] [3432:3434] [TOO] AttributeValueList: 1 entries + [1720504218.414] [3432:3434] [TOO] [1]: { + [1720504218.414] [3432:3434] [TOO] AttributeID: 16386 + [1720504218.415] [3432:3434] [TOO] ValueUnsigned8: 1 + [1720504218.415] [3432:3434] [TOO] } + [1720504218.415] [3432:3434] [TOO] } + [1720504218.415] [3432:3434] [TOO] } cluster: "LogCommands" command: "UserPrompt" arguments: diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index b45bfe43cff43e..23a9b9b5fd20c3 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -60,6 +60,12 @@ static constexpr uint16_t kEmberInvalidEndpointIndex = 0xFFFF; } /* cluster revision */ \ } +// The attrMask must contain the relevant ATTRIBUTE_MASK_* bits from +// attribute-metadata.h. Specifically: +// +// * Writable attributes must have ATTRIBUTE_MASK_WRITABLE +// * Nullable attributes (have X in the quality column in the spec) must have ATTRIBUTE_MASK_NULLABLE +// * Attributes that have T in the Access column in the spec must have ATTRIBUTE_MASK_MUST_USE_TIMED_WRITE #define DECLARE_DYNAMIC_ATTRIBUTE(attId, attType, attSizeBytes, attrMask) \ { \ ZAP_EMPTY_DEFAULT(), attId, attSizeBytes, ZAP_TYPE(attType), attrMask | ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) \ diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml deleted file mode 100644 index 265e80c079e161..00000000000000 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/darwin/Framework/CHIP/MTRDefines_Internal.h b/src/darwin/Framework/CHIP/MTRDefines_Internal.h index 94a1cbb3da61f4..14683f34c553f9 100644 --- a/src/darwin/Framework/CHIP/MTRDefines_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDefines_Internal.h @@ -91,7 +91,7 @@ typedef struct {} variable_hidden_by_mtr_hide; { \ NSXPCConnection * xpcConnection = XPC_CONNECTION; \ \ - [[xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { \ + [[xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { \ MTR_LOG_ERROR("Error: %@", error); \ }] PREFIX ADDITIONAL_ARGUMENTS]; \ } @@ -151,6 +151,4 @@ typedef struct {} variable_hidden_by_mtr_hide; } #endif -#ifndef YES_NO -#define YES_NO(x) ((x) ? @"YES" : @"NO") -#endif +#define MTR_YES_NO(x) ((x) ? @"YES" : @"NO") diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index ddc47965f9c8b1..a0f985bb4ac1f1 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -306,7 +306,6 @@ - (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDe _delegates = [NSMutableSet set]; _deviceController = controller; _nodeID = nodeID; - _accessedViaPublicAPI = NO; _state = MTRDeviceStateUnknown; } @@ -322,7 +321,6 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle _nodeID = [nodeID copy]; _fabricIndex = controller.fabricIndex; _deviceController = controller; - _accessedViaPublicAPI = NO; _queue = dispatch_queue_create("org.csa-iot.matter.framework.device.workqueue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); _asyncWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self]; @@ -362,19 +360,9 @@ - (void)dealloc MTR_LOG("MTRDevice dealloc: %p", self); } -+ (MTRDevice *)_deviceWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller -{ - return [controller deviceForNodeID:nodeID]; -} - + (MTRDevice *)deviceWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { - auto * device = [self _deviceWithNodeID:nodeID controller:controller]; - if (device) { - std::lock_guard lock(device->_lock); - device->_accessedViaPublicAPI = YES; - } - return device; + return [controller deviceForNodeID:nodeID]; } #pragma mark - Time Synchronization @@ -1170,7 +1158,7 @@ - (nullable MTRDeviceClusterData *)_clusterDataForPath:(MTRClusterPath *)cluster // Page in the stored value for the data. MTRDeviceClusterData * data = [_deviceController.controllerDataStore getStoredClusterDataForNodeID:_nodeID endpointID:clusterPath.endpoint clusterID:clusterPath.cluster]; - MTR_LOG("%@ cluster path %@ cache miss - load from storage success %@", self, clusterPath, YES_NO(data)); + MTR_LOG("%@ cluster path %@ cache miss - load from storage success %@", self, clusterPath, MTR_YES_NO(data)); if (data != nil) { [_persistedClusterData setObject:data forKey:clusterPath]; } else { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index d731b13052798c..0b553c9d43d25e 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -198,6 +198,13 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) /** * Adds a Delegate to the device controller as well as the Queue on which the Delegate callbacks will be triggered * + * Multiple delegates can be added to monitor MTRDeviceController state changes. Note that there should only + * be one delegate that responds to pairing related callbacks. + * + * If a delegate is added a second time, the call would be ignored. + * + * All delegates are held by weak references, and so if a delegate object goes away, it will be automatically removed. + * * @param[in] delegate The delegate the commissioning process should use * * @param[in] queue The queue on which the callbacks will be delivered diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 69bb02d5f1f03d..b84505f8185442 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -154,14 +154,18 @@ @implementation MTRDeviceController { MTRP256KeypairBridge _signingKeypairBridge; MTRP256KeypairBridge _operationalKeypairBridge; - BOOL _suspended; + // For now, we just ensure that access to _suspended is atomic, but don't + // guarantee atomicity of the the entire suspend/resume operation. The + // expectation is that suspend/resume on a given controller happen on some + // specific queue, so can't race against each other. + std::atomic _suspended; // Counters to track assertion status and access controlled by the _assertionLock NSUInteger _keepRunningAssertionCounter; BOOL _shutdownPending; os_unfair_lock _assertionLock; - NSMutableSet * _delegates; + NSMutableArray * _delegates; id _strongDelegateForSetDelegateAPI; } @@ -192,7 +196,7 @@ - (instancetype)initForSubclasses:(BOOL)startSuspended _nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; - _delegates = [NSMutableSet set]; + _delegates = [NSMutableArray array]; return self; } @@ -378,9 +382,7 @@ - (BOOL)isRunning - (BOOL)isSuspended { - @synchronized(self) { - return _suspended; - } + return _suspended; } - (void)_notifyDelegatesOfSuspendState @@ -397,48 +399,51 @@ - (void)suspend { MTR_LOG("%@ suspending", self); - @synchronized(self) { + NSArray * devicesToSuspend; + { + std::lock_guard lock(*self.deviceMapLock); + // Set _suspended under the device map lock. This guarantees that + // for any given device exactly one of two things is true: + // * It is in the snapshot we are creating + // * It is created after we have changed our _suspended state. _suspended = YES; + devicesToSuspend = [self.nodeIDToDeviceMap objectEnumerator].allObjects; + } - NSArray * devicesToSuspend; - { - std::lock_guard lock(*self.deviceMapLock); - devicesToSuspend = [self.nodeIDToDeviceMap objectEnumerator].allObjects; - } - - for (MTRDevice * device in devicesToSuspend) { - [device controllerSuspended]; - } - - // TODO: In the concrete class, consider what should happen with: - // - // * Active commissioning sessions (presumably close them?) - // * CASE sessions in general. - // * Possibly try to see whether we can change our fabric entry to not advertise and restart advertising. - - [self _notifyDelegatesOfSuspendState]; + MTR_LOG("%@ found %lu devices to suspend", self, static_cast(devicesToSuspend.count)); + for (MTRDevice * device in devicesToSuspend) { + [device controllerSuspended]; } + + // TODO: In the concrete class, consider what should happen with: + // + // * Active commissioning sessions (presumably close them?) + // * CASE sessions in general. + // * Possibly try to see whether we can change our fabric entry to not advertise and restart advertising. + [self _notifyDelegatesOfSuspendState]; } - (void)resume { MTR_LOG("%@ resuming", self); - @synchronized(self) { + NSArray * devicesToResume; + { + std::lock_guard lock(*self.deviceMapLock); + // Set _suspended under the device map lock. This guarantees that + // for any given device exactly one of two things is true: + // * It is in the snapshot we are creating + // * It is created after we have changed our _suspended state. _suspended = NO; + devicesToResume = [self.nodeIDToDeviceMap objectEnumerator].allObjects; + } - NSArray * devicesToResume; - { - std::lock_guard lock(*self.deviceMapLock); - devicesToResume = [self.nodeIDToDeviceMap objectEnumerator].allObjects; - } - - for (MTRDevice * device in devicesToResume) { - [device controllerResumed]; - } - - [self _notifyDelegatesOfSuspendState]; + MTR_LOG("%@ found %lu devices to resume", self, static_cast(devicesToResume.count)); + for (MTRDevice * device in devicesToResume) { + [device controllerResumed]; } + + [self _notifyDelegatesOfSuspendState]; } - (BOOL)matchesPendingShutdownControllerWithOperationalCertificate:(nullable MTRCertificateDERBytes)operationalCertificate andRootCertificate:(nullable MTRCertificateDERBytes)rootCertificate @@ -859,7 +864,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams // // Note that this is just an optimization to avoid throwing the information away and immediately // re-reading it from storage. - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (kSecondsToWaitBeforeAPIClientRetainsMTRDevice * NSEC_PER_SEC)), self.chipWorkQueue, ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (kSecondsToWaitBeforeAPIClientRetainsMTRDevice * NSEC_PER_SEC)), dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{ MTR_LOG("%@ un-retain devices loaded at startup %lu", self, static_cast(deviceList.count)); }); }]; @@ -1788,7 +1793,7 @@ + (void)forceLocalhostAdvertisingOnly #pragma mark - MTRDeviceControllerDelegate management -// Note these are implemented in the base class so that XPC subclass can use it as well when it +// Note these are implemented in the base class so that XPC subclass can use it as well - (void)setDeviceControllerDelegate:(id)delegate queue:(dispatch_queue_t)queue { @synchronized(self) { @@ -1809,6 +1814,17 @@ - (void)setDeviceControllerDelegate:(id)delegate qu - (void)addDeviceControllerDelegate:(id)delegate queue:(dispatch_queue_t)queue { @synchronized(self) { + __block BOOL delegateAlreadyAdded = NO; + [self _iterateDelegateInfoWithBlock:^(MTRDeviceControllerDelegateInfo * delegateInfo) { + if (delegateInfo.delegate == delegate) { + delegateAlreadyAdded = YES; + } + }]; + if (delegateAlreadyAdded) { + MTR_LOG("%@ addDeviceControllerDelegate: delegate already added", self); + return; + } + MTRDeviceControllerDelegateInfo * newDelegateInfo = [[MTRDeviceControllerDelegateInfo alloc] initWithDelegate:delegate queue:queue]; [_delegates addObject:newDelegateInfo]; MTR_LOG("%@ addDeviceControllerDelegate: added %p total %lu", self, delegate, static_cast(_delegates.count)); @@ -1831,9 +1847,6 @@ - (void)removeDeviceControllerDelegate:(id)delegate if (delegateInfoToRemove) { [_delegates removeObject:delegateInfoToRemove]; - if (_strongDelegateForSetDelegateAPI == delegate) { - _strongDelegateForSetDelegateAPI = nil; - } MTR_LOG("%@ removeDeviceControllerDelegate: removed %p remaining %lu", self, delegate, static_cast(_delegates.count)); } else { MTR_LOG("%@ removeDeviceControllerDelegate: delegate %p not found in %lu", self, delegate, static_cast(_delegates.count)); @@ -1852,7 +1865,7 @@ - (NSUInteger)_iterateDelegateInfoWithBlock:(void (^_Nullable)(MTRDeviceControll } // Opportunistically remove defunct delegate references on every iteration - NSMutableSet * delegatesToRemove = nil; + NSMutableArray * delegatesToRemove = nil; for (MTRDeviceControllerDelegateInfo * delegateInfo in _delegates) { id strongDelegate = delegateInfo.delegate; if (strongDelegate) { @@ -1861,14 +1874,14 @@ - (NSUInteger)_iterateDelegateInfoWithBlock:(void (^_Nullable)(MTRDeviceControll } } else { if (!delegatesToRemove) { - delegatesToRemove = [NSMutableSet set]; + delegatesToRemove = [NSMutableArray array]; } [delegatesToRemove addObject:delegateInfo]; } } if (delegatesToRemove.count) { - [_delegates minusSet:delegatesToRemove]; + [_delegates removeObjectsInArray:delegatesToRemove]; MTR_LOG("%@ _iterateDelegatesWithBlock: removed %lu remaining %lu", self, static_cast(delegatesToRemove.count), static_cast(_delegates.count)); } diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index c8f8950579b350..bdcbafae1b6c9d 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -761,7 +761,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams // // Note that this is just an optimization to avoid throwing the information away and immediately // re-reading it from storage. - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (kSecondsToWaitBeforeAPIClientRetainsMTRDevice * NSEC_PER_SEC)), self.chipWorkQueue, ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (kSecondsToWaitBeforeAPIClientRetainsMTRDevice * NSEC_PER_SEC)), dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{ MTR_LOG("%@ un-retain devices loaded at startup %lu", self, static_cast(deviceList.count)); }); }]; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 7ca9fde2099e03..29860fd41f1039 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -181,7 +181,7 @@ - (BOOL)_setupXPCConnection MTR_LOG("%@ Activating new XPC connection", self); [self.xpcConnection activate]; - [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { MTR_LOG_ERROR("Checkin error: %@", error); }] deviceController:self.uniqueIdentifier checkInWithContext:[NSDictionary dictionary]]; @@ -193,7 +193,7 @@ - (BOOL)_setupXPCConnection MTR_LOG("%@ => Registering nodeID: %@", self, nodeID); mtr_weakify(self); - [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { mtr_strongify(self); MTR_LOG_ERROR("%@ Registration error for device nodeID: %@ : %@", self, nodeID, error); }] deviceController:self.uniqueIdentifier registerNodeID:nodeID]; @@ -288,7 +288,7 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N MTR_LOG("%s: returning XPC device for node id %@", __PRETTY_FUNCTION__, nodeID); mtr_weakify(self); - [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { mtr_strongify(self); MTR_LOG_ERROR("%@ Registration error for device nodeID: %@ : %@", self, nodeID, error); }] deviceController:self.uniqueIdentifier registerNodeID:nodeID]; diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 055c8a31ac45c5..a70e4953fbd24d 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -62,6 +62,7 @@ @interface MTRDevice_Concrete () @property (nonatomic, readwrite) MTRDeviceState state; @property (nonatomic, readwrite, nullable) NSDate * estimatedStartTime; @property (nonatomic, readwrite, nullable, copy) NSNumber * estimatedSubscriptionLatency; +@property (nonatomic, readwrite, assign) BOOL suspended; @end @@ -395,6 +396,8 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle }]; } + self.suspended = controller.suspended; + MTR_LOG_DEBUG("%@ init with hex nodeID 0x%016llX", self, _nodeID.unsignedLongLongValue); } return self; @@ -442,8 +445,8 @@ - (NSString *)description wifi = @"NO"; thread = @"NO"; } else { - wifi = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface); - thread = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface); + wifi = MTR_YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface); + thread = MTR_YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface); } NSString * reportAge; @@ -719,8 +722,8 @@ - (BOOL)_subscriptionsAllowed { os_unfair_lock_assert_owner(&self->_lock); - // We should not allow a subscription for suspended controllers or device controllers over XPC. - return _deviceController.isSuspended == NO && ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; + // We should not allow a subscription when we are suspended or for device controllers over XPC. + return self.suspended == NO && ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; } - (void)_delegateAdded @@ -1290,7 +1293,7 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay os_unfair_lock_assert_owner(&_lock); - if (_deviceController.isSuspended) { + if (self.suspended) { MTR_LOG("%@ ignoring expected subscription reset on controller suspend", self); return; } @@ -1378,7 +1381,6 @@ - (void)_reattemptSubscriptionNowIfNeededWithReason:(NSString *)reason } MTR_LOG("%@ reattempting subscription with reason %@", self, reason); - self.reattemptingSubscription = NO; [self _setupSubscriptionWithReason:reason]; } @@ -1850,24 +1852,38 @@ - (void)_handleAttributeReport:(NSArray *> *)attrib [self _reportAttributes:[self _getAttributesToReportWithReportedValues:attributeReport fromSubscription:isFromSubscription]]; } -#ifdef DEBUG -- (void)unitTestInjectEventReport:(NSArray *> *)eventReport +// BEGIN DRAGON: This is used by the XPC Server to inject reports into local cache and broadcast them +- (void)_injectAttributeReport:(NSArray *> *)attributeReport fromSubscription:(BOOL)isFromSubscription { + [_deviceController asyncDispatchToMatterQueue:^{ + [self _handleReportBegin]; + dispatch_async(self.queue, ^{ + [self _handleAttributeReport:attributeReport fromSubscription:isFromSubscription]; + [self _handleReportEnd]; + }); + } errorHandler:nil]; +} + +- (void)_injectEventReport:(NSArray *> *)eventReport +{ + // [_deviceController asyncDispatchToMatterQueue:^{ // TODO: This wasn't used previously, not sure why, so keeping it here for thought, but preserving existing behavior dispatch_async(self.queue, ^{ [self _handleEventReport:eventReport]; }); + // } errorHandler: nil]; +} + +// END DRAGON: This is used by the XPC Server to inject attribute reports + +#ifdef DEBUG +- (void)unitTestInjectEventReport:(NSArray *> *)eventReport +{ + [self _injectEventReport:eventReport]; } - (void)unitTestInjectAttributeReport:(NSArray *> *)attributeReport fromSubscription:(BOOL)isFromSubscription { - [_deviceController asyncDispatchToMatterQueue:^{ - [self _handleReportBegin]; - dispatch_async(self.queue, ^{ - [self _handleAttributeReport:attributeReport fromSubscription:isFromSubscription]; - [self _handleReportEnd]; - }); - } - errorHandler:nil]; + [self _injectAttributeReport:attributeReport fromSubscription:isFromSubscription]; } #endif @@ -2087,7 +2103,7 @@ - (nullable MTRDeviceClusterData *)_clusterDataForPath:(MTRClusterPath *)cluster // Page in the stored value for the data. MTRDeviceClusterData * data = [_deviceController.controllerDataStore getStoredClusterDataForNodeID:_nodeID endpointID:clusterPath.endpoint clusterID:clusterPath.cluster]; - MTR_LOG("%@ cluster path %@ cache miss - load from storage success %@", self, clusterPath, YES_NO(data)); + MTR_LOG("%@ cluster path %@ cache miss - load from storage success %@", self, clusterPath, MTR_YES_NO(data)); if (data != nil) { [_persistedClusterData setObject:data forKey:clusterPath]; } else { @@ -2302,6 +2318,10 @@ - (void)_setupSubscriptionWithReason:(NSString *)reason os_unfair_lock_assert_owner(&self->_lock); + // If we have a pending subscription reattempt, make sure it does not + // actually happen, since we are trying to do a subscription now. + self.reattemptingSubscription = NO; + if (![self _subscriptionsAllowed]) { MTR_LOG("%@ _setupSubscription: Subscriptions not allowed. Do not set up subscription (reason: %@)", self, reason); return; @@ -2694,12 +2714,12 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) // 3. The attribute is not in the spec, and the read params asks to assume // an unknown attribute has the Changes Omitted quality. // - // But all this only happens if this device has been accessed via the public - // API. If it's a device we just created internally, don't do read-throughs. + // But all this only happens if this device is not suspended. If it's suspended, read-throughs will fail + // anyway, so we should not bother trying. BOOL readThroughsAllowed; { std::lock_guard lock(_lock); - readThroughsAllowed = _accessedViaPublicAPI; + readThroughsAllowed = !self.suspended; } if (readThroughsAllowed && (![self _subscriptionAbleToReport] || hasChangesOmittedQuality)) { // Read requests container will be a mutable array of items, each being an array containing: @@ -3991,6 +4011,7 @@ - (void)controllerSuspended [super controllerSuspended]; std::lock_guard lock(self->_lock); + self.suspended = YES; [self _resetSubscriptionWithReasonString:@"Controller suspended"]; // Ensure that any pre-existing resubscribe attempts we control don't try to @@ -4003,6 +4024,7 @@ - (void)controllerResumed [super controllerResumed]; std::lock_guard lock(self->_lock); + self.suspended = NO; if (![self _delegateExists]) { MTR_LOG("%@ ignoring controller resume: no delegates", self); diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index 7a91b926560f30..d0661b2590e9cd 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -120,19 +120,8 @@ MTR_DIRECT_MEMBERS // Our controller. Declared nullable because our property is, though in // practice it does not look like we ever set it to nil. MTRDeviceController * _Nullable _deviceController; - - // Whether this device has been accessed via the public deviceWithNodeID API - // (as opposed to just via the internal _deviceWithNodeID). - BOOL _accessedViaPublicAPI; } -/** - * Internal way of creating an MTRDevice that does not flag the device as being - * visible to external API consumers. - */ -+ (MTRDevice *)_deviceWithNodeID:(NSNumber *)nodeID - controller:(MTRDeviceController *)controller; - - (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller; - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller; diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 46f143e4bc189e..794696f4a98c99 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -111,8 +111,8 @@ - (NSString *)description wifi = @"NO"; thread = @"NO"; } else { - wifi = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface); - thread = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface); + wifi = MTR_YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface); + thread = MTR_YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface); } // TODO: Add these to the description @@ -244,8 +244,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID { NSXPCConnection * xpcConnection = [(MTRDeviceController_XPC *) [self deviceController] xpcConnection]; - // TODO: use asynchronous XPC and register a block with controller to call for this transaction - [[xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + [[xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { MTR_LOG_ERROR("Error: %@", error); }] deviceController:[[self deviceController] uniqueIdentifier] nodeID:[self nodeID] diff --git a/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m b/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m index 15ef7a839de97a..0acfbd9a580371 100644 --- a/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m +++ b/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m @@ -55,6 +55,7 @@ @interface DeviceScannerDelegate : NSObject @property (nonatomic, nullable) XCTestExpectation * expectation; @property (nonatomic) NSMutableArray *> * results; @property (nonatomic) NSMutableArray *> * removedResults; +@property (nonatomic) BOOL expectedResultsCountReached; - (instancetype)initWithExpectation:(XCTestExpectation *)expectation; - (void)controller:(MTRDeviceController *)controller didFindCommissionableDevice:(MTRCommissionableBrowserResult *)device; @@ -71,6 +72,7 @@ - (instancetype)initWithExpectation:(XCTestExpectation *)expectation _expectation = expectation; _results = [[NSMutableArray alloc] init]; _removedResults = [[NSMutableArray alloc] init]; + _expectedResultsCountReached = NO; return self; } @@ -83,6 +85,7 @@ - (instancetype)init _expectation = nil; _results = [[NSMutableArray alloc] init]; _removedResults = [[NSMutableArray alloc] init]; + _expectedResultsCountReached = NO; return self; } @@ -111,7 +114,14 @@ - (void)controller:(MTRDeviceController *)controller didFindCommissionableDevice // Ensure that we just saw the same results as our final set popping in and out if things // ever got removed here. XCTAssertEqualObjects(finalResultsSet, allResultsSet); - [self.expectation fulfill]; + + // If we have a remove and re-add after the result count reached the + // expected one, we can end up in this branch again. Doing the above + // checks is fine, but we shouldn't double-fulfill the expectation. + if (self.expectedResultsCountReached == NO) { + self.expectedResultsCountReached = YES; + [self.expectation fulfill]; + } } XCTAssertLessThanOrEqual(_results.count, kExpectedDiscoveredDevicesCount); diff --git a/src/darwin/Framework/CHIPTests/MTRPairingTests.m b/src/darwin/Framework/CHIPTests/MTRPairingTests.m index 4e597961603ee9..d23c7f32d460b9 100644 --- a/src/darwin/Framework/CHIPTests/MTRPairingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPairingTests.m @@ -138,21 +138,35 @@ @interface MTRPairingTestMonitoringControllerDelegate : NSObject ", self, YES_NO(_statusUpdateCalled), YES_NO(_commissioningSessionEstablishmentDoneCalled), YES_NO(_commissioningCompleteCalled), YES_NO(_readCommissioningInfoCalled)]; + return [NSString stringWithFormat:@"", self, MTR_YES_NO(_statusUpdateCalled), MTR_YES_NO(_commissioningSessionEstablishmentDoneCalled), MTR_YES_NO(_commissioningCompleteCalled), MTR_YES_NO(_readCommissioningInfoCalled)]; } + +- (void)_checkIfAllCallbacksCalled +{ + if (self.allCallbacksCalledExpectation) { + if (self.statusUpdateCalled && self.commissioningSessionEstablishmentDoneCalled && self.commissioningCompleteCalled && self.readCommissioningInfoCalled) { + [self.allCallbacksCalledExpectation fulfill]; + self.allCallbacksCalledExpectation = nil; + } + } +} + - (void)controller:(MTRDeviceController *)controller statusUpdate:(MTRCommissioningStatus)status { self.statusUpdateCalled = YES; + [self _checkIfAllCallbacksCalled]; } - (void)controller:(MTRDeviceController *)controller commissioningSessionEstablishmentDone:(NSError * _Nullable)error { self.commissioningSessionEstablishmentDoneCalled = YES; + [self _checkIfAllCallbacksCalled]; } - (void)controller:(MTRDeviceController *)controller @@ -161,11 +175,13 @@ - (void)controller:(MTRDeviceController *)controller metrics:(MTRMetrics *)metrics { self.commissioningCompleteCalled = YES; + [self _checkIfAllCallbacksCalled]; } - (void)controller:(MTRDeviceController *)controller readCommissioningInfo:(MTRProductIdentity *)info { self.readCommissioningInfoCalled = YES; + [self _checkIfAllCallbacksCalled]; } @end @@ -259,6 +275,8 @@ - (void)doPairingTestWithAttestationDelegate:(id)a // Test that a monitoring delegate works __auto_type * monitoringControllerDelegate = [[MTRPairingTestMonitoringControllerDelegate alloc] init]; + XCTestExpectation * allCallbacksCalledExpectation = [self expectationWithDescription:@"All callbacks called on monitoring delegate"]; + monitoringControllerDelegate.allCallbacksCalledExpectation = allCallbacksCalledExpectation; [sController addDeviceControllerDelegate:monitoringControllerDelegate queue:callbackQueue]; XCTAssertEqual([sController unitTestDelegateCount], 2); @@ -278,7 +296,7 @@ - (void)doPairingTestWithAttestationDelegate:(id)a XCTAssertTrue([sController setupCommissioningSessionWithPayload:payload newNodeID:@(sDeviceId) error:&error]); XCTAssertNil(error); - [self waitForExpectations:@[ expectation ] timeout:kPairingTimeoutInSeconds]; + [self waitForExpectations:@[ expectation, allCallbacksCalledExpectation ] timeout:kPairingTimeoutInSeconds]; XCTAssertNil(controllerDelegate.commissioningCompleteError); // Test that the monitoring delegate got all the callbacks diff --git a/src/lib/core/core.gni b/src/lib/core/core.gni index f2189198e36131..eea73a5c56f7b3 100644 --- a/src/lib/core/core.gni +++ b/src/lib/core/core.gni @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/chip.gni") +import("${chip_root}/config/recommended.gni") + declare_args() { # Enable logging. Shorthand for chip_error_logging, etc. chip_logging = true @@ -28,13 +31,16 @@ declare_args() { chip_progress_logging = chip_logging # Enable detail logging. - chip_detail_logging = chip_logging + chip_detail_logging = matter_enable_recommended && chip_logging # Enable automation logging. - chip_automation_logging = chip_logging + chip_automation_logging = matter_enable_recommended && chip_logging +} +declare_args() { # Configure the maximum size for logged messages - if (current_os == "linux" || current_os == "mac" || current_os == "ios") { + if ((matter_enable_recommended || chip_detail_logging) && + (current_os == "linux" || current_os == "mac" || current_os == "ios")) { # Allow base64 encoding of 1 MTU (4 * (1280 / 3) + padding chip_log_message_max_size = 1708 } else { @@ -88,7 +94,8 @@ declare_args() { chip_config_memory_debug_dmalloc = false # When enabled trace messages using tansport trace hook. - chip_enable_transport_trace = current_os == "linux" || current_os == "mac" + chip_enable_transport_trace = matter_enable_recommended && + (current_os == "linux" || current_os == "mac") # When this is enabled trace messages will be sent to pw_trace. chip_enable_transport_pw_trace = false diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index 31c7cb714f96c0..78446432c58b0a 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -269,6 +269,23 @@ CHIP_ERROR ConfigurationManagerImpl::GetLocationCapability(uint8_t & location) #endif // CONFIG_ENABLE_ESP32_LOCATIONCAPABILITY } +CHIP_ERROR ConfigurationManagerImpl::GetDeviceTypeId(uint32_t & deviceType) +{ + uint32_t value = 0; + CHIP_ERROR err = ReadConfigValue(ESP32Config::kConfigKey_PrimaryDeviceType, value); + + if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) + { + deviceType = CHIP_DEVICE_CONFIG_DEVICE_TYPE; + } + else + { + deviceType = value; + } + + return CHIP_NO_ERROR; +} + CHIP_ERROR ConfigurationManagerImpl::StoreCountryCode(const char * code, size_t codeLen) { // As per spec, codeLen has to be 2 diff --git a/src/platform/ESP32/ConfigurationManagerImpl.h b/src/platform/ESP32/ConfigurationManagerImpl.h index 63b3e094763a75..648c150fc01a44 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.h +++ b/src/platform/ESP32/ConfigurationManagerImpl.h @@ -58,6 +58,7 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp CHIP_ERROR GetSoftwareVersionString(char * buf, size_t bufSize); CHIP_ERROR GetSoftwareVersion(uint32_t & softwareVer) override; CHIP_ERROR GetLocationCapability(uint8_t & location) override; + CHIP_ERROR GetDeviceTypeId(uint32_t & deviceType) override; static ConfigurationManagerImpl & GetDefaultInstance(); // Set the country code to esp_phy layer and also store it to NVS diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index c94de5c04b85b2..df48f5f2955793 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -81,6 +81,7 @@ const ESP32Config::Key ESP32Config::kConfigKey_ProductFinish = { kConfig const ESP32Config::Key ESP32Config::kConfigKey_ProductColor = { kConfigNamespace_ChipFactory, "product-color" }; const ESP32Config::Key ESP32Config::kConfigKey_PartNumber = { kConfigNamespace_ChipFactory, "part-number" }; const ESP32Config::Key ESP32Config::kConfigKey_LocationCapability = { kConfigNamespace_ChipFactory, "loc-capability" }; +const ESP32Config::Key ESP32Config::kConfigKey_PrimaryDeviceType = { kConfigNamespace_ChipFactory, "device-type" }; // Keys stored in the chip-config namespace const ESP32Config::Key ESP32Config::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index 218f2354b2b358..f2f03cf7f9074b 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -83,6 +83,7 @@ class ESP32Config static const Key kConfigKey_ProductFinish; static const Key kConfigKey_ProductColor; static const Key kConfigKey_LocationCapability; + static const Key kConfigKey_PrimaryDeviceType; // CHIP Config keys static const Key kConfigKey_ServiceConfig; diff --git a/src/platform/nxp/BUILD.gn b/src/platform/nxp/BUILD.gn index 0865a1d36dacb6..b2043caac1f0bf 100644 --- a/src/platform/nxp/BUILD.gn +++ b/src/platform/nxp/BUILD.gn @@ -26,7 +26,7 @@ source_set("logging") { "${chip_root}/src/platform/logging:headers", ] - if (nxp_platform == "k32w/k32w0" || nxp_platform == "k32w1") { + if (nxp_platform == "k32w0" || nxp_platform == "mcxw71_k32w1") { sources = [ "${chip_root}/src/platform/nxp/${nxp_platform}/Logging.cpp" ] } else { sources = [ "${chip_root}/src/platform/nxp/common/Logging.cpp" ] diff --git a/src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h b/src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h index ba2321c9a26566..e8d392fb793604 100644 --- a/src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h +++ b/src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h @@ -102,6 +102,10 @@ #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD +#ifndef CHIP_DEVICE_CONFIG_KVS_WEAR_STATS_KEY +#define CHIP_DEVICE_CONFIG_KVS_WEAR_STATS_KEY "nxp/diag/usr" +#endif // CHIP_DEVICE_CONFIG_KVS_WEAR_STATS_KEY + #if CHIP_DEVICE_CONFIG_ENABLE_THREAD && !CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DISCOVERY 1 #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/src/platform/nxp/common/KeyValueStoreManagerImpl.cpp b/src/platform/nxp/common/KeyValueStoreManagerImpl.cpp index af2598ca2be188..737007a46dce68 100644 --- a/src/platform/nxp/common/KeyValueStoreManagerImpl.cpp +++ b/src/platform/nxp/common/KeyValueStoreManagerImpl.cpp @@ -55,7 +55,10 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t ChipLogError(DeviceLayer, "KVS, failed to read key!"); } - *read_bytes_size = read_bytes; + if (read_bytes_size) + { + *read_bytes_size = read_bytes; + } exit: ConvertError(err); diff --git a/src/platform/nxp/common/NXPConfig.h b/src/platform/nxp/common/NXPConfig.h index 03d6174763fb69..7de3beab2b37ed 100644 --- a/src/platform/nxp/common/NXPConfig.h +++ b/src/platform/nxp/common/NXPConfig.h @@ -40,14 +40,12 @@ #if (CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_NVM_FWK) #include "NVM_Interface.h" +#include "ram_storage.h" #elif (CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_LITTLEFS) #include "fwk_filesystem.h" -#endif - -#if (CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_KEY_STORAGE) -#include "fwk_key_storage.h" -#else #include "ram_storage.h" +#elif (CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_KEY_STORAGE) +#include "fwk_key_storage.h" #endif namespace chip { @@ -188,11 +186,14 @@ class NXPConfig private: #if (CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_KEY_STORAGE) static CHIP_ERROR MapKeyStorageStatus(ks_error_t ksStatus); -#else +#elif (CHIP_PLAT_NVM_SUPPORT != CHIP_PLAT_NO_NVM) static CHIP_ERROR MapRamStorageStatus(rsError rsStatus); #endif static int SaveIntKeysToFS(void); static int SaveStringKeysToFS(void); +#if (CHIP_DEVICE_CONFIG_KVS_WEAR_STATS == 1) + static CHIP_ERROR InitStorageWearStats(void); +#endif }; } // namespace Internal diff --git a/src/platform/nxp/common/NXPConfigKS.cpp b/src/platform/nxp/common/NXPConfigKS.cpp index 1940a8081cbf7c..930f07fe3540d4 100644 --- a/src/platform/nxp/common/NXPConfigKS.cpp +++ b/src/platform/nxp/common/NXPConfigKS.cpp @@ -31,6 +31,7 @@ #include #include "fwk_file_cache.h" +#include "fwk_fs_abstraction.h" #include "fwk_key_storage.h" #include "fwk_lfs_mflash.h" @@ -419,26 +420,26 @@ bool NXPConfig::ConfigValueExists(Key key) found = false; readValue_p = NULL; outLen = 0; - /* Max number of bytes read when getting a value */ - bufSize = 256; + bufSize = 0; if (ValidConfigKey(key)) { /* Get the first occurence */ status = KS_GetKeyInt(ks_handle_p, (int) key, (char *) NS_INT, readValue_p, bufSize, &outLen); - found = (status == KS_ERROR_NONE && outLen != 0); + found = (status != KS_ERROR_KEY_NOT_FOUND); } return found; } CHIP_ERROR NXPConfig::FactoryResetConfig(void) { - /*for (Key key = kMinConfigKey_ChipConfig; key <= kMaxConfigKey_ChipConfig; key++) - { - ClearConfigValue(key); - }*/ - - KS_Reset(ks_handle_p); + /* + * When a factory reset is required, shut down the KeyStorage (which + * also flushes the FileCache) and then execute a simple format of the + * the file system partition. + */ + KS_DeInit(ks_handle_p); + FSA_Format(); DBG_PRINTF("FactoryResetConfig done\r\n"); diff --git a/src/platform/nxp/common/NXPConfigNVS.cpp b/src/platform/nxp/common/NXPConfigNVS.cpp index 34d98a36d25002..4cd997b218d473 100644 --- a/src/platform/nxp/common/NXPConfigNVS.cpp +++ b/src/platform/nxp/common/NXPConfigNVS.cpp @@ -20,10 +20,14 @@ #include #include #include +#include #include /* Only for flash init, to be move to sdk framework */ #include "port/nvs_port.h" +#if (CHIP_DEVICE_CONFIG_KVS_WEAR_STATS == 1) +#include "fwk_nvs_stats.h" +#endif /* CHIP_DEVICE_CONFIG_KVS_WEAR_STATS */ // These can be overridden by the application as needed. #ifndef CHIP_DEVICE_INTEGER_SETTINGS_KEY @@ -137,6 +141,17 @@ int DeleteSubtreeCallback(const char * name, size_t /* entrySize */, settings_re return 0; } + +#if (CHIP_DEVICE_CONFIG_KVS_WEAR_STATS == 1) +void OnFlashSectorWearCountUpdate(uint16_t sector_idx, const nvs_storage_wear_profile_t * flash_wear_profile) +{ + char keyUser[] = CHIP_DEVICE_CONFIG_KVS_WEAR_STATS_KEY; + const size_t flash_wear_profile_size = NVS_STORAGE_WEAR_PROFILE_SIZE(flash_wear_profile->sector_count); + + /* Update the NVS stats key in storage */ + NXPConfig::WriteConfigValueBin((const char *) keyUser, (uint8_t *) flash_wear_profile, flash_wear_profile_size); +} +#endif /* CHIP_DEVICE_CONFIG_KVS_WEAR_STATS */ } // namespace CHIP_ERROR NXPConfig::Init() @@ -151,8 +166,50 @@ CHIP_ERROR NXPConfig::Init() ReturnErrorCodeIf(settings_subsys_init(), CHIP_ERROR_PERSISTED_STORAGE_FAILED); +#if (CHIP_DEVICE_CONFIG_KVS_WEAR_STATS == 1) + ReturnErrorOnFailure(InitStorageWearStats()); +#endif /* CHIP_DEVICE_CONFIG_KVS_WEAR_STATS */ + + return CHIP_NO_ERROR; +} + +#if (CHIP_DEVICE_CONFIG_KVS_WEAR_STATS == 1) +CHIP_ERROR NXPConfig::InitStorageWearStats(void) +{ + nvs_storage_wear_profile_t * flash_wear_profile = NULL; + const size_t flash_wear_profile_size = NVS_STORAGE_WEAR_PROFILE_SIZE((uint32_t) NV_STORAGE_MAX_SECTORS); + size_t size; + char keyUser[] = CHIP_DEVICE_CONFIG_KVS_WEAR_STATS_KEY; + + /* Create an empty flash wear profile */ + flash_wear_profile = (nvs_storage_wear_profile_t *) calloc(1, flash_wear_profile_size); + ReturnErrorCodeIf(flash_wear_profile == NULL, CHIP_ERROR_NO_MEMORY); + + /* Try to read the flash wear profile from the User Support diagnostic log key */ + CHIP_ERROR err = ReadConfigValueBin((const char *) keyUser, (uint8_t *) flash_wear_profile, flash_wear_profile_size, size); + if ((err != CHIP_NO_ERROR) || (size != flash_wear_profile_size) || + (flash_wear_profile->sector_count != (uint32_t) NV_STORAGE_MAX_SECTORS)) + { + /* Either the flash wear stats are not available in the persistent + * storage or the flash wear statistics that we have read are not + * compatible with the current persistent storage configuration. In + * this case - just reset and save the flash wear statistics. */ + flash_wear_profile->sector_count = (uint32_t) NV_STORAGE_MAX_SECTORS; + memset(flash_wear_profile->erase_count, 0, (uint32_t) NV_STORAGE_MAX_SECTORS * sizeof(uint16_t)); + WriteConfigValueBin((const char *) keyUser, (uint8_t *) flash_wear_profile, flash_wear_profile_size); + } + else + { + /* Load the flash wear profile into the NVS statistics */ + nvs_stats_load_profile(flash_wear_profile); + } + free(flash_wear_profile); + + nvs_stats_config_event_handler(OnFlashSectorWearCountUpdate); + return CHIP_NO_ERROR; } +#endif /* CHIP_DEVICE_CONFIG_KVS_WEAR_STATS */ CHIP_ERROR NXPConfig::ReadConfigValue(Key key, bool & val) { diff --git a/src/platform/nxp/common/legacy/gatt_db.h b/src/platform/nxp/common/legacy/gatt_db.h new file mode 100644 index 00000000000000..604fcfb61a7ba1 --- /dev/null +++ b/src/platform/nxp/common/legacy/gatt_db.h @@ -0,0 +1,30 @@ +PRIMARY_SERVICE(service_gatt, gBleSig_GenericAttributeProfile_d) +CHARACTERISTIC(char_service_changed, gBleSig_GattServiceChanged_d, (gGattCharPropRead_c | gGattCharPropNotify_c)) +VALUE(value_service_changed, gBleSig_GattServiceChanged_d, (gPermissionNone_c), 4, 0x00, 0x00, 0x00, 0x00) +CCCD(cccd_service_changed) + +PRIMARY_SERVICE(service_gap, gBleSig_GenericAccessProfile_d) +CHARACTERISTIC(char_device_name, gBleSig_GapDeviceName_d, (gGattCharPropRead_c)) +VALUE(value_device_name, gBleSig_GapDeviceName_d, (gPermissionFlagReadable_c), 16, "NXP_ELOCK_DEMO") +CHARACTERISTIC(char_appearance, gBleSig_GapAppearance_d, (gGattCharPropRead_c)) +VALUE(value_appearance, gBleSig_GapAppearance_d, (gPermissionFlagReadable_c), 2, 0x00, 0x00) + +PRIMARY_SERVICE(service_chipoble, gChipoBleService_d) +CHARACTERISTIC_UUID128(chipoble_rx, uuid_chipoble_rx, (gGattCharPropWrite_c)) +VALUE_UUID128_VARLEN(value_chipoble_rx, uuid_chipoble_rx, (gPermissionFlagWritable_c), gAttMaxMtu_c - 3, gAttMaxMtu_c - 3, 0x00) +CHARACTERISTIC_UUID128(chipoble_tx, uuid_chipoble_tx, (gGattCharPropIndicate_c | gGattCharPropRead_c)) +VALUE_UUID128_VARLEN(value_chipoble_tx, uuid_chipoble_tx, (gPermissionFlagReadable_c), gAttMaxMtu_c - 3, gAttMaxMtu_c - 3, 0x00) +CCCD(cccd_chipoble_tx) +CHARACTERISTIC_UUID128(chipoble_c3, uuid_chipoble_c3, (gGattCharPropRead_c)) +VALUE_UUID128_VARLEN(value_chipoble_c3, uuid_chipoble_c3, (gPermissionFlagReadable_c), gAttMaxReadDataSize_d(gAttMaxValueLength_c), + gAttMaxReadDataSize_d(gAttMaxValueLength_c), 0x00) + +PRIMARY_SERVICE(service_device_info, gBleSig_DeviceInformationService_d) +CHARACTERISTIC(char_model_no, gBleSig_ModelNumberString_d, (gGattCharPropRead_c)) +VALUE(value_model_no, gBleSig_ModelNumberString_d, (gPermissionFlagReadable_c), 15, "Chip ELock Demo") +CHARACTERISTIC(char_serial_no, gBleSig_SerialNumberString_d, (gGattCharPropRead_c)) +VALUE(value_serial_no, gBleSig_SerialNumberString_d, (gPermissionFlagReadable_c), 7, "BLESN01") +CHARACTERISTIC(char_fw_rev, gBleSig_FirmwareRevisionString_d, (gGattCharPropRead_c)) +VALUE(value_fw_rev, gBleSig_FirmwareRevisionString_d, (gPermissionFlagReadable_c), 5, "1.1.1") +CHARACTERISTIC(char_sw_rev, gBleSig_SoftwareRevisionString_d, (gGattCharPropRead_c)) +VALUE(value_sw_rev, gBleSig_SoftwareRevisionString_d, (gPermissionFlagReadable_c), 5, "1.1.4") diff --git a/src/platform/nxp/common/legacy/gatt_uuid128.h b/src/platform/nxp/common/legacy/gatt_uuid128.h new file mode 100644 index 00000000000000..938968b1943ce2 --- /dev/null +++ b/src/platform/nxp/common/legacy/gatt_uuid128.h @@ -0,0 +1,26 @@ +/* +* Declare all custom 128-bit UUIDs here using the format: +* +* UUID128(name, bytes) +* +* where: +* -name : an unique tag for the newly defined UUID; + will be used to reference this UUID when defining + services and characteristics in <> +* -bytes: 16 bytes representing the 128-bit value +* +* One definition per line. No semicolon required after each definition. +* +* example: +* UUID128(uuid_service_robot_characteristics, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, +0xCD, 0xEF) +* UUID128(uuid_char_robot_direction, 0x12, 0x34, 0x50, 0x00, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, +0xEF) +*/ +/* Services */ + +#define gChipoBleService_d 0xFFF6 + +UUID128(uuid_chipoble_tx, 0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18) +UUID128(uuid_chipoble_rx, 0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18) +UUID128(uuid_chipoble_c3, 0x04, 0x8f, 0x21, 0x83, 0x8a, 0x74, 0x7d, 0xb8, 0xf2, 0x45, 0x72, 0x87, 0x38, 0x02, 0x63, 0x64) diff --git a/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp b/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp index b5a9c1eb56a3f8..6e5470f7d05f26 100644 --- a/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp +++ b/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp @@ -327,7 +327,7 @@ void ConnectivityManagerImpl::DriveStationState() ChipLogProgress(DeviceLayer, "Attempting to connect WiFi"); if ((serr = wfx_connect_to_ap()) != SL_STATUS_OK) { - ChipLogError(DeviceLayer, "wfx_connect_to_ap() failed."); + ChipLogError(DeviceLayer, "wfx_connect_to_ap() failed: %" PRId32, serr); } SuccessOrExit(serr); diff --git a/src/platform/silabs/KeyValueStoreManagerImpl.cpp b/src/platform/silabs/KeyValueStoreManagerImpl.cpp index 012c951aaaa729..34d88388badf22 100644 --- a/src/platform/silabs/KeyValueStoreManagerImpl.cpp +++ b/src/platform/silabs/KeyValueStoreManagerImpl.cpp @@ -88,9 +88,9 @@ uint16_t KeyValueStoreManagerImpl::hashKvsKeyString(const char * key) const CHIP_ERROR KeyValueStoreManagerImpl::MapKvsKeyToNvm3(const char * key, uint16_t hash, uint32_t & nvm3Key, bool isSlotNeeded) const { CHIP_ERROR err; - char * strPrefix = nullptr; - uint8_t firstEmptyKeySlot = kMaxEntries; - for (uint8_t keyIndex = 0; keyIndex < kMaxEntries; keyIndex++) + char * strPrefix = nullptr; + uint16_t firstEmptyKeySlot = kMaxEntries; + for (uint16_t keyIndex = 0; keyIndex < kMaxEntries; keyIndex++) { if (mKvsKeyMap[keyIndex] == hash) { @@ -165,7 +165,7 @@ void KeyValueStoreManagerImpl::ScheduleKeyMapSave(void) Commit the key map in nvm once it as stabilized. */ SystemLayer().StartTimer( - std::chrono::duration_cast(System::Clock::Seconds32(SILABS_KVS_SAVE_DELAY_SECONDS)), + std::chrono::duration_cast(System::Clock::Seconds32(SL_KVS_SAVE_DELAY_SECONDS)), KeyValueStoreManagerImpl::OnScheduledKeyMapSave, NULL); } @@ -247,7 +247,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) void KeyValueStoreManagerImpl::ErasePartition(void) { // Iterate over all the Matter Kvs nvm3 records and delete each one... - for (uint32_t nvm3Key = SilabsConfig::kMinConfigKey_MatterKvs; nvm3Key <= SilabsConfig::kMaxConfigKey_MatterKvs; nvm3Key++) + for (uint32_t nvm3Key = SilabsConfig::kMinConfigKey_MatterKvs; nvm3Key <= SilabsConfig::kConfigKey_KvsLastKeySlot; nvm3Key++) { SilabsConfig::ClearConfigValue(nvm3Key); } diff --git a/src/platform/silabs/NetworkCommissioningWiFiDriver.cpp b/src/platform/silabs/NetworkCommissioningWiFiDriver.cpp index 614a121280eaef..7f6240c32c5858 100644 --- a/src/platform/silabs/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/silabs/NetworkCommissioningWiFiDriver.cpp @@ -147,10 +147,19 @@ CHIP_ERROR SlWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, } } ReturnErrorOnFailure(ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled)); + // Set the wifi configuration - wfx_wifi_provision_t wifiConfig = {}; + wfx_wifi_provision_t wifiConfig; + memset(&wifiConfig, 0, sizeof(wifiConfig)); + + VerifyOrReturnError(ssidLen <= WFX_MAX_SSID_LENGTH, CHIP_ERROR_BUFFER_TOO_SMALL); memcpy(wifiConfig.ssid, ssid, ssidLen); + wifiConfig.ssid_length = ssidLen; + + VerifyOrReturnError(keyLen < WFX_MAX_PASSKEY_LENGTH, CHIP_ERROR_BUFFER_TOO_SMALL); memcpy(wifiConfig.passkey, key, keyLen); + wifiConfig.passkey_length = keyLen; + wifiConfig.security = WFX_SEC_WPA2; ChipLogProgress(NetworkProvisioning, "Setting up connection for WiFi SSID: %.*s", static_cast(ssidLen), ssid); diff --git a/src/platform/silabs/SiWx917/wifi/ethernetif.cpp b/src/platform/silabs/SiWx917/wifi/ethernetif.cpp index 72725102d6da48..2860b895ce7fae 100644 --- a/src/platform/silabs/SiWx917/wifi/ethernetif.cpp +++ b/src/platform/silabs/SiWx917/wifi/ethernetif.cpp @@ -44,7 +44,7 @@ extern "C" { #include "lwip/ethip6.h" #include "lwip/timeouts.h" #include "netif/etharp.h" -#include "silabs_utils.h" +#include StaticSemaphore_t xEthernetIfSemaBuffer; @@ -131,13 +131,13 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len) (memcmp(netif->hwaddr, dst_mac, netif->hwaddr_len) != 0)) { #ifdef WIFI_DEBUG_ENABLED - SILABS_LOG("%s: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__, + ChipLogDetail(DeviceLayer, "DROP: [%02x:%02x:%02x:%02x:%02x:%02x]->[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", - dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5], + src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5], - src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5], + dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5], - b[12], b[13]); + b[12], b[13]); #endif return; } @@ -153,14 +153,14 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len) bufferoffset += q->len; } #ifdef WIFI_DEBUG_ENABLED - SILABS_LOG("%s: ACCEPT %d, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__, - bufferoffset, + ChipLogDetail(DeviceLayer, "ACCEPT(%d): [%02x:%02x:%02x:%02x:%02x:%02x]->[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", + bufferoffset, - dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5], + src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5], - src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5], + dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5], - b[12], b[13]); + b[12], b[13]); #endif if (netif->input(p, netif) != ERR_OK) diff --git a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h index 319a1c508e658d..42a5dfffc1c381 100644 --- a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h +++ b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h @@ -159,7 +159,9 @@ typedef enum typedef struct { char ssid[WFX_MAX_SSID_LENGTH + 1]; + size_t ssid_length; char passkey[WFX_MAX_PASSKEY_LENGTH + 1]; + size_t passkey_length; wfx_sec_t security; } wfx_wifi_provision_t; @@ -175,6 +177,7 @@ typedef enum typedef struct wfx_wifi_scan_result { char ssid[WFX_MAX_SSID_LENGTH + 1]; + size_t ssid_length; wfx_sec_t security; uint8_t bssid[BSSID_LEN]; uint8_t chan; diff --git a/src/platform/silabs/SilabsConfig.h b/src/platform/silabs/SilabsConfig.h index ccb14beeb8f177..cef9ca323f74d2 100644 --- a/src/platform/silabs/SilabsConfig.h +++ b/src/platform/silabs/SilabsConfig.h @@ -35,9 +35,11 @@ #endif // Delay before Key/Value is actually saved in NVM -#define SILABS_KVS_SAVE_DELAY_SECONDS 5 +#ifndef SL_KVS_SAVE_DELAY_SECONDS +#define SL_KVS_SAVE_DELAY_SECONDS 2 +#endif -static_assert((KVS_MAX_ENTRIES <= 255), "Implementation supports up to 255 Kvs entries"); +static_assert((KVS_MAX_ENTRIES <= 511), "Implementation supports up to 511 Kvs entries"); static_assert((KVS_MAX_ENTRIES >= 30), "Mininimal Kvs entries requirement is not met"); namespace chip { @@ -89,7 +91,8 @@ class SilabsConfig // Persistent counter values set at runtime. Retained during factory reset. static constexpr uint8_t kMatterCounter_KeyBase = 0x74; // Persistent config values set at runtime. Cleared during factory reset. - static constexpr uint8_t kMatterKvs_KeyBase = 0x75; + static constexpr uint8_t kMatterKvs_KeyBase = 0x75; + static constexpr uint8_t kMatterKvs_ExtendedRange = 0x76; // Key definitions for well-known configuration values. // Factory config keys @@ -167,7 +170,8 @@ class SilabsConfig // Matter KVS storage Keys static constexpr Key kConfigKey_KvsStringKeyMap = SilabsConfigKey(kMatterKvs_KeyBase, 0x00); static constexpr Key kConfigKey_KvsFirstKeySlot = SilabsConfigKey(kMatterKvs_KeyBase, 0x01); - static constexpr Key kConfigKey_KvsLastKeySlot = SilabsConfigKey(kMatterKvs_KeyBase, KVS_MAX_ENTRIES); + static constexpr Key kConfigKey_KvsLastKeySlot = + SilabsConfigKey(kMatterKvs_KeyBase + (KVS_MAX_ENTRIES >> 8), KVS_MAX_ENTRIES & UINT8_MAX); // Set key id limits for each group. static constexpr Key kMinConfigKey_MatterFactory = SilabsConfigKey(kMatterFactory_KeyBase, 0x00); @@ -180,7 +184,9 @@ class SilabsConfig static constexpr Key kMaxConfigKey_MatterCounter = SilabsConfigKey(kMatterCounter_KeyBase, 0x1F); static constexpr Key kMinConfigKey_MatterKvs = kConfigKey_KvsStringKeyMap; - static constexpr Key kMaxConfigKey_MatterKvs = kConfigKey_KvsLastKeySlot; + static constexpr Key kMaxConfigKey_MatterKvs = SilabsConfigKey(kMatterKvs_ExtendedRange, 0xFF); + static_assert(kConfigKey_KvsLastKeySlot <= kMaxConfigKey_MatterKvs, + "Configured KVS_MAX_ENTRIES overflows the reserved KVS Key range"); static CHIP_ERROR Init(void); static void DeInit(void); diff --git a/src/platform/silabs/efr32/wifi/ethernetif.cpp b/src/platform/silabs/efr32/wifi/ethernetif.cpp index 0388337939a3e2..d0f0ec6daf47f7 100644 --- a/src/platform/silabs/efr32/wifi/ethernetif.cpp +++ b/src/platform/silabs/efr32/wifi/ethernetif.cpp @@ -148,8 +148,8 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len) (memcmp(netif->hwaddr, dst_mac, netif->hwaddr_len) != 0)) { #ifdef WIFI_DEBUG_ENABLED - ChipLogProgress(DeviceLayer, "%s: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", - __func__, + ChipLogProgress(DeviceLayer, + "lwip_input: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5], @@ -172,7 +172,7 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len) } #ifdef WIFI_DEBUG_ENABLED ChipLogProgress(DeviceLayer, - "%s: ACCEPT %ld, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__, + "lwip_input: ACCEPT %ld, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", bufferoffset, dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5], diff --git a/src/platform/silabs/efr32/wifi/wfx_host_events.h b/src/platform/silabs/efr32/wifi/wfx_host_events.h index 51f96d7b9dbc73..4686931eafac4e 100644 --- a/src/platform/silabs/efr32/wifi/wfx_host_events.h +++ b/src/platform/silabs/efr32/wifi/wfx_host_events.h @@ -254,7 +254,9 @@ typedef enum typedef struct { char ssid[WFX_MAX_SSID_LENGTH + 1]; + size_t ssid_length; char passkey[WFX_MAX_PASSKEY_LENGTH + 1]; + size_t passkey_length; wfx_sec_t security; } wfx_wifi_provision_t; @@ -270,6 +272,7 @@ typedef enum typedef struct wfx_wifi_scan_result { char ssid[WFX_MAX_SSID_LENGTH + 1]; + size_t ssid_length; wfx_sec_t security; uint8_t bssid[BSSID_LEN]; uint8_t chan; diff --git a/src/protocols/bdx/TransferFacilitator.cpp b/src/protocols/bdx/TransferFacilitator.cpp index fbe563187b6fb9..94962e26402cdb 100644 --- a/src/protocols/bdx/TransferFacilitator.cpp +++ b/src/protocols/bdx/TransferFacilitator.cpp @@ -32,6 +32,20 @@ namespace bdx { constexpr System::Clock::Timeout TransferFacilitator::kDefaultPollFreq; constexpr System::Clock::Timeout TransferFacilitator::kImmediatePollDelay; +TransferFacilitator::~TransferFacilitator() +{ + ResetTransfer(); +} + +void TransferFacilitator::ResetTransfer() +{ + mTransfer.Reset(); + ChipLogProgress(BDX, "Stop polling for messages"); + + VerifyOrReturn(mSystemLayer != nullptr); + mSystemLayer->CancelTimer(PollTimerHandler, this); +} + CHIP_ERROR TransferFacilitator::OnMessageReceived(chip::Messaging::ExchangeContext * ec, const chip::PayloadHeader & payloadHeader, chip::System::PacketBufferHandle && payload) { @@ -78,15 +92,7 @@ void TransferFacilitator::PollForOutput() HandleTransferSessionOutput(outEvent); VerifyOrReturn(mSystemLayer != nullptr, ChipLogError(BDX, "%s mSystemLayer is null", __FUNCTION__)); - if (!mStopPolling) - { - mSystemLayer->StartTimer(mPollFreq, PollTimerHandler, this); - } - else - { - mSystemLayer->CancelTimer(PollTimerHandler, this); - mStopPolling = false; - } + mSystemLayer->StartTimer(mPollFreq, PollTimerHandler, this); } void TransferFacilitator::ScheduleImmediatePoll() @@ -106,18 +112,10 @@ CHIP_ERROR Responder::PrepareForTransfer(System::Layer * layer, TransferRole rol ReturnErrorOnFailure(mTransfer.WaitForTransfer(role, xferControlOpts, maxBlockSize, timeout)); ChipLogProgress(BDX, "Start polling for messages"); - mStopPolling = false; mSystemLayer->StartTimer(mPollFreq, PollTimerHandler, this); return CHIP_NO_ERROR; } -void Responder::ResetTransfer() -{ - mTransfer.Reset(); - ChipLogProgress(BDX, "Stop polling for messages"); - mStopPolling = true; -} - CHIP_ERROR Initiator::InitiateTransfer(System::Layer * layer, TransferRole role, const TransferSession::TransferInitData & initData, System::Clock::Timeout timeout, System::Clock::Timeout pollFreq) { @@ -132,12 +130,5 @@ CHIP_ERROR Initiator::InitiateTransfer(System::Layer * layer, TransferRole role, return CHIP_NO_ERROR; } -void Initiator::ResetTransfer() -{ - mTransfer.Reset(); - ChipLogProgress(BDX, "Stop polling for messages"); - mStopPolling = true; -} - } // namespace bdx } // namespace chip diff --git a/src/protocols/bdx/TransferFacilitator.h b/src/protocols/bdx/TransferFacilitator.h index 97e981ac693ad8..280b6bf06896aa 100644 --- a/src/protocols/bdx/TransferFacilitator.h +++ b/src/protocols/bdx/TransferFacilitator.h @@ -45,7 +45,12 @@ class TransferFacilitator : public Messaging::ExchangeDelegate, public Messaging { public: TransferFacilitator() : mExchangeCtx(nullptr), mSystemLayer(nullptr), mPollFreq(kDefaultPollFreq) {} - ~TransferFacilitator() override = default; + ~TransferFacilitator() override; + + /** + * Calls reset on the TransferSession object and stops the poll timer. + */ + void ResetTransfer(); private: //// UnsolicitedMessageHandler Implementation //// @@ -96,7 +101,6 @@ class TransferFacilitator : public Messaging::ExchangeDelegate, public Messaging System::Clock::Timeout mPollFreq; static constexpr System::Clock::Timeout kDefaultPollFreq = System::Clock::Milliseconds32(500); static constexpr System::Clock::Timeout kImmediatePollDelay = System::Clock::Milliseconds32(1); - bool mStopPolling = false; }; /** @@ -121,11 +125,6 @@ class Responder : public TransferFacilitator CHIP_ERROR PrepareForTransfer(System::Layer * layer, TransferRole role, BitFlags xferControlOpts, uint16_t maxBlockSize, System::Clock::Timeout timeout, System::Clock::Timeout pollFreq = TransferFacilitator::kDefaultPollFreq); - - /** - * Calls reset on the TransferSession object and stops the poll timer. - */ - void ResetTransfer(); }; /** @@ -150,10 +149,6 @@ class Initiator : public TransferFacilitator CHIP_ERROR InitiateTransfer(System::Layer * layer, TransferRole role, const TransferSession::TransferInitData & initData, System::Clock::Timeout timeout, System::Clock::Timeout pollFreq = TransferFacilitator::kDefaultPollFreq); - /** - * Calls reset on the TransferSession object and stops the poll timer. - */ - void ResetTransfer(); }; } // namespace bdx diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index df922748999dd0..8b064a775f358b 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -123,6 +123,7 @@ async def setup_class(self): self.set_of_dut_endpoints_before_adding_device = set(root_part_list) super().setup_class() + self._active_change_event_subscription = None self.app_process = None self.app_process_paused = False app = self.user_params.get("th_icd_server_app_path", None) @@ -156,6 +157,10 @@ async def setup_class(self): params.commissioningParameters.setupManualCode, params.commissioningParameters.setupQRCode) def teardown_class(self): + if self._active_change_event_subscription is not None: + self._active_change_event_subscription.Shutdown() + self._active_change_event_subscription = None + # In case the th_icd_server_app_path does not exist, then we failed the test # and there is nothing to remove if self.app_process is not None: @@ -239,8 +244,8 @@ async def test_TC_BRBINFO_4_1(self): self.q = queue.Queue() urgent = 1 cb = SimpleEventCallback("ActiveChanged", event.cluster_id, event.event_id, self.q) - subscription = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=[(dynamic_endpoint_id, event, urgent)], reportInterval=[1, 3]) - subscription.SetEventUpdateCallback(callback=cb) + self._active_change_event_subscription = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=[(dynamic_endpoint_id, event, urgent)], reportInterval=[1, 3]) + self._active_change_event_subscription.SetEventUpdateCallback(callback=cb) self.step("3") stay_active_duration_ms = 1000 diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index 8e7a8f1fde6ac3..87849e40443d01 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -141,7 +141,7 @@ async def test_TC_CCTRL_2_2(self): events = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=event_path) self.step(5) - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=1, responseTimeoutSeconds=30) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=1, responseTimeoutSeconds=30) try: await self.send_single_cmd(cmd) asserts.fail("Unexpected success on CommissionNode") @@ -162,7 +162,7 @@ async def test_TC_CCTRL_2_2(self): self.step(8) good_request_id = 0x1234567887654321 cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( - requestId=good_request_id, vendorId=th_server_vid, productId=th_server_pid) + requestID=good_request_id, vendorID=th_server_vid, productID=th_server_pid) try: await self.send_single_cmd(cmd=cmd, node_id=pase_nodeid) asserts.fail("Unexpected success on RequestCommissioningApproval over PASE") @@ -187,7 +187,7 @@ async def test_TC_CCTRL_2_2(self): not_th_server_vid = 0x6006 asserts.assert_not_equal(not_th_server_vid, th_server_vid, "Test implementation assumption incorrect") cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( - requestId=good_request_id, vendorId=not_th_server_vid, productId=th_server_pid) + requestID=good_request_id, vendorID=not_th_server_vid, productID=th_server_pid) # If no exception is raised, this is success await self.send_single_cmd(cmd) @@ -203,13 +203,13 @@ async def test_TC_CCTRL_2_2(self): new_event = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=event_path, eventNumberFilter=max(event_nums)+1) asserts.assert_equal(len(new_event), 1, "Unexpected event list len") asserts.assert_equal(new_event[0].Data.statusCode, 0, "Unexpected status code") - asserts.assert_equal(new_event[0].Data.clientNodeId, + asserts.assert_equal(new_event[0].Data.clientNodeID, self.matter_test_config.controller_node_id, "Unexpected client node id") - asserts.assert_equal(new_event[0].Data.requestId, good_request_id, "Unexpected request ID") + asserts.assert_equal(new_event[0].Data.requestID, good_request_id, "Unexpected request ID") self.step(14) bad_request_id = 0x1234567887654322 - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=bad_request_id, responseTimeoutSeconds=30) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=bad_request_id, responseTimeoutSeconds=30) try: await self.send_single_cmd(cmd=cmd) asserts.fail("Unexpected success on CommissionNode") @@ -217,7 +217,7 @@ async def test_TC_CCTRL_2_2(self): asserts.assert_equal(e.status, Status.Failure, "Incorrect error returned") self.step(15) - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=29) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=good_request_id, responseTimeoutSeconds=29) try: await self.send_single_cmd(cmd=cmd) asserts.fail("Unexpected success on CommissionNode") @@ -225,7 +225,7 @@ async def test_TC_CCTRL_2_2(self): asserts.assert_equal(e.status, Status.ConstraintError, "Incorrect error returned") self.step(16) - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=121) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=good_request_id, responseTimeoutSeconds=121) try: await self.send_single_cmd(cmd=cmd) asserts.fail("Unexpected success on CommissionNode") @@ -233,7 +233,7 @@ async def test_TC_CCTRL_2_2(self): asserts.assert_equal(e.status, Status.ConstraintError, "Incorrect error returned") self.step(17) - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=30) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=good_request_id, responseTimeoutSeconds=30) resp: Clusters.CommissionerControl.Commands.ReverseOpenCommissioningWindow = await self.send_single_cmd(cmd) asserts.assert_equal(type(resp), Clusters.CommissionerControl.Commands.ReverseOpenCommissioningWindow, "Incorrect response type") @@ -263,7 +263,7 @@ async def test_TC_CCTRL_2_2(self): self.step(22) good_request_id = 0x1234567812345678 cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( - requestId=good_request_id, vendorId=th_server_vid, productId=th_server_pid, label="Test Ecosystem") + requestID=good_request_id, vendorID=th_server_vid, productID=th_server_pid, label="Test Ecosystem") await self.send_single_cmd(cmd) self.step(23) @@ -276,12 +276,12 @@ async def test_TC_CCTRL_2_2(self): new_event = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=event_path, eventNumberFilter=max(event_nums)+1) asserts.assert_equal(len(new_event), 1, "Unexpected event list len") asserts.assert_equal(new_event[0].Data.statusCode, 0, "Unexpected status code") - asserts.assert_equal(new_event[0].Data.clientNodeId, + asserts.assert_equal(new_event[0].Data.clientNodeID, self.matter_test_config.controller_node_id, "Unexpected client node id") - asserts.assert_equal(new_event[0].Data.requestId, good_request_id, "Unexpected request ID") + asserts.assert_equal(new_event[0].Data.requestID, good_request_id, "Unexpected request ID") self.step(25) - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=30) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=good_request_id, responseTimeoutSeconds=30) resp = await self.send_single_cmd(cmd) asserts.assert_equal(type(resp), Clusters.CommissionerControl.Commands.ReverseOpenCommissioningWindow, "Incorrect response type") diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index 224f283f46d27b..2c1c20e17f309f 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -34,7 +34,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - per_endpoint_test) + run_if_endpoint_matches) from mobly import asserts @@ -109,7 +109,7 @@ def steps_TC_CCTRL_2_3(self) -> list[TestStep]: def default_timeout(self) -> int: return 3*60 - @per_endpoint_test(has_cluster(Clusters.CommissionerControl)) + @run_if_endpoint_matches(has_cluster(Clusters.CommissionerControl)) async def test_TC_CCTRL_2_3(self): self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') @@ -125,7 +125,7 @@ async def test_TC_CCTRL_2_3(self): self.step(4) good_request_id = 0x1234567812345678 cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( - requestId=good_request_id, vendorId=th_server_vid, productId=th_server_pid, label="Test Ecosystem") + requestID=good_request_id, vendorID=th_server_vid, productID=th_server_pid, label="Test Ecosystem") await self.send_single_cmd(cmd=cmd) self.step(5) @@ -137,13 +137,13 @@ async def test_TC_CCTRL_2_3(self): events = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=event_path) asserts.assert_equal(len(events), 1, "Unexpected event list len") asserts.assert_equal(events[0].Data.statusCode, 0, "Unexpected status code") - asserts.assert_equal(events[0].Data.clientNodeId, + asserts.assert_equal(events[0].Data.clientNodeID, self.matter_test_config.controller_node_id, "Unexpected client node id") - asserts.assert_equal(events[0].Data.requestId, good_request_id, "Unexpected request ID") + asserts.assert_equal(events[0].Data.requestID, good_request_id, "Unexpected request ID") self.step(7) cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( - requestId=good_request_id, vendorId=th_server_vid, productId=th_server_pid) + requestID=good_request_id, vendorID=th_server_vid, productID=th_server_pid) try: await self.send_single_cmd(cmd=cmd) asserts.fail("Unexpected success on CommissionNode") @@ -151,13 +151,13 @@ async def test_TC_CCTRL_2_3(self): asserts.assert_equal(e.status, Status.Failure, "Incorrect error returned") self.step(8) - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=30) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=good_request_id, responseTimeoutSeconds=30) resp = await self.send_single_cmd(cmd) asserts.assert_equal(type(resp), Clusters.CommissionerControl.Commands.ReverseOpenCommissioningWindow, "Incorrect response type") self.step(9) - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=30) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=good_request_id, responseTimeoutSeconds=30) try: await self.send_single_cmd(cmd=cmd) asserts.fail("Unexpected success on CommissionNode") diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index e56a1fb8246b56..4ea9d362655884 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -111,7 +111,7 @@ async def test_TC_MCORE_FS_1_1(self): self.step("3a") good_request_id = 0x1234567812345678 cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( - requestId=good_request_id, vendorId=th_fsa_server_vid, productId=th_fsa_server_pid, label="Test Ecosystem") + requestID=good_request_id, vendorID=th_fsa_server_vid, productID=th_fsa_server_pid, label="Test Ecosystem") await self.send_single_cmd(cmd, endpoint=dut_commissioning_control_endpoint) if not self.is_ci: @@ -125,12 +125,12 @@ async def test_TC_MCORE_FS_1_1(self): asserts.assert_equal(len(new_event), 1, "Unexpected event list len") asserts.assert_equal(new_event[0].Data.statusCode, 0, "Unexpected status code") - asserts.assert_equal(new_event[0].Data.clientNodeId, + asserts.assert_equal(new_event[0].Data.clientNodeID, self.matter_test_config.controller_node_id, "Unexpected client node id") - asserts.assert_equal(new_event[0].Data.requestId, good_request_id, "Unexpected request ID") + asserts.assert_equal(new_event[0].Data.requestID, good_request_id, "Unexpected request ID") self.step("3b") - cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=30) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestID=good_request_id, responseTimeoutSeconds=30) resp = await self.send_single_cmd(cmd, endpoint=dut_commissioning_control_endpoint) asserts.assert_equal(type(resp), Clusters.CommissionerControl.Commands.ReverseOpenCommissioningWindow, "Incorrect response type") diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index 816abe5d876b00..b18dcc5b42ef64 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -63,10 +63,15 @@ class TC_MCORE_FS_1_2(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() + self._partslist_subscription = None self._app_th_server_process = None self._th_server_kvs = None def teardown_class(self): + if self._partslist_subscription is not None: + self._partslist_subscription.Shutdown() + self._partslist_subscription = None + if self._app_th_server_process is not None: logging.warning("Stopping app with SIGTERM") self._app_th_server_process.send_signal(signal.SIGTERM.value) @@ -142,7 +147,7 @@ async def test_TC_MCORE_FS_1_2(self): subscription_contents = [ (root_endpoint, Clusters.Descriptor.Attributes.PartsList) ] - sub = await self.default_controller.ReadAttribute( + self._partslist_subscription = await self.default_controller.ReadAttribute( nodeid=self.dut_node_id, attributes=subscription_contents, reportInterval=(min_report_interval_sec, max_report_interval_sec), @@ -152,8 +157,8 @@ async def test_TC_MCORE_FS_1_2(self): parts_list_queue = queue.Queue() attribute_handler = AttributeChangeAccumulator( name=self.default_controller.name, expected_attribute=Clusters.Descriptor.Attributes.PartsList, output=parts_list_queue) - sub.SetAttributeUpdateCallback(attribute_handler) - cached_attributes = sub.GetAttributes() + self._partslist_subscription.SetAttributeUpdateCallback(attribute_handler) + cached_attributes = self._partslist_subscription.GetAttributes() step_1_dut_parts_list = cached_attributes[root_endpoint][Clusters.Descriptor][Clusters.Descriptor.Attributes.PartsList] asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list") diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 1a18896c055952..2a21c977c9fc8b 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -170,9 +170,9 @@ async def commission_via_commissioner_control(self, controller_node_id: int, dev await self.send_single_cmd( node_id=controller_node_id, cmd=Clusters.CommissionerControl.Commands.RequestCommissioningApproval( - requestId=request_id, - vendorId=vendor_id, - productId=product_id, + requestID=request_id, + vendorID=vendor_id, + productID=product_id, ), ) @@ -182,7 +182,7 @@ async def commission_via_commissioner_control(self, controller_node_id: int, dev resp = await self.send_single_cmd( node_id=controller_node_id, cmd=Clusters.CommissionerControl.Commands.CommissionNode( - requestId=request_id, + requestID=request_id, responseTimeoutSeconds=30, ), ) diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index e6337352d5a71c..c776bd2e9fce7e 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -47,32 +47,6 @@ from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts - -async def wait_for_server_initialization(server_port, timeout=5): - """Wait until the server is ready by checking if it opens the expected port.""" - start_time = asyncio.get_event_loop().time() - elapsed_time = 0 - retry_interval = 1 - - logging.info(f"Waiting for server to initialize on TCP port {server_port} for up to {timeout} seconds.") - - while elapsed_time < timeout: - try: - # Try connecting to the server to check if it's ready - reader, writer = await asyncio.open_connection('::1', server_port) - writer.close() - await writer.wait_closed() - logging.info(f"TH_SERVER_NO_UID is initialized and ready on port {server_port}.") - return - except (ConnectionRefusedError, OSError) as e: - logging.warning(f"Connection to port {server_port} failed: {e}. Retrying in {retry_interval} seconds...") - - await asyncio.sleep(retry_interval) - elapsed_time = asyncio.get_event_loop().time() - start_time - - raise TimeoutError(f"Server on port {server_port} did not initialize within {timeout} seconds. " - f"Total time waited: {elapsed_time} seconds.") - # TODO: Make this class more generic. Issue #35348 @@ -174,16 +148,32 @@ def stop(self): class AppServer: + def _process_admin_output(self, line): + if self.wait_for_text_text is not None and self.wait_for_text_text in line: + self.wait_for_text_event.set() + + def wait_for_text(self, timeout=30): + if not self.wait_for_text_event.wait(timeout=timeout): + raise Exception(f"Timeout waiting for text: {self.wait_for_text_text}") + self.wait_for_text_event.clear() + self.wait_for_text_text = None + def __init__(self, app, storage_dir, port=None, discriminator=None, passcode=None): + self.wait_for_text_event = threading.Event() + self.wait_for_text_text = None args = [app] args.extend(["--KVS", tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1]]) args.extend(['--secured-device-port', str(port)]) args.extend(["--discriminator", str(discriminator)]) args.extend(["--passcode", str(passcode)]) - self.app = Subprocess(args, tag="SERVER") + self.app = Subprocess(args, stdout_cb=self._process_admin_output, tag="SERVER") + self.wait_for_text_text = "Server initialization complete" self.app.start() + # Wait for the server-app to be ready. + self.wait_for_text() + def stop(self): self.app.stop() @@ -265,12 +255,6 @@ def setup_class(self): discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - # Wait for TH_SERVER_NO_UID get initialized. - try: - asyncio.run(wait_for_server_initialization(self.th_server_port)) - except TimeoutError: - asserts.fail(f"TH_SERVER_NO_UID server failed to open port {self.th_server_port}") - def teardown_class(self): if self.th_fsa_controller is not None: self.th_fsa_controller.stop() diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index df80072d5126e3..22654c994bf41f 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -61,10 +61,20 @@ class TC_MCORE_FS_1_5(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() + self._partslist_subscription = None + self._cadmin_subscription = None self._app_th_server_process = None self._th_server_kvs = None def teardown_class(self): + if self._partslist_subscription is not None: + self._partslist_subscription.Shutdown() + self._partslist_subscription = None + + if self._cadmin_subscription is not None: + self._cadmin_subscription.Shutdown() + self._cadmin_subscription = None + if self._app_th_server_process is not None: logging.warning("Stopping app with SIGTERM") self._app_th_server_process.send_signal(signal.SIGTERM.value) @@ -142,7 +152,7 @@ async def test_TC_MCORE_FS_1_5(self): parts_list_subscription_contents = [ (root_endpoint, Clusters.Descriptor.Attributes.PartsList) ] - parts_list_sub = await self.default_controller.ReadAttribute( + self._partslist_subscription = await self.default_controller.ReadAttribute( nodeid=self.dut_node_id, attributes=parts_list_subscription_contents, reportInterval=(min_report_interval_sec, max_report_interval_sec), @@ -152,8 +162,8 @@ async def test_TC_MCORE_FS_1_5(self): parts_list_queue = queue.Queue() parts_list_attribute_handler = AttributeChangeAccumulator( name=self.default_controller.name, expected_attribute=Clusters.Descriptor.Attributes.PartsList, output=parts_list_queue) - parts_list_sub.SetAttributeUpdateCallback(parts_list_attribute_handler) - parts_list_cached_attributes = parts_list_sub.GetAttributes() + self._partslist_subscription.SetAttributeUpdateCallback(parts_list_attribute_handler) + parts_list_cached_attributes = self._partslist_subscription.GetAttributes() step_1_dut_parts_list = parts_list_cached_attributes[root_endpoint][Clusters.Descriptor][Clusters.Descriptor.Attributes.PartsList] asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list") @@ -219,7 +229,7 @@ async def test_TC_MCORE_FS_1_5(self): cadmin_subscription_contents = [ (newly_added_endpoint, Clusters.AdministratorCommissioning) ] - cadmin_sub = await self.default_controller.ReadAttribute( + self._cadmin_subscription = await self.default_controller.ReadAttribute( nodeid=self.dut_node_id, attributes=cadmin_subscription_contents, reportInterval=(min_report_interval_sec, max_report_interval_sec), @@ -230,7 +240,7 @@ async def test_TC_MCORE_FS_1_5(self): # This AttributeChangeAccumulator is really just to let us know when new subscription came in cadmin_attribute_handler = AttributeChangeAccumulator( name=self.default_controller.name, expected_attribute=Clusters.AdministratorCommissioning.Attributes.WindowStatus, output=cadmin_queue) - cadmin_sub.SetAttributeUpdateCallback(cadmin_attribute_handler) + self._cadmin_subscription.SetAttributeUpdateCallback(cadmin_attribute_handler) time.sleep(1) self.step(7) diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 2c253efa860038..1bed2c8d12cac8 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -180,12 +180,12 @@ async def read_and_validate_progress(self, step): progareaid_list.append(p.areaID) asserts.assert_true(p.areaID in self.areaid_list, f"Progress entry has invalid AreaID value ({p.areaID})") - asserts.assert_true(p.status in (Clusters.ServiceArea.OperationalStatusEnum.kPending, - Clusters.ServiceArea.OperationalStatusEnum.kOperating, - Clusters.ServiceArea.OperationalStatusEnum.kSkipped, - Clusters.ServiceArea.OperationalStatusEnum.kCompleted), + asserts.assert_true(p.status in (Clusters.ServiceArea.Enums.OperationalStatusEnum.kPending, + Clusters.ServiceArea.Enums.OperationalStatusEnum.kOperating, + Clusters.ServiceArea.Enums.OperationalStatusEnum.kSkipped, + Clusters.ServiceArea.Enums.OperationalStatusEnum.kCompleted), f"Progress entry has invalid Status value ({p.status})") - if p.status not in (Clusters.ServiceArea.OperationalStatusEnum.kSkipped, Clusters.ServiceArea.OperationalStatusEnum.kCompleted): + if p.status not in (Clusters.ServiceArea.Enums.OperationalStatusEnum.kSkipped, Clusters.ServiceArea.Enums.OperationalStatusEnum.kCompleted): asserts.assert_true(p.totalOperationalTime is NullValue, f"Progress entry should have a null TotalOperationalTime value (Status is {p.status})") # TODO how to check that InitialTimeEstimate is either null or uint32? diff --git a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py index d528b5652e1b45..bd28023b8e32e8 100644 --- a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py +++ b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py @@ -94,14 +94,14 @@ def dynamic_event_return(*args, **argv): header = Attribute.EventHeader(EndpointId=0, ClusterId=Clusters.CommissionerControl.id, EventId=Clusters.CommissionerControl.Events.CommissioningRequestResult.event_id, EventNumber=1) data = Clusters.CommissionerControl.Events.CommissioningRequestResult( - requestId=0x1234567887654321, clientNodeId=112233, statusCode=0) + requestID=0x1234567887654321, clientNodeID=112233, statusCode=0) result = Attribute.EventReadResult(Header=header, Status=Status.Success, Data=data) return [result] elif event_call_count == 4: # returned event with new request header = Attribute.EventHeader(EndpointId=0, ClusterId=Clusters.CommissionerControl.id, EventId=Clusters.CommissionerControl.Events.CommissioningRequestResult.event_id, EventNumber=1) data = Clusters.CommissionerControl.Events.CommissioningRequestResult( - requestId=0x1234567812345678, clientNodeId=112233, statusCode=0) + requestID=0x1234567812345678, clientNodeID=112233, statusCode=0) result = Attribute.EventReadResult(Header=header, Status=Status.Success, Data=data) return [result] else: diff --git a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py index 5b2e29b71915b1..d79b4125309e11 100644 --- a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py +++ b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py @@ -72,7 +72,7 @@ def dynamic_event_return(*args, **argv): header = Attribute.EventHeader(EndpointId=0, ClusterId=Clusters.CommissionerControl.id, EventId=Clusters.CommissionerControl.Events.CommissioningRequestResult.event_id, EventNumber=1) data = Clusters.CommissionerControl.Events.CommissioningRequestResult( - requestId=0x1234567812345678, clientNodeId=112233, statusCode=0) + requestID=0x1234567812345678, clientNodeID=112233, statusCode=0) result = Attribute.EventReadResult(Header=header, Status=Status.Success, Data=data) return [result] else: diff --git a/src/tracing/tracing_args.gni b/src/tracing/tracing_args.gni index d6ddb1fd2e99b8..085844e4a53605 100644 --- a/src/tracing/tracing_args.gni +++ b/src/tracing/tracing_args.gni @@ -11,9 +11,8 @@ # 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") -import("${build_root}/config/compiler/compiler.gni") +import("${chip_root}/config/recommended.gni") import("${chip_root}/src/platform/device.gni") declare_args() { @@ -24,7 +23,8 @@ declare_args() { # Additionally, if tracing is enabled, the main() function has to add # backends explicitly matter_enable_tracing_support = - current_os == "android" || chip_device_platform == "darwin" + matter_enable_recommended && + (current_os == "android" || chip_device_platform == "darwin") # Defines the trace backend. Current matter tracing splits the logic # into two parts: diff --git a/third_party/openthread/repo b/third_party/openthread/repo index aed9cd1a307c05..2aeb8b833ba760 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit aed9cd1a307c05fe2f5b6b4b5677baaabce3d38e +Subproject commit 2aeb8b833ba760ec29d5f340dd1ce7bcb61c5d56 diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 30e1595493c60c..3c5d8817b2d217 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -187,7 +187,7 @@ template("siwx917_sdk") { # 1->SOC and 0->NCP "RSI_WLAN_API_ENABLE", "NVM3_DEFAULT_NVM_SIZE=40960", - "NVM3_DEFAULT_MAX_OBJECT_SIZE=4092", + "NVM3_DEFAULT_MAX_OBJECT_SIZE=${sl_nvm3_max_object_size}", "KVS_MAX_ENTRIES=${kvs_max_entries}", "${silabs_mcu}=1", "${silabs_board}=1", @@ -336,16 +336,9 @@ template("siwx917_sdk") { libs += [ "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a" ] cflags += [ - "-Wno-maybe-uninitialized", "-Wno-shadow", - "-Wno-empty-body", - "-Wno-cpp", - "-Wno-missing-braces", - "-Wno-sign-compare", - "-Wno-error", "-Wno-unknown-warning-option", "-Wno-unused-variable", - "-Wno-unused-function", ] foreach(include_dir, _include_dirs) { diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 1cd69d31e7084b..3f30a0ca52f867 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -38,6 +38,7 @@ declare_args() { # enable by default for thread/non-wifi-ncp builds enable_openthread_cli = !(use_rs9116 || use_wf200 || use_SiWx917) kvs_max_entries = 255 + sl_nvm3_max_object_size = 4092 # Use Silabs factory data provider example. # Users can implement their own. @@ -421,7 +422,7 @@ template("efr32_sdk") { "HARD_FAULT_LOG_ENABLE", "CORTEXM3_EFM32_MICRO", "NVM3_DEFAULT_NVM_SIZE=40960", - "NVM3_DEFAULT_MAX_OBJECT_SIZE=4092", + "NVM3_DEFAULT_MAX_OBJECT_SIZE=${sl_nvm3_max_object_size}", "KVS_MAX_ENTRIES=${kvs_max_entries}", "CORTEXM3=1", "MICRO=EMBER_MICRO_CORTEXM3_EFR32", diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 2d788bd2613215..8def02781d4b9a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -18,6 +18,7 @@ // THIS FILE IS GENERATED BY ZAP #include +#include using namespace chip::app::Clusters; @@ -273,12 +274,8 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("DeviceType", indent + 1, value.deviceType); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceType'"); - return err; - } + std::string item = std::to_string(value.deviceType) + " (" + DeviceTypeIdToText(value.deviceType) + ")"; + DataModelLogger::LogString("DeviceType", indent + 1, item); } { CHIP_ERROR err = LogValue("Revision", indent + 1, value.revision); @@ -641,11 +638,19 @@ DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = LogValue("DeviceType", indent + 1, value.deviceType); - if (err != CHIP_NO_ERROR) + if (value.deviceType.IsNull()) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceType'"); - return err; + CHIP_ERROR err = LogValue("DeviceType", indent + 1, value.deviceType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceType'"); + return err; + } + } + else + { + std::string item = std::to_string(value.deviceType.Value()) + " (" + DeviceTypeIdToText(value.deviceType.Value()) + ")"; + DataModelLogger::LogString("DeviceType", indent + 1, item); } } DataModelLogger::LogString(indent, "}"); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index 07bac4319c7c61..8f320e64e682b8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -6700,3 +6700,146 @@ char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId i return "Unknown"; } } + +char const * DeviceTypeIdToText(chip::DeviceTypeId id) +{ + switch (id) + { + case 0x0000000A: + return "Matter Door Lock"; + case 0x0000000B: + return "Matter Door Lock Controller"; + case 0x0000000E: + return "Matter Aggregator"; + case 0x0000000F: + return "Matter Generic Switch"; + case 0x00000011: + return "Matter Power Source"; + case 0x00000012: + return "Matter OTA Requestor"; + case 0x00000013: + return "Matter Bridged Device"; + case 0x00000014: + return "Matter OTA Provider"; + case 0x00000015: + return "Matter Contact Sensor"; + case 0x00000016: + return "Matter Root Node"; + case 0x00000019: + return "Matter Secondary Network Interface Device Type"; + case 0x00000022: + return "Matter Speaker"; + case 0x00000023: + return "Matter Casting Video Player"; + case 0x00000024: + return "Matter Content App"; + case 0x00000027: + return "Matter Mode Select"; + case 0x00000028: + return "Matter Basic Video Player"; + case 0x00000029: + return "Matter Casting Video Client"; + case 0x0000002A: + return "Matter Video Remote Control"; + case 0x0000002B: + return "Matter Fan"; + case 0x0000002C: + return "Matter Air Quality Sensor"; + case 0x0000002D: + return "Matter Air Purifier"; + case 0x00000041: + return "Matter Water Freeze Detector"; + case 0x00000042: + return "Matter Water Valve"; + case 0x00000043: + return "Matter Water Leak Detector"; + case 0x00000044: + return "Matter Rain Sensor"; + case 0x00000070: + return "Matter Refrigerator"; + case 0x00000071: + return "Matter Temperature Controlled Cabinet"; + case 0x00000072: + return "Matter Room Air Conditioner"; + case 0x00000073: + return "Matter Laundry Washer"; + case 0x00000074: + return "Matter Robotic Vacuum Cleaner"; + case 0x00000075: + return "Matter Dishwasher"; + case 0x00000076: + return "Matter Smoke CO Alarm"; + case 0x00000077: + return "Matter Cook Surface"; + case 0x00000078: + return "Matter Cooktop"; + case 0x00000079: + return "Matter Microwave Oven"; + case 0x0000007A: + return "Matter Extractor Hood"; + case 0x0000007B: + return "Matter Oven"; + case 0x0000007C: + return "Matter Laundry Dryer"; + case 0x00000090: + return "Matter Network Infrastructure Manager"; + case 0x00000091: + return "Matter Thread Border Router"; + case 0x00000100: + return "Matter On/Off Light"; + case 0x00000101: + return "Matter Dimmable Light"; + case 0x00000103: + return "Matter On/Off Light Switch"; + case 0x00000104: + return "Matter Dimmer Switch"; + case 0x00000105: + return "Matter Color Dimmer Switch"; + case 0x00000106: + return "Matter Light Sensor"; + case 0x00000107: + return "Matter Occupancy Sensor"; + case 0x0000010A: + return "Matter On/Off Plug-in Unit"; + case 0x0000010B: + return "Matter Dimmable Plug-in Unit"; + case 0x0000010C: + return "Matter Color Temperature Light"; + case 0x0000010D: + return "Matter Extended Color Light"; + case 0x00000202: + return "Matter Window Covering"; + case 0x00000203: + return "Matter Window Covering Controller"; + case 0x00000300: + return "Matter Heating/Cooling Unit"; + case 0x00000301: + return "Matter Thermostat"; + case 0x00000302: + return "Matter Temperature Sensor"; + case 0x00000303: + return "Matter Pump"; + case 0x00000304: + return "Matter Pump Controller"; + case 0x00000305: + return "Matter Pressure Sensor"; + case 0x00000306: + return "Matter Flow Sensor"; + case 0x00000307: + return "Matter Humidity Sensor"; + case 0x0000050C: + return "Matter EVSE"; + case 0x00000510: + return "Matter Electrical Sensor"; + case 0x00000840: + return "Matter Control Bridge"; + case 0x00000850: + return "Matter On/Off Sensor"; + case 0xFFF10001: + return "Matter Orphan Clusters"; + case 0xFFF10003: + return "Matter All-clusters-app Server Example"; + default: + return "Unknown"; + } +} diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h index 27fa6512fbdd01..f65ab6e45f549a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h @@ -28,3 +28,5 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id); char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); + +char const * DeviceTypeIdToText(chip::DeviceTypeId id);