mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 17:42:48 +00:00
only one announcer seems supported in ESP32 BLE, so use that for our mesh service
This commit is contained in:
parent
59aaffa3e5
commit
a7b5da5dd2
@ -199,19 +199,17 @@ BLEServer *initBLE(std::string deviceName, std::string hwVendor, std::string swV
|
|||||||
// BLEService *pBattery = createBatteryService(pServer);
|
// BLEService *pBattery = createBatteryService(pServer);
|
||||||
|
|
||||||
BLEService *pUpdate = createUpdateService(pServer); // We need to advertise this so our android ble scan operation can see it
|
BLEService *pUpdate = createUpdateService(pServer); // We need to advertise this so our android ble scan operation can see it
|
||||||
pServer->getAdvertising()->addServiceUUID(pUpdate->getUUID());
|
|
||||||
|
// It seems only one service can be advertised - so for now don't advertise our updater
|
||||||
|
// pServer->getAdvertising()->addServiceUUID(pUpdate->getUUID());
|
||||||
|
|
||||||
// start all our services (do this after creating all of them)
|
// start all our services (do this after creating all of them)
|
||||||
pDevInfo->start();
|
pDevInfo->start();
|
||||||
pUpdate->start();
|
pUpdate->start();
|
||||||
|
|
||||||
// Start advertising
|
|
||||||
BLEAdvertising *advert = pServer->getAdvertising();
|
|
||||||
|
|
||||||
// FIXME turn on this restriction only after the device is paired with a phone
|
// FIXME turn on this restriction only after the device is paired with a phone
|
||||||
// advert->setScanFilter(false, true); // We let anyone scan for us (FIXME, perhaps only allow that until we are paired with a phone and configured) but only let whitelist phones connect
|
// advert->setScanFilter(false, true); // We let anyone scan for us (FIXME, perhaps only allow that until we are paired with a phone and configured) but only let whitelist phones connect
|
||||||
|
|
||||||
advert->start();
|
|
||||||
|
|
||||||
BLESecurity *pSecurity = new BLESecurity();
|
BLESecurity *pSecurity = new BLESecurity();
|
||||||
pSecurity->setCapability(ESP_IO_CAP_OUT);
|
pSecurity->setCapability(ESP_IO_CAP_OUT);
|
||||||
|
@ -382,6 +382,9 @@ void setup()
|
|||||||
DEBUG_MSG("Starting bluetooth\n");
|
DEBUG_MSG("Starting bluetooth\n");
|
||||||
BLEServer *serve = initBLE(getDeviceName(), HW_VENDOR, APP_VERSION); // FIXME, use a real name based on the macaddr
|
BLEServer *serve = initBLE(getDeviceName(), HW_VENDOR, APP_VERSION); // FIXME, use a real name based on the macaddr
|
||||||
createMeshBluetoothService(serve);
|
createMeshBluetoothService(serve);
|
||||||
|
|
||||||
|
// Start advertising - this must be done _after_ creating all services
|
||||||
|
serve->getAdvertising()->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
enableModemSleep();
|
enableModemSleep();
|
||||||
@ -422,6 +425,9 @@ void loop()
|
|||||||
if (axp.isVbusRemoveIRQ())
|
if (axp.isVbusRemoveIRQ())
|
||||||
isCharging = false;
|
isCharging = false;
|
||||||
|
|
||||||
|
if (axp.isAcinPlugInIRQ())
|
||||||
|
fixme - cleanup all this is chrarging crap.just read the status registers then clear the irq
|
||||||
|
isUSBPowered = true
|
||||||
// This is not a GPIO actually connected on the tbeam board
|
// This is not a GPIO actually connected on the tbeam board
|
||||||
// digitalWrite(2, !digitalRead(2));
|
// digitalWrite(2, !digitalRead(2));
|
||||||
axp.clearIRQ();
|
axp.clearIRQ();
|
||||||
|
Loading…
Reference in New Issue
Block a user