mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-01 19:35:42 +00:00
reverted the revert #6640 + increased speed, bleutooth is stable now on reconnection cold booth etc , GPS is still not working though
This commit is contained in:
parent
a5ef03bc7e
commit
a72e02b844
@ -50,7 +50,7 @@ lib_deps =
|
||||
# renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master
|
||||
https://github.com/meshtastic/esp32_https_server/archive/896f1771ceb5979987a0b41028bf1b4e7aad419b.zip
|
||||
# renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino
|
||||
h2zero/NimBLE-Arduino@^1.4.3
|
||||
h2zero/NimBLE-Arduino@^2.2.3
|
||||
# renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master
|
||||
https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip
|
||||
# renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib
|
||||
|
@ -1292,8 +1292,9 @@ void setup()
|
||||
PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS
|
||||
powerFSMthread = new PowerFSMThread();
|
||||
|
||||
#if !HAS_TFT
|
||||
#if !HAS_TFT && !USE_ST7796
|
||||
setCPUFast(false); // 80MHz is fine for our slow peripherals
|
||||
LOG_DEBUG("SLOW-CPU-SPEED");
|
||||
#endif
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
@ -49,7 +49,7 @@ static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
|
||||
|
||||
class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
virtual void onWrite(NimBLECharacteristic *pCharacteristic)
|
||||
virtual void onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo)
|
||||
{
|
||||
LOG_DEBUG("To Radio onwrite");
|
||||
auto val = pCharacteristic->getValue();
|
||||
@ -66,7 +66,7 @@ class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
|
||||
|
||||
class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
virtual void onRead(NimBLECharacteristic *pCharacteristic)
|
||||
virtual void onRead(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo)
|
||||
{
|
||||
uint8_t fromRadioBytes[meshtastic_FromRadio_size];
|
||||
size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes);
|
||||
@ -79,7 +79,7 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
||||
|
||||
class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
||||
{
|
||||
virtual uint32_t onPassKeyRequest()
|
||||
virtual uint32_t onPassKeyDisplay()
|
||||
{
|
||||
uint32_t passkey = config.bluetooth.fixed_pin;
|
||||
|
||||
@ -125,7 +125,7 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
||||
return passkey;
|
||||
}
|
||||
|
||||
virtual void onAuthenticationComplete(ble_gap_conn_desc *desc)
|
||||
virtual void onAuthenticationComplete(NimBLEConnInfo &connInfo)
|
||||
{
|
||||
LOG_INFO("BLE authentication complete");
|
||||
|
||||
@ -138,9 +138,9 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
||||
}
|
||||
}
|
||||
|
||||
virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc)
|
||||
virtual void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo &connInfo, int reason)
|
||||
{
|
||||
LOG_INFO("BLE disconnect");
|
||||
LOG_INFO("BLE disconnect. Reason %i", reason);
|
||||
|
||||
bluetoothStatus->updateStatus(
|
||||
new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED));
|
||||
@ -191,7 +191,7 @@ int NimbleBluetooth::getRssi()
|
||||
if (bleServer && isConnected()) {
|
||||
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
|
||||
uint16_t handle = service->getHandle();
|
||||
return NimBLEDevice::getClientByID(handle)->getRssi();
|
||||
return NimBLEDevice::getClientByHandle(handle)->getRssi();
|
||||
}
|
||||
return 0; // FIXME figure out where to source this
|
||||
}
|
||||
@ -216,6 +216,7 @@ void NimbleBluetooth::setup()
|
||||
|
||||
NimbleBluetoothServerCallback *serverCallbacks = new NimbleBluetoothServerCallback();
|
||||
bleServer->setCallbacks(serverCallbacks, true);
|
||||
bleServer->advertiseOnDisconnect(true);
|
||||
setupService();
|
||||
startAdvertising();
|
||||
}
|
||||
@ -259,7 +260,7 @@ void NimbleBluetooth::setupService()
|
||||
BatteryCharacteristic = batteryService->createCharacteristic( // 0x2A19 is the Battery Level characteristic)
|
||||
(uint16_t)0x2a19, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY, 1);
|
||||
|
||||
NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->createDescriptor((uint16_t)0x2904);
|
||||
NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->create2904();
|
||||
batteryLevelDescriptor->setFormat(NimBLE2904::FORMAT_UINT8);
|
||||
batteryLevelDescriptor->setNamespace(1);
|
||||
batteryLevelDescriptor->setUnit(0x27ad);
|
||||
|
@ -57,7 +57,7 @@
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
#define USE_VIRTUAL_KEYBOARD 1
|
||||
|
||||
#define MESHTASTIC_EXCLUDE_BLUETOOTH 1
|
||||
// #define MESHTASTIC_EXCLUDE_BLUETOOTH 1
|
||||
|
||||
#define ST7796_NSS 25
|
||||
#define ST7796_RS 13 // DC
|
||||
|
Loading…
Reference in New Issue
Block a user