Open hzhh110 opened 3 years ago
Hello, is there a Bluetooth low energy solution? Now running Bluetooth alone requires 80-90ma consumption, how can it be smaller? void setupBLE(String BLEName) { const char *ble_name = BLEName.c_str(); BLEDevice::init(ble_name); // BLEDevice::setPower(); BLEServer *pServer = BLEDevice::createServer(); pServer->setCallbacks(new MyServerCallbacks()); BLEService *pService = pServer->createService(SERVICE_UUID); //创建一个BLE服务 pCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_TX, BLECharacteristic::PROPERTY_NOTIFY); pCharacteristic->addDescriptor(new BLE2902()); BLECharacteristic *pCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_RX, BLECharacteristic::PROPERTY_WRITE); pCharacteristic->setCallbacks(new MyCallbacks()); pService->start(); pServer->getAdvertising()->start(); Serial.println("Waiting a client connection to notify..."); } void setup() { Serial.begin(115200); setupBLE("JH-ESP32-BT-CAM"); }
void setupBLE(String BLEName) { const char *ble_name = BLEName.c_str(); BLEDevice::init(ble_name); // BLEDevice::setPower(); BLEServer *pServer = BLEDevice::createServer(); pServer->setCallbacks(new MyServerCallbacks()); BLEService *pService = pServer->createService(SERVICE_UUID); //创建一个BLE服务 pCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_TX, BLECharacteristic::PROPERTY_NOTIFY); pCharacteristic->addDescriptor(new BLE2902()); BLECharacteristic *pCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_RX, BLECharacteristic::PROPERTY_WRITE); pCharacteristic->setCallbacks(new MyCallbacks()); pService->start(); pServer->getAdvertising()->start(); Serial.println("Waiting a client connection to notify..."); } void setup() { Serial.begin(115200); setupBLE("JH-ESP32-BT-CAM"); }
Hello, is there a Bluetooth low energy solution? Now running Bluetooth alone requires 80-90ma consumption, how can it be smaller?
void setupBLE(String BLEName) { const char *ble_name = BLEName.c_str(); BLEDevice::init(ble_name); // BLEDevice::setPower(); BLEServer *pServer = BLEDevice::createServer(); pServer->setCallbacks(new MyServerCallbacks()); BLEService *pService = pServer->createService(SERVICE_UUID); //创建一个BLE服务 pCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_TX, BLECharacteristic::PROPERTY_NOTIFY); pCharacteristic->addDescriptor(new BLE2902()); BLECharacteristic *pCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_RX, BLECharacteristic::PROPERTY_WRITE); pCharacteristic->setCallbacks(new MyCallbacks()); pService->start(); pServer->getAdvertising()->start(); Serial.println("Waiting a client connection to notify..."); } void setup() { Serial.begin(115200); setupBLE("JH-ESP32-BT-CAM"); }