diff --git a/src/NimBLEClient.cpp b/src/NimBLEClient.cpp index 7d9a10e..7054f93 100644 --- a/src/NimBLEClient.cpp +++ b/src/NimBLEClient.cpp @@ -147,7 +147,7 @@ bool NimBLEClient::connect(bool deleteAttributes, bool asyncConnect, bool exchan * If false, the client will use the default MTU size and the application will need to call exchangeMTU() later. * @return true on success. */ -bool NimBLEClient::connect(NimBLEAdvertisedDevice* device, bool deleteAttributes, bool asyncConnect, bool exchangeMTU) { +bool NimBLEClient::connect(const NimBLEAdvertisedDevice* device, bool deleteAttributes, bool asyncConnect, bool exchangeMTU) { NimBLEAddress address(device->getAddress()); return connect(address, deleteAttributes, asyncConnect, exchangeMTU); } diff --git a/src/NimBLEClient.h b/src/NimBLEClient.h index d5c3265..430e3c6 100644 --- a/src/NimBLEClient.h +++ b/src/NimBLEClient.h @@ -44,10 +44,10 @@ struct NimBLETaskData; */ class NimBLEClient { public: - bool connect(NimBLEAdvertisedDevice* device, - bool deleteAttributes = true, - bool asyncConnect = false, - bool exchangeMTU = true); + bool connect(const NimBLEAdvertisedDevice* device, + bool deleteAttributes = true, + bool asyncConnect = false, + bool exchangeMTU = true); bool connect(const NimBLEAddress& address, bool deleteAttributes = true, bool asyncConnect = false, bool exchangeMTU = true); bool connect(bool deleteAttributes = true, bool asyncConnect = false, bool exchangeMTU = true); bool disconnect(uint8_t reason = BLE_ERR_REM_USER_CONN_TERM);