mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-06-22 23:41:55 +00:00
0c9f0e67a9
Companion to 21b0e96 which deleted BluedroidPlatform.{cpp,h} but
missed staging the three edited files that complete the cleanup:
- platformio.ini: remove the [env:tdeck-bluedroid] env block.
- .github/workflows/build-check.yml: drop tdeck-bluedroid from
the CI matrix.
- lib/ble_interface/BLEPlatform.cpp: drop the
USE_BLUEDROID-gated factory branches.
Same `git add` short-arg trap as the eridanus mishap earlier today
— specifying non-existent paths aborts the add before reaching the
M-file paths. Mental-model fix: stage M-files in a separate `git add`
from the staged-deletes.
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
/**
|
|
* @file BLEPlatform.cpp
|
|
* @brief BLE Platform factory implementation
|
|
*/
|
|
|
|
#include "BLEPlatform.h"
|
|
#include "Log.h"
|
|
|
|
// Include platform implementations based on compile-time detection
|
|
#if defined(ESP32) && (defined(USE_NIMBLE) || defined(CONFIG_BT_NIMBLE_ENABLED))
|
|
#include "platforms/NimBLEPlatform.h"
|
|
#endif
|
|
|
|
#if defined(ZEPHYR) || defined(CONFIG_BT)
|
|
// Future: #include "platforms/ZephyrPlatform.h"
|
|
#endif
|
|
|
|
namespace RNS { namespace BLE {
|
|
|
|
IBLEPlatform::Ptr BLEPlatformFactory::create() {
|
|
return create(getDetectedPlatform());
|
|
}
|
|
|
|
IBLEPlatform::Ptr BLEPlatformFactory::create(PlatformType type) {
|
|
switch (type) {
|
|
#if defined(ESP32) && (defined(USE_NIMBLE) || defined(CONFIG_BT_NIMBLE_ENABLED))
|
|
case PlatformType::NIMBLE_ARDUINO:
|
|
INFO("BLEPlatformFactory: Creating NimBLE platform");
|
|
return std::make_shared<NimBLEPlatform>();
|
|
#endif
|
|
|
|
#if defined(ZEPHYR) || defined(CONFIG_BT)
|
|
case PlatformType::ZEPHYR:
|
|
// Future: return std::make_shared<ZephyrPlatform>();
|
|
ERROR("BLEPlatformFactory: Zephyr platform not yet implemented");
|
|
return nullptr;
|
|
#endif
|
|
|
|
default:
|
|
ERROR("BLEPlatformFactory: No platform available for type " +
|
|
std::to_string(static_cast<int>(type)));
|
|
return nullptr;
|
|
}
|
|
}
|
|
|
|
PlatformType BLEPlatformFactory::getDetectedPlatform() {
|
|
#if defined(ESP32) && (defined(USE_NIMBLE) || defined(CONFIG_BT_NIMBLE_ENABLED))
|
|
return PlatformType::NIMBLE_ARDUINO;
|
|
#elif defined(ZEPHYR) || defined(CONFIG_BT)
|
|
return PlatformType::ZEPHYR;
|
|
#else
|
|
return PlatformType::NONE;
|
|
#endif
|
|
}
|
|
|
|
}} // namespace RNS::BLE
|