forked from h2zero/esp-nimble-cpp
Fix compilation with esp32p4 (#253)
This commit is contained in:
1 parent
6c85cfa6c3
commit
b5b46661e0
6 files changed
+24
-21
No files matched your search
@@ -341,7 +341,7 @@ void app_main (void){
|
||||
NimBLEDevice::setSecurityAuth(/*BLE_SM_PAIR_AUTHREQ_BOND | BLE_SM_PAIR_AUTHREQ_MITM |*/ BLE_SM_PAIR_AUTHREQ_SC);
|
||||
|
||||
/** Optional: set the transmit power, default is -3db */
|
||||
NimBLEDevice::setPower(ESP_PWR_LVL_P9); /** 12db */
|
||||
NimBLEDevice::setPower(9); // 9dbm
|
||||
|
||||
/** create new scan */
|
||||
NimBLEScan* pScan = NimBLEDevice::getScan();
|
||||
|
||||
@@ -14,7 +14,7 @@ extern "C" void app_main(void);
|
||||
#define SERVICE_UUID "ABCD"
|
||||
#define CHARACTERISTIC_UUID "1234"
|
||||
|
||||
static NimBLEAdvertisedDevice* advDevice;
|
||||
static const NimBLEAdvertisedDevice* advDevice;
|
||||
static bool doConnect = false;
|
||||
static uint32_t scanTime = 10 * 1000; // In milliseconds, 0 = scan forever
|
||||
|
||||
@@ -37,7 +37,7 @@ class ClientCallbacks : public NimBLEClientCallbacks {
|
||||
|
||||
/* Define a class to handle the callbacks when advertisements are received */
|
||||
class scanCallbacks: public NimBLEScanCallbacks {
|
||||
void onResult(NimBLEAdvertisedDevice* advertisedDevice) {
|
||||
void onResult(const NimBLEAdvertisedDevice* advertisedDevice) {
|
||||
printf("Advertised Device found: %s\n", advertisedDevice->toString().c_str());
|
||||
if(advertisedDevice->isAdvertisingService(NimBLEUUID("ABCD")))
|
||||
{
|
||||
@@ -52,7 +52,7 @@ class scanCallbacks: public NimBLEScanCallbacks {
|
||||
}
|
||||
|
||||
/** Callback to process the results of the completed scan or restart it */
|
||||
void onScanEnd(NimBLEScanResults results) {
|
||||
void onScanEnd(const NimBLEScanResults& results, int rc) {
|
||||
printf("Scan Ended\n");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ class scanCallbacks : public NimBLEScanCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
void onScanEnd(NimBLEScanResults results) {
|
||||
void onScanEnd(const NimBLEScanResults&, int reason) {
|
||||
printf("Scan Ended\n");
|
||||
NimBLEDevice::getScan()->start(scanTimeMs);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user