@brief Initialize channel drivers for WASM platform Registers the stub channel driver with the ChannelManager. WASM uses stub driver because there's no real hardware in browser. This allows the legacy API to work with channel drivers in web builds.
| 21 | /// WASM uses stub driver because there's no real hardware in browser. |
| 22 | /// This allows the legacy API to work with channel drivers in web builds. |
| 23 | inline void initChannelDrivers() FL_NOEXCEPT { |
| 24 | fl::ChannelManager& manager = fl::ChannelManager::instance(); |
| 25 | |
| 26 | // Get the stub driver singleton |
| 27 | auto* stubEngine = fl::getStubChannelEngine(); |
| 28 | |
| 29 | // Wrap it in a shared_ptr without taking ownership |
| 30 | auto sharedStub = fl::make_shared_no_tracking(*stubEngine); |
| 31 | |
| 32 | // Register with low priority (stub is a fallback/testing driver) |
| 33 | manager.addDriver(0, sharedStub); |
| 34 | } |
| 35 | |
| 36 | } // namespace platforms |
| 37 | } // namespace fl |
no test coverage detected