mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-03 13:55:45 +00:00
Lib Update
Draft because PIN display doesn't work yet.
This commit is contained in:
parent
5a9d70b445
commit
411f7b2015
@ -46,7 +46,7 @@ lib_deps =
|
|||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
https://github.com/meshtastic/esp32_https_server/archive/23665b3adc080a311dcbb586ed5941b5f94d6ea2.zip
|
https://github.com/meshtastic/esp32_https_server/archive/23665b3adc080a311dcbb586ed5941b5f94d6ea2.zip
|
||||||
h2zero/NimBLE-Arduino@^1.4.3
|
h2zero/NimBLE-Arduino@^2.2.3
|
||||||
https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip
|
https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip
|
||||||
lewisxhe/XPowersLib@^0.2.7
|
lewisxhe/XPowersLib@^0.2.7
|
||||||
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|
||||||
|
@ -85,7 +85,7 @@ build_src_filter = ${env.build_src_filter} -<platform/portduino/> -<graphics/nic
|
|||||||
[networking_base]
|
[networking_base]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
knolleary/PubSubClient@2.8
|
knolleary/PubSubClient@2.8
|
||||||
arduino-libraries/NTPClient@3.1.0
|
arduino-libraries/NTPClient@3.2.1
|
||||||
arcao/Syslog@2.0.0
|
arcao/Syslog@2.0.0
|
||||||
|
|
||||||
[radiolib_base]
|
[radiolib_base]
|
||||||
|
@ -49,7 +49,7 @@ static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
|
|||||||
|
|
||||||
class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
|
class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
|
||||||
{
|
{
|
||||||
virtual void onWrite(NimBLECharacteristic *pCharacteristic)
|
virtual void onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("To Radio onwrite");
|
LOG_DEBUG("To Radio onwrite");
|
||||||
auto val = pCharacteristic->getValue();
|
auto val = pCharacteristic->getValue();
|
||||||
@ -66,7 +66,7 @@ class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
|
|||||||
|
|
||||||
class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
||||||
{
|
{
|
||||||
virtual void onRead(NimBLECharacteristic *pCharacteristic)
|
virtual void onRead(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo)
|
||||||
{
|
{
|
||||||
uint8_t fromRadioBytes[meshtastic_FromRadio_size];
|
uint8_t fromRadioBytes[meshtastic_FromRadio_size];
|
||||||
size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes);
|
size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes);
|
||||||
@ -79,7 +79,7 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
|||||||
|
|
||||||
class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
||||||
{
|
{
|
||||||
virtual uint32_t onPassKeyRequest()
|
virtual void onPassKeyEntry(NimBLEConnInfo &connInfo)
|
||||||
{
|
{
|
||||||
uint32_t passkey = config.bluetooth.fixed_pin;
|
uint32_t passkey = config.bluetooth.fixed_pin;
|
||||||
|
|
||||||
@ -122,10 +122,10 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
|||||||
#endif
|
#endif
|
||||||
passkeyShowing = true;
|
passkeyShowing = true;
|
||||||
|
|
||||||
return passkey;
|
NimBLEDevice::injectPassKey(connInfo, passkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void onAuthenticationComplete(ble_gap_conn_desc *desc)
|
virtual void onAuthenticationComplete(NimBLEConnInfo &connInfo)
|
||||||
{
|
{
|
||||||
LOG_INFO("BLE authentication complete");
|
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(
|
bluetoothStatus->updateStatus(
|
||||||
new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED));
|
new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED));
|
||||||
@ -191,7 +191,7 @@ int NimbleBluetooth::getRssi()
|
|||||||
if (bleServer && isConnected()) {
|
if (bleServer && isConnected()) {
|
||||||
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
|
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
|
||||||
uint16_t handle = service->getHandle();
|
uint16_t handle = service->getHandle();
|
||||||
return NimBLEDevice::getClientByID(handle)->getRssi();
|
return NimBLEDevice::getClientByHandle(handle)->getRssi();
|
||||||
}
|
}
|
||||||
return 0; // FIXME figure out where to source this
|
return 0; // FIXME figure out where to source this
|
||||||
}
|
}
|
||||||
@ -216,6 +216,7 @@ void NimbleBluetooth::setup()
|
|||||||
|
|
||||||
NimbleBluetoothServerCallback *serverCallbacks = new NimbleBluetoothServerCallback();
|
NimbleBluetoothServerCallback *serverCallbacks = new NimbleBluetoothServerCallback();
|
||||||
bleServer->setCallbacks(serverCallbacks, true);
|
bleServer->setCallbacks(serverCallbacks, true);
|
||||||
|
bleServer->advertiseOnDisconnect(true);
|
||||||
setupService();
|
setupService();
|
||||||
startAdvertising();
|
startAdvertising();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user