Moved FEATURE_BLE into config-system
This commit is contained in:
@@ -39,7 +39,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DFEATURE_MOSFETS
|
# -DFEATURE_MOSFETS
|
||||||
-DFEATURE_WEBSERVER
|
-DFEATURE_WEBSERVER
|
||||||
-DFEATURE_OTA
|
-DFEATURE_OTA
|
||||||
-DFEATURE_BLE
|
|
||||||
# -DFEATURE_BLUETOOTH
|
# -DFEATURE_BLUETOOTH
|
||||||
# -DFEATURE_BMS
|
# -DFEATURE_BMS
|
||||||
# -DFEATURE_GAMETRAK
|
# -DFEATURE_GAMETRAK
|
||||||
|
@@ -39,7 +39,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DFEATURE_MOSFETS
|
# -DFEATURE_MOSFETS
|
||||||
-DFEATURE_WEBSERVER
|
-DFEATURE_WEBSERVER
|
||||||
-DFEATURE_OTA
|
-DFEATURE_OTA
|
||||||
-DFEATURE_BLE
|
|
||||||
# -DFEATURE_BLUETOOTH
|
# -DFEATURE_BLUETOOTH
|
||||||
# -DFEATURE_BMS
|
# -DFEATURE_BMS
|
||||||
# -DFEATURE_GAMETRAK
|
# -DFEATURE_GAMETRAK
|
||||||
|
@@ -39,7 +39,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
-DFEATURE_MOSFETS
|
-DFEATURE_MOSFETS
|
||||||
-DFEATURE_WEBSERVER
|
-DFEATURE_WEBSERVER
|
||||||
-DFEATURE_OTA
|
-DFEATURE_OTA
|
||||||
-DFEATURE_BLE
|
|
||||||
# -DFEATURE_BLUETOOTH
|
# -DFEATURE_BLUETOOTH
|
||||||
# -DFEATURE_BMS
|
# -DFEATURE_BMS
|
||||||
# -DFEATURE_GAMETRAK
|
# -DFEATURE_GAMETRAK
|
||||||
|
@@ -39,7 +39,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DFEATURE_MOSFETS
|
# -DFEATURE_MOSFETS
|
||||||
-DFEATURE_WEBSERVER
|
-DFEATURE_WEBSERVER
|
||||||
-DFEATURE_OTA
|
-DFEATURE_OTA
|
||||||
-DFEATURE_BLE
|
|
||||||
# -DFEATURE_BLUETOOTH
|
# -DFEATURE_BLUETOOTH
|
||||||
# -DFEATURE_BMS
|
# -DFEATURE_BMS
|
||||||
# -DFEATURE_GAMETRAK
|
# -DFEATURE_GAMETRAK
|
||||||
|
@@ -39,7 +39,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DFEATURE_MOSFETS
|
# -DFEATURE_MOSFETS
|
||||||
# -DFEATURE_WEBSERVER
|
# -DFEATURE_WEBSERVER
|
||||||
# -DFEATURE_OTA
|
# -DFEATURE_OTA
|
||||||
# -DFEATURE_BLE
|
|
||||||
# -DFEATURE_BLUETOOTH
|
# -DFEATURE_BLUETOOTH
|
||||||
# -DFEATURE_BMS
|
# -DFEATURE_BMS
|
||||||
# -DFEATURE_GAMETRAK
|
# -DFEATURE_GAMETRAK
|
||||||
|
@@ -39,7 +39,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DFEATURE_MOSFETS
|
# -DFEATURE_MOSFETS
|
||||||
-DFEATURE_WEBSERVER
|
-DFEATURE_WEBSERVER
|
||||||
-DFEATURE_OTA
|
-DFEATURE_OTA
|
||||||
-DFEATURE_BLE
|
|
||||||
# -DFEATURE_BLUETOOTH
|
# -DFEATURE_BLUETOOTH
|
||||||
# -DFEATURE_BMS
|
# -DFEATURE_BMS
|
||||||
# -DFEATURE_GAMETRAK
|
# -DFEATURE_GAMETRAK
|
||||||
|
@@ -38,9 +38,7 @@ struct FieldWeakMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t
|
|||||||
struct PhaseAdvMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.limits.phaseAdvMax; } };
|
struct PhaseAdvMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.limits.phaseAdvMax; } };
|
||||||
|
|
||||||
// Bluetooth Low Energy
|
// Bluetooth Low Energy
|
||||||
#ifdef FEATURE_BLE
|
|
||||||
struct BleEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.bleSettings.bleEnabled; } };
|
struct BleEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.bleSettings.bleEnabled; } };
|
||||||
#endif
|
|
||||||
|
|
||||||
// Cloud
|
// Cloud
|
||||||
struct CloudEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.cloudSettings.cloudEnabled; } };
|
struct CloudEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.cloudSettings.cloudEnabled; } };
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "newsettings.h"
|
#include "newsettings.h"
|
||||||
|
|
||||||
#ifdef FEATURE_BLE
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr const char * const TAG = "BOBBYBLE";
|
constexpr const char * const TAG = "BOBBYBLE";
|
||||||
|
|
||||||
@@ -105,6 +104,9 @@ void initBle()
|
|||||||
|
|
||||||
void handleBle()
|
void handleBle()
|
||||||
{
|
{
|
||||||
|
if (!configs.feature.ble.value)
|
||||||
|
return;
|
||||||
|
|
||||||
if (configs.bleSettings.bleEnabled.value)
|
if (configs.bleSettings.bleEnabled.value)
|
||||||
{
|
{
|
||||||
if (!pServer)
|
if (!pServer)
|
||||||
@@ -293,5 +295,3 @@ void WiFiListCallbacks::onRead(NimBLECharacteristic *pCharacteristic)
|
|||||||
pCharacteristic->setValue(json);
|
pCharacteristic->setValue(json);
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef FEATURE_BLE
|
|
||||||
|
|
||||||
// esp-idf includes
|
// esp-idf includes
|
||||||
#include <NimBLEDevice.h>
|
#include <NimBLEDevice.h>
|
||||||
|
|
||||||
@@ -15,5 +13,3 @@ extern BLECharacteristic *getwifilist;
|
|||||||
void initBle();
|
void initBle();
|
||||||
|
|
||||||
void handleBle();
|
void handleBle();
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
#include "textinterface.h"
|
#include "textinterface.h"
|
||||||
#include "ble_bobby.h"
|
#include "ble_bobby.h"
|
||||||
|
|
||||||
#ifdef FEATURE_BLE
|
|
||||||
struct BleServerPeerDevicesText : public virtual espgui::TextInterface {
|
struct BleServerPeerDevicesText : public virtual espgui::TextInterface {
|
||||||
public:
|
public:
|
||||||
std::string text() const override
|
std::string text() const override
|
||||||
@@ -26,4 +25,3 @@ public:
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
#include "displays/menus/settingsmenu.h"
|
#include "displays/menus/settingsmenu.h"
|
||||||
#include "bobbycheckbox.h"
|
#include "bobbycheckbox.h"
|
||||||
|
|
||||||
#ifdef FEATURE_BLE
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr char TEXT_BLESETTINGS[] = "BLE settings";
|
constexpr char TEXT_BLESETTINGS[] = "BLE settings";
|
||||||
constexpr char TEXT_ENABLED[] = "Enabled";
|
constexpr char TEXT_ENABLED[] = "Enabled";
|
||||||
@@ -51,4 +50,3 @@ void BleSettingsMenu::back()
|
|||||||
{
|
{
|
||||||
espgui::switchScreen<SettingsMenu>();
|
espgui::switchScreen<SettingsMenu>();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
// local includes
|
// local includes
|
||||||
#include "displays/bobbymenudisplay.h"
|
#include "displays/bobbymenudisplay.h"
|
||||||
|
|
||||||
#ifdef FEATURE_BLE
|
|
||||||
|
|
||||||
class BleSettingsMenu : public BobbyMenuDisplay
|
class BleSettingsMenu : public BobbyMenuDisplay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -14,4 +12,3 @@ public:
|
|||||||
|
|
||||||
void back() override;
|
void back() override;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
@@ -10,9 +10,7 @@
|
|||||||
// local includes
|
// local includes
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "icons/wifi.h"
|
#include "icons/wifi.h"
|
||||||
#if defined(FEATURE_BLUETOOTH) || defined(FEATURE_BLE)
|
|
||||||
#include "icons/bluetooth.h"
|
#include "icons/bluetooth.h"
|
||||||
#endif
|
|
||||||
#include "icons/time.h"
|
#include "icons/time.h"
|
||||||
#include "icons/hardware.h"
|
#include "icons/hardware.h"
|
||||||
#include "icons/buzzer.h"
|
#include "icons/buzzer.h"
|
||||||
@@ -92,17 +90,12 @@ SettingsMenu::SettingsMenu()
|
|||||||
#ifdef FEATURE_BLUETOOTH
|
#ifdef FEATURE_BLUETOOTH
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLUETOOTHSETTINGS>, SwitchScreenAction<BluetoothSettingsMenu>, StaticMenuItemIcon<&bobbyicons::bluetooth>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLUETOOTHSETTINGS>, SwitchScreenAction<BluetoothSettingsMenu>, StaticMenuItemIcon<&bobbyicons::bluetooth>>>();
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEATURE_BLE
|
if (configs.feature.ble.value)
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLESETTINGS>, SwitchScreenAction<BleSettingsMenu>, StaticMenuItemIcon<&bobbyicons::bluetooth>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLESETTINGS>, SwitchScreenAction<BleSettingsMenu>, StaticMenuItemIcon<&bobbyicons::bluetooth>>>();
|
||||||
#endif
|
|
||||||
if (configs.feature.cloud.value)
|
if (configs.feature.cloud.value)
|
||||||
{
|
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CLOUDSETTINGS>, SwitchScreenAction<CloudSettingsMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CLOUDSETTINGS>, SwitchScreenAction<CloudSettingsMenu>>>();
|
||||||
}
|
|
||||||
if (configs.feature.udpcloud.value)
|
if (configs.feature.udpcloud.value)
|
||||||
{
|
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_UDPCLOUDSETTINGS>, SwitchScreenAction<UdpCloudSettingsMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_UDPCLOUDSETTINGS>, SwitchScreenAction<UdpCloudSettingsMenu>>>();
|
||||||
}
|
|
||||||
#ifdef FEATURE_OTA
|
#ifdef FEATURE_OTA
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SELECTBUILDSERVERMENU>, SwitchScreenAction<SelectBuildServerMenu>, StaticMenuItemIcon<&bobbyicons::update>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SELECTBUILDSERVERMENU>, SwitchScreenAction<SelectBuildServerMenu>, StaticMenuItemIcon<&bobbyicons::update>>>();
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
#include "bluetooth.h"
|
#include "bluetooth.h"
|
||||||
|
|
||||||
namespace bobbyicons {
|
namespace bobbyicons {
|
||||||
#if defined(FEATURE_BLUETOOTH) || defined(FEATURE_BLE)
|
|
||||||
const espgui::Icon<24, 24> bluetooth{{
|
const espgui::Icon<24, 24> bluetooth{{
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x120F, 0x1A50, 0x0000, 0x01CF, 0x2AB1, 0x3B12, 0x4333, 0x4333, 0x3AF2, 0x2AB1, 0x01EF, // 0x0010 (16) pixels
|
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x120F, 0x1A50, 0x0000, 0x01CF, 0x2AB1, 0x3B12, 0x4333, 0x4333, 0x3AF2, 0x2AB1, 0x01EF, // 0x0010 (16) pixels
|
||||||
0x0000, 0x1A50, 0x1210, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1210, 0x018E, 0x0007, 0x2AB1, // 0x0020 (32) pixels
|
0x0000, 0x1A50, 0x1210, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1210, 0x018E, 0x0007, 0x2AB1, // 0x0020 (32) pixels
|
||||||
@@ -40,5 +39,4 @@ const espgui::Icon<24, 24> bluetooth{{
|
|||||||
0x19ED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels
|
0x19ED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels
|
||||||
0x00A6, 0x21EC, 0x2A6F, 0x32B1, 0x32B1, 0x2A6F, 0x19EC, 0x00A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels
|
0x00A6, 0x21EC, 0x2A6F, 0x32B1, 0x32B1, 0x2A6F, 0x19EC, 0x00A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels
|
||||||
}, "bluetooth"};
|
}, "bluetooth"};
|
||||||
#endif
|
|
||||||
} // namespace bobbyicons
|
} // namespace bobbyicons
|
||||||
|
@@ -3,7 +3,5 @@
|
|||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
|
|
||||||
namespace bobbyicons {
|
namespace bobbyicons {
|
||||||
#if defined(FEATURE_BLUETOOTH) || defined(FEATURE_BLE)
|
|
||||||
extern const espgui::Icon<24, 24> bluetooth;
|
extern const espgui::Icon<24, 24> bluetooth;
|
||||||
#endif
|
|
||||||
} // namespace bobbyicons
|
} // namespace bobbyicons
|
||||||
|
@@ -313,6 +313,7 @@ public:
|
|||||||
ConfigWrapper<bool> udpcloud {false, DoReset, {}, "f_udpcloud" };
|
ConfigWrapper<bool> udpcloud {false, DoReset, {}, "f_udpcloud" };
|
||||||
ConfigWrapper<bool> dnsannounce {false, DoReset, {}, "f_dnsannounce" };
|
ConfigWrapper<bool> dnsannounce {false, DoReset, {}, "f_dnsannounce" };
|
||||||
ConfigWrapper<bool> ntp {false, DoReset, {}, "f_ntp" };
|
ConfigWrapper<bool> ntp {false, DoReset, {}, "f_ntp" };
|
||||||
|
ConfigWrapper<bool> ble {false, DoReset, {}, "f_ble" };
|
||||||
ConfigWrapper<bool> gschissene_diode {false, DoReset, {}, "f_gschissDiode" };
|
ConfigWrapper<bool> gschissene_diode {false, DoReset, {}, "f_gschissDiode" };
|
||||||
} feature;
|
} feature;
|
||||||
|
|
||||||
@@ -605,14 +606,15 @@ public:
|
|||||||
x(espnow.syncTimeWithOthers) \
|
x(espnow.syncTimeWithOthers) \
|
||||||
x(espnow.syncBlink) \
|
x(espnow.syncBlink) \
|
||||||
\
|
\
|
||||||
x(feature.gschissene_diode) \
|
|
||||||
x(feature.ledstrip) \
|
x(feature.ledstrip) \
|
||||||
x(feature.webserver_disable_lock) \
|
x(feature.webserver_disable_lock) \
|
||||||
x(feature.garage) \
|
x(feature.garage) \
|
||||||
x(feature.udpcloud) \
|
x(feature.udpcloud) \
|
||||||
x(feature.cloud) \
|
x(feature.cloud) \
|
||||||
x(feature.dnsannounce) \
|
x(feature.dnsannounce) \
|
||||||
x(feature.ntp)
|
x(feature.ntp) \
|
||||||
|
x(feature.ble) \
|
||||||
|
x(feature.gschissene_diode)
|
||||||
//x(bleSettings.bleEnabled)
|
//x(bleSettings.bleEnabled)
|
||||||
|
|
||||||
#define FEATURES(x) \
|
#define FEATURES(x) \
|
||||||
@@ -622,7 +624,8 @@ public:
|
|||||||
x(feature.udpcloud) \
|
x(feature.udpcloud) \
|
||||||
x(feature.cloud) \
|
x(feature.cloud) \
|
||||||
x(feature.dnsannounce) \
|
x(feature.dnsannounce) \
|
||||||
x(feature.ntp)
|
x(feature.ntp) \
|
||||||
|
x(feature.ble)
|
||||||
//x(feature.gschisseneDiode)
|
//x(feature.gschisseneDiode)
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@@ -48,9 +48,7 @@
|
|||||||
#ifdef FEATURE_OTA
|
#ifdef FEATURE_OTA
|
||||||
#include "ota.h"
|
#include "ota.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEATURE_BLE
|
|
||||||
#include "ble_bobby.h"
|
#include "ble_bobby.h"
|
||||||
#endif
|
|
||||||
#ifdef FEATURE_WEBSERVER
|
#ifdef FEATURE_WEBSERVER
|
||||||
#include "webserver.h"
|
#include "webserver.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -113,9 +111,7 @@ BobbySchedulerTask schedulerTasksArr[] {
|
|||||||
#ifdef FEATURE_OTA
|
#ifdef FEATURE_OTA
|
||||||
BobbySchedulerTask { "ota", initOta, handleOta, 50ms },
|
BobbySchedulerTask { "ota", initOta, handleOta, 50ms },
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEATURE_BLE
|
|
||||||
BobbySchedulerTask { "ble", initBle, handleBle, 100ms },
|
BobbySchedulerTask { "ble", initBle, handleBle, 100ms },
|
||||||
#endif
|
|
||||||
#ifdef FEATURE_WEBSERVER
|
#ifdef FEATURE_WEBSERVER
|
||||||
BobbySchedulerTask { "webserver", initWebserver, handleWebserver, 100ms },
|
BobbySchedulerTask { "webserver", initWebserver, handleWebserver, 100ms },
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user