Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UNSUPPORTED_ENDPOINT of TC-BR-4's step 1h (#34499)
* Fix UNSUPPORTED_ENDPOINT of TC-BR-4's step 1h When testing step 1h of TC-BR-4 with bridge-app on the latest TH, an UNSUPPORTED_ENDPOINT error occurs. This is because ComposedDevice and ComposedPowerSource are local variables in the ApplicationInit function, so they are not valid when the bridge-app runs. This change moves ComposedDevice and ComposedPowerSource to global scope. Co-authored-by: Charles Kim <[email protected]> Co-authored-by: Sanghee Kim <[email protected]> Co-authored-by: Hunsup Jung <[email protected]> Co-authored-by: sanghyukko <[email protected]> Co-authored-by: Jaehoon You <[email protected]> Co-authored-by: Kyu-Wook Lim <[email protected]> Signed-off-by: Youngho Yoon <[email protected]> * Fix ambiguous build error of bridge app ComposedDevice has the same type and variable name, so an ambiguous build error occurs as shown below. This change renames the variable to gComposeDevice. ../../main.cpp: In function ‘void ApplicationInit()’: ../../main.cpp:924:5: error: reference to ‘ComposedDevice’ is ambiguous 924 | ComposedDevice.SetReachable(true); | ^~~~~~~~~~~~~~ ../../main.cpp:174:16: note: candidates are: ‘ComposedDevice {anonymous}::ComposedDevice’ 174 | ComposedDevice ComposedDevice("Composed Device", "Bedroom"); | ^~~~~~~~~~~~~~ In file included from ../../main.cpp:46: ../../include/Device.h:158:7: note: ‘class ComposedDevice’ 158 | class ComposedDevice : public Device | ^~~~~~~~~~~~~~ ../../main.cpp:954:24: error: reference to ‘ComposedDevice’ is ambiguous 954 | AddDeviceEndpoint(&ComposedDevice, &bridgedComposedDeviceEndpoint, Span<const EmberAfDeviceType>(gBridgedComposedDeviceTypes), | ^~~~~~~~~~~~~~ ../../main.cpp:174:16: note: candidates are: ‘ComposedDevice {anonymous}::ComposedDevice’ 174 | ComposedDevice ComposedDevice("Composed Device", "Bedroom"); | ^~~~~~~~~~~~~~ In file included from ../../main.cpp:46: ../../include/Device.h:158:7: note: ‘class ComposedDevice’ 158 | class ComposedDevice : public Device | ^~~~~~~~~~~~~~ ../../main.cpp:958:76: error: reference to ‘ComposedDevice’ is ambiguous 958 | Span<DataVersion>(gComposedTempSensor1DataVersions), ComposedDevice.GetEndpointId()); | ^~~~~~~~~~~~~~ ../../main.cpp:174:16: note: candidates are: ‘ComposedDevice {anonymous}::ComposedDevice’ 174 | ComposedDevice ComposedDevice("Composed Device", "Bedroom"); | ^~~~~~~~~~~~~~ In file included from ../../main.cpp:46: ../../include/Device.h:158:7: note: ‘class ComposedDevice’ 158 | class ComposedDevice : public Device | ^~~~~~~~~~~~~~ ../../main.cpp:961:76: error: reference to ‘ComposedDevice’ is ambiguous 961 | Span<DataVersion>(gComposedTempSensor2DataVersions), ComposedDevice.GetEndpointId()); | ^~~~~~~~~~~~~~ ../../main.cpp:174:16: note: candidates are: ‘ComposedDevice {anonymous}::ComposedDevice’ 174 | ComposedDevice ComposedDevice("Composed Device", "Bedroom"); | ^~~~~~~~~~~~~~ In file included from ../../main.cpp:46: ../../include/Device.h:158:7: note: ‘class ComposedDevice’ 158 | class ComposedDevice : public Device | ^~~~~~~~~~~~~~ ../../main.cpp:977:28: error: reference to ‘ComposedDevice’ is ambiguous 977 | endpointList.push_back(ComposedDevice.GetEndpointId()); | ^~~~~~~~~~~~~~ ../../main.cpp:174:16: note: candidates are: ‘ComposedDevice {anonymous}::ComposedDevice’ 174 | ComposedDevice ComposedDevice("Composed Device", "Bedroom"); | ^~~~~~~~~~~~~~ In file included from ../../main.cpp:46: ../../include/Device.h:158:7: note: ‘class ComposedDevice’ 158 | class ComposedDevice : public Device | ^~~~~~~~~~~~~~ ../../main.cpp:981:39: error: reference to ‘ComposedDevice’ is ambiguous 981 | ComposedPowerSource.SetEndpointId(ComposedDevice.GetEndpointId()); | ^~~~~~~~~~~~~~ ../../main.cpp:174:16: note: candidates are: ‘ComposedDevice {anonymous}::ComposedDevice’ 174 | ComposedDevice ComposedDevice("Composed Device", "Bedroom"); | ^~~~~~~~~~~~~~ In file included from ../../main.cpp:46: ../../include/Device.h:158:7: note: ‘class ComposedDevice’ 158 | class ComposedDevice : public Device | ^~~~~~~~~~~~~~ At global scope: cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror] cc1plus: all warnings being treated as errors ninja: build stopped: subcommand failed. Signed-off-by: Youngho Yoon <[email protected]> --------- Signed-off-by: Youngho Yoon <[email protected]> Co-authored-by: Charles Kim <[email protected]> Co-authored-by: Sanghee Kim <[email protected]> Co-authored-by: Hunsup Jung <[email protected]> Co-authored-by: sanghyukko <[email protected]> Co-authored-by: Jaehoon You <[email protected]> Co-authored-by: Kyu-Wook Lim <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
- Loading branch information