Merge branch 'master' into raspi-portduino

This commit is contained in:
Ben Meadors
2023-02-08 07:40:36 -06:00
committed by GitHub
48 changed files with 1221 additions and 136 deletions

View File

@@ -19,11 +19,9 @@
#include <nvs_flash.h>
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
NimbleBluetooth *nimbleBluetooth;
void setBluetoothEnable(bool on)
{
if (!isWifiAvailable() && config.bluetooth.enabled == true) {
if (!nimbleBluetooth) {
nimbleBluetooth = new NimbleBluetooth();

View File

@@ -213,6 +213,16 @@ void NRF52Bluetooth::shutdown()
Bluefruit.Advertising.stop();
}
bool NRF52Bluetooth::isConnected()
{
return Bluefruit.connected(connectionHandle);
}
int NRF52Bluetooth::getRssi()
{
return 0; // FIXME figure out where to source this
}
void NRF52Bluetooth::setup()
{
// Initialise the Bluefruit module

View File

@@ -1,13 +1,16 @@
#pragma once
#include "BluetoothCommon.h"
#include <Arduino.h>
class NRF52Bluetooth
class NRF52Bluetooth : BluetoothApi
{
public:
void setup();
void shutdown();
void clearBonds();
bool isConnected();
int getRssi();
private:
static void onConnectionSecured(uint16_t conn_handle);

View File

@@ -8,9 +8,8 @@
#include <stdio.h>
// #include <Adafruit_USBD_Device.h>
#include "NodeDB.h"
#include "NRF52Bluetooth.h"
#include "error.h"
#include "main.h"
#ifdef BQ25703A_ADDR
#include "BQ25713.h"
@@ -63,8 +62,6 @@ static void initBrownout()
// We don't bother with setting up brownout if soft device is disabled - because during production we always use softdevice
}
NRF52Bluetooth *nrf52Bluetooth;
static bool bleOn = false;
static const bool useSoftDevice = true; // Set to false for easier debugging

View File

@@ -1,6 +1,6 @@
#include "configuration.h"
#include "CryptoEngine.h"
#include "aes.hpp"
#include "configuration.h"
class RP2040CryptoEngine : public CryptoEngine
{