sforkowany z mirror/meshtastic-firmware
WIP stubify to get app building without CONFIG_BLUEDROID (BLE disabled)
rodzic
1e86365167
commit
6aa28f55dd
|
@ -12,5 +12,12 @@ you'll automatically get our fixed libraries.
|
|||
https://docs.espressif.com/projects/esp-idf/en/release-v3.3/get-started/linux-setup.html
|
||||
kevinh@kevin-server:~/development/meshtastic/esp32-arduino-lib-builder\$ python /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/esp-idf/components/esptool*py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/build/bootloader/bootloader.bin
|
||||
cp -a out/tools/sdk/* components/arduino/tools/sdk
|
||||
cp -ar components/arduino/* ~/.platformio/packages/framework-arduinoespressif32@src-fba9d33740f719f712e9f8b07da6ea13/
|
||||
cp -ar components/arduino/* ~/.platformio/packages/framework-arduinoespressif32
|
||||
|
||||
/// @src-fba9d33740f719f712e9f8b07da6ea13/
|
||||
|
||||
or
|
||||
|
||||
cp -ar out/tools/sdk/* ~/.platformio/packages/framework-arduinoespressif32/tools/sdk
|
||||
|
||||
```
|
||||
|
|
|
@ -37,13 +37,6 @@ build_flags = -Wno-missing-field-initializers -Isrc -Isrc/mesh -Isrc/gps -Ilib/n
|
|||
-DAPP_VERSION=${sysenv.APP_VERSION}
|
||||
-DHW_VERSION=${sysenv.HW_VERSION}
|
||||
|
||||
; not needed included in ttgo-t-beam board file
|
||||
; also to use PSRAM https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram
|
||||
; -DBOARD_HAS_PSRAM
|
||||
; -mfix-esp32-psram-cache-issue
|
||||
|
||||
; -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
||||
|
||||
; leave this commented out to avoid breaking Windows
|
||||
;upload_port = /dev/ttyUSB0
|
||||
;monitor_port = /dev/ttyUSB0
|
||||
|
@ -92,6 +85,13 @@ lib_ignore = segger_rtt
|
|||
platform_packages =
|
||||
framework-arduinoespressif32 @ https://github.com/meshtastic/arduino-esp32.git#b7f106cd11a04573b902228ea97025c8b5814dd9
|
||||
|
||||
; not needed included in ttgo-t-beam board file
|
||||
; also to use PSRAM https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram
|
||||
; -DBOARD_HAS_PSRAM
|
||||
; -mfix-esp32-psram-cache-issue
|
||||
|
||||
; -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
||||
|
||||
; The 1.0 release of the TBEAM board
|
||||
[env:tbeam]
|
||||
extends = esp32_base
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "BluetoothSoftwareUpdate.h"
|
||||
#include "BluetoothUtil.h"
|
||||
#include "CallbackCharacteristic.h"
|
||||
#include "RadioLibInterface.h"
|
||||
#include "configuration.h"
|
||||
#include "../concurrency/LockGuard.h"
|
||||
|
@ -11,7 +10,9 @@
|
|||
#include <Update.h>
|
||||
#include <esp_gatt_defs.h>
|
||||
|
||||
//using namespace meshtastic;
|
||||
#ifdef CONFIG_BLUEDROID_ENABLED
|
||||
|
||||
#include "CallbackCharacteristic.h"
|
||||
|
||||
CRC32 crc;
|
||||
uint32_t rebootAtMsec = 0; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
|
||||
|
@ -176,4 +177,6 @@ void destroyUpdateService()
|
|||
assert(resultC);
|
||||
|
||||
resultC = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
#include <BLEServer.h>
|
||||
#include <BLEUtils.h>
|
||||
|
||||
#ifdef CONFIG_BLUEDROID_ENABLED
|
||||
|
||||
BLEService *createUpdateService(BLEServer *server, std::string hwVendor, std::string swVersion, std::string hwVersion);
|
||||
|
||||
void destroyUpdateService();
|
||||
void bluetoothRebootCheck();
|
||||
void bluetoothRebootCheck();
|
||||
|
||||
#endif
|
|
@ -6,6 +6,8 @@
|
|||
#include <Update.h>
|
||||
#include <esp_gatt_defs.h>
|
||||
|
||||
#ifdef CONFIG_BLUEDROID_ENABLED
|
||||
|
||||
SimpleAllocator btPool;
|
||||
|
||||
bool _BLEClientConnected = false;
|
||||
|
@ -321,3 +323,12 @@ void loopBLE()
|
|||
{
|
||||
bluetoothRebootCheck();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/// Given a level between 0-100, update the BLE attribute
|
||||
void updateBatteryLevel(uint8_t level) {}
|
||||
void deinitBLE() {}
|
||||
void loopBLE() {}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
#include <BLEUtils.h>
|
||||
#include "SimpleAllocator.h"
|
||||
|
||||
// Now handled by BluetoothUtil.cpp
|
||||
// BLEService *createDeviceInfomationService(BLEServer* server, uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version);
|
||||
#ifdef CONFIG_BLUEDROID_ENABLED
|
||||
|
||||
// Help routine to add a description to any BLECharacteristic and add it to the service
|
||||
void addWithDesc(BLEService *service, BLECharacteristic *c, const char *description);
|
||||
|
@ -23,11 +22,9 @@ uint32_t getValue32(BLECharacteristic *c, uint32_t defaultValue);
|
|||
using StartBluetoothPinScreenCallback = std::function<void(uint32_t pass_key)>;
|
||||
using StopBluetoothPinScreenCallback = std::function<void(void)>;
|
||||
|
||||
void loopBLE();
|
||||
BLEServer *initBLE(
|
||||
StartBluetoothPinScreenCallback startBtPinScreen, StopBluetoothPinScreenCallback stopBtPinScreen,
|
||||
std::string devName, std::string hwVendor, std::string swVersion, std::string hwVersion = "");
|
||||
void deinitBLE();
|
||||
|
||||
/// Add a characteristic that we will delete when we restart
|
||||
BLECharacteristic *addBLECharacteristic(BLECharacteristic *c);
|
||||
|
@ -35,8 +32,12 @@ BLECharacteristic *addBLECharacteristic(BLECharacteristic *c);
|
|||
/// Add a characteristic that we will delete when we restart
|
||||
BLEDescriptor *addBLEDescriptor(BLEDescriptor *c);
|
||||
|
||||
/// Given a level between 0-100, update the BLE attribute
|
||||
void updateBatteryLevel(uint8_t level);
|
||||
|
||||
/// Any bluetooth objects you allocate _must_ come from this pool if you want to be able to call deinitBLE()
|
||||
extern SimpleAllocator btPool;
|
||||
|
||||
#endif
|
||||
|
||||
/// Given a level between 0-100, update the BLE attribute
|
||||
void updateBatteryLevel(uint8_t level);
|
||||
void deinitBLE();
|
||||
void loopBLE();
|
|
@ -1,11 +1,7 @@
|
|||
#include "MeshBluetoothService.h"
|
||||
#include "BluetoothUtil.h"
|
||||
#include <Arduino.h>
|
||||
#include <BLE2902.h>
|
||||
#include <assert.h>
|
||||
#include <esp_gatt_defs.h>
|
||||
|
||||
#include "CallbackCharacteristic.h"
|
||||
#include <Arduino.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "GPS.h"
|
||||
#include "MeshService.h"
|
||||
#include "NodeDB.h"
|
||||
|
@ -15,6 +11,14 @@
|
|||
#include "mesh-pb-constants.h"
|
||||
#include "mesh.pb.h"
|
||||
|
||||
#ifdef CONFIG_BLUEDROID_ENABLED
|
||||
|
||||
#include <BLE2902.h>
|
||||
#include <esp_gatt_defs.h>
|
||||
#include "CallbackCharacteristic.h"
|
||||
#include "BluetoothUtil.h"
|
||||
#include "MeshBluetoothService.h"
|
||||
|
||||
// This scratch buffer is used for various bluetooth reads/writes - but it is safe because only one bt operation can be in
|
||||
// proccess at once
|
||||
static uint8_t trBytes[_max(_max(_max(_max(ToRadio_size, RadioConfig_size), User_size), MyNodeInfo_size), FromRadio_size)];
|
||||
|
@ -141,3 +145,10 @@ void destroyMeshBluetoothService()
|
|||
|
||||
meshFromNumCharacteristic = NULL;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void destroyMeshBluetoothService() {}
|
||||
void stopMeshBluetoothService() {}
|
||||
|
||||
#endif
|
|
@ -4,12 +4,11 @@
|
|||
#include <BLEServer.h>
|
||||
#include <BLEService.h>
|
||||
|
||||
#ifdef CONFIG_BLUEDROID_ENABLED
|
||||
|
||||
BLEService *createMeshBluetoothService(BLEServer *server);
|
||||
|
||||
#endif
|
||||
|
||||
void destroyMeshBluetoothService();
|
||||
|
||||
/**
|
||||
* Tell any bluetooth clients that the number of rx packets has changed
|
||||
*/
|
||||
void bluetoothNotifyFromNum(uint32_t newValue);
|
||||
|
||||
void stopMeshBluetoothService();
|
|
@ -17,9 +17,7 @@ void reinitBluetooth()
|
|||
{
|
||||
DEBUG_MSG("Starting bluetooth\n");
|
||||
|
||||
// FIXME - we are leaking like crazy
|
||||
// AllocatorScope scope(btPool);
|
||||
|
||||
#ifdef CONFIG_BLUEDROID_ENABLED
|
||||
// Note: these callbacks might be coming in from a different thread.
|
||||
BLEServer *serve = initBLE(
|
||||
[](uint32_t pin) {
|
||||
|
@ -32,6 +30,7 @@ void reinitBluetooth()
|
|||
|
||||
// Start advertising - this must be done _after_ creating all services
|
||||
serve->getAdvertising()->start();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Enable/disable bluetooth.
|
||||
|
|
Ładowanie…
Reference in New Issue