revert NimBLE to 1.4.0 due to pairing issues
This commit is contained in:
@@ -2,22 +2,6 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [1.4.1] - 2022-10-23
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Compile warning removed for esp32c3
|
|
||||||
- NimBLEDevice::getPower incorrect value when power level is -3db.
|
|
||||||
- Failed pairing when already in progress.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Revert previous change that forced writing with response when subscribing in favor of allowing the application to decide.
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Added NimBLEHIDDevice::batteryLevel.
|
|
||||||
- Added NimBLEDevice::setDeviceName allowing for changing the device name while the BLE stack is active.
|
|
||||||
- CI build tests.
|
|
||||||
- Missing items in CHANGELOG that were not recorded correctly
|
|
||||||
|
|
||||||
## [1.4.0] - 2022-07-10
|
## [1.4.0] - 2022-07-10
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
@@ -27,9 +11,6 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Changed
|
### Changed
|
||||||
- Updated NimBLE core to use the v1.4.0 branch of esp-nimble.
|
- Updated NimBLE core to use the v1.4.0 branch of esp-nimble.
|
||||||
- AD flags are no longer set in the advertisements of non-connectable beacons, freeing up 3 bytes of advertisement room.
|
- AD flags are no longer set in the advertisements of non-connectable beacons, freeing up 3 bytes of advertisement room.
|
||||||
- Config option CONFIG_BT_NIMBLE_DEBUG replaced with CONFIG_BT_NIMBLE_LOG_LEVEL (see src/nimconfig.h for usage)
|
|
||||||
- Config option CONFIG_NIMBLE_CPP_ENABLE_ADVERTISMENT_TYPE_TEXT renamed to CONFIG_NIMBLE_CPP_ENABLE_ADVERTISEMENT_TYPE_TEXT
|
|
||||||
- Config option CONFIG_BT_NIMBLE_TASK_STACK_SIZE renamed to CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE
|
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Preliminary support for non-esp devices, NRF51 and NRF52 devices supported with [n-able arduino core](https://github.com/h2zero/n-able-Arduino)
|
- Preliminary support for non-esp devices, NRF51 and NRF52 devices supported with [n-able arduino core](https://github.com/h2zero/n-able-Arduino)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name=NimBLE-Arduino
|
name=NimBLE-Arduino
|
||||||
version=1.4.1
|
version=1.4.0
|
||||||
author=h2zero
|
author=h2zero
|
||||||
maintainer=h2zero <powellperalta@gmail.com>
|
maintainer=h2zero <powellperalta@gmail.com>
|
||||||
sentence=Bluetooth low energy (BLE) library for arduino-esp32 based on NimBLE.
|
sentence=Bluetooth low energy (BLE) library for arduino-esp32 based on NimBLE.
|
||||||
|
|||||||
@@ -336,7 +336,6 @@ bool NimBLEClient::connect(const NimBLEAddress &address, bool deleteAttributes)
|
|||||||
* @return True on success.
|
* @return True on success.
|
||||||
*/
|
*/
|
||||||
bool NimBLEClient::secureConnection() {
|
bool NimBLEClient::secureConnection() {
|
||||||
NIMBLE_LOGD(LOG_TAG, ">> secureConnection()");
|
|
||||||
TaskHandle_t cur_task = xTaskGetCurrentTaskHandle();
|
TaskHandle_t cur_task = xTaskGetCurrentTaskHandle();
|
||||||
ble_task_data_t taskData = {this, cur_task, 0, nullptr};
|
ble_task_data_t taskData = {this, cur_task, 0, nullptr};
|
||||||
|
|
||||||
@@ -346,7 +345,7 @@ bool NimBLEClient::secureConnection() {
|
|||||||
m_pTaskData = &taskData;
|
m_pTaskData = &taskData;
|
||||||
|
|
||||||
int rc = NimBLEDevice::startSecurity(m_conn_id);
|
int rc = NimBLEDevice::startSecurity(m_conn_id);
|
||||||
if(rc != 0 && rc != BLE_HS_EALREADY){
|
if(rc != 0){
|
||||||
m_lastErr = rc;
|
m_lastErr = rc;
|
||||||
m_pTaskData = nullptr;
|
m_pTaskData = nullptr;
|
||||||
return false;
|
return false;
|
||||||
@@ -361,11 +360,9 @@ bool NimBLEClient::secureConnection() {
|
|||||||
|
|
||||||
if(taskData.rc != 0){
|
if(taskData.rc != 0){
|
||||||
m_lastErr = taskData.rc;
|
m_lastErr = taskData.rc;
|
||||||
NIMBLE_LOGE(LOG_TAG, "secureConnection: failed rc=%d", taskData.rc);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NIMBLE_LOGD(LOG_TAG, "<< secureConnection: success");
|
|
||||||
return true;
|
return true;
|
||||||
} // secureConnection
|
} // secureConnection
|
||||||
|
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ int NimBLEDevice::getPower(esp_ble_power_type_t powerType) {
|
|||||||
case ESP_PWR_LVL_N6:
|
case ESP_PWR_LVL_N6:
|
||||||
return -6;
|
return -6;
|
||||||
case ESP_PWR_LVL_N3:
|
case ESP_PWR_LVL_N3:
|
||||||
return -3;
|
return -6;
|
||||||
case ESP_PWR_LVL_N0:
|
case ESP_PWR_LVL_N0:
|
||||||
return 0;
|
return 0;
|
||||||
case ESP_PWR_LVL_P3:
|
case ESP_PWR_LVL_P3:
|
||||||
@@ -971,15 +971,6 @@ void NimBLEDevice::deinit(bool clearAll) {
|
|||||||
}
|
}
|
||||||
} // deinit
|
} // deinit
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Set the BLEDevice's name
|
|
||||||
* @param [in] deviceName The device name of the device.
|
|
||||||
*/
|
|
||||||
/* STATIC */
|
|
||||||
void NimBLEDevice::setDeviceName(const std::string &deviceName) {
|
|
||||||
ble_svc_gap_device_name_set(deviceName.c_str());
|
|
||||||
} // setDeviceName
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if the initialization is complete.
|
* @brief Check if the initialization is complete.
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ class NimBLEDevice {
|
|||||||
public:
|
public:
|
||||||
static void init(const std::string &deviceName);
|
static void init(const std::string &deviceName);
|
||||||
static void deinit(bool clearAll = false);
|
static void deinit(bool clearAll = false);
|
||||||
static void setDeviceName(const std::string &deviceName);
|
|
||||||
static bool getInitialized();
|
static bool getInitialized();
|
||||||
static NimBLEAddress getAddress();
|
static NimBLEAddress getAddress();
|
||||||
static std::string toString();
|
static std::string toString();
|
||||||
@@ -151,8 +150,7 @@ public:
|
|||||||
int max_events = 0);
|
int max_events = 0);
|
||||||
static bool stopAdvertising(uint8_t inst_id);
|
static bool stopAdvertising(uint8_t inst_id);
|
||||||
static bool stopAdvertising();
|
static bool stopAdvertising();
|
||||||
# endif
|
# else
|
||||||
# if !CONFIG_BT_NIMBLE_EXT_ADV || defined(_DOXYGEN_)
|
|
||||||
static NimBLEAdvertising* getAdvertising();
|
static NimBLEAdvertising* getAdvertising();
|
||||||
static bool startAdvertising();
|
static bool startAdvertising();
|
||||||
static bool stopAdvertising();
|
static bool stopAdvertising();
|
||||||
|
|||||||
@@ -203,12 +203,12 @@ void NimBLEHIDDevice::setBatteryLevel(uint8_t level) {
|
|||||||
/*
|
/*
|
||||||
* @brief Returns battery level characteristic
|
* @brief Returns battery level characteristic
|
||||||
* @ return battery level characteristic
|
* @ return battery level characteristic
|
||||||
*/
|
*//*
|
||||||
NimBLECharacteristic* NimBLEHIDDevice::batteryLevel() {
|
BLECharacteristic* BLEHIDDevice::batteryLevel() {
|
||||||
return m_batteryLevelCharacteristic;
|
return m_batteryLevelCharacteristic;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
BLECharacteristic* BLEHIDDevice::reportMap() {
|
BLECharacteristic* BLEHIDDevice::reportMap() {
|
||||||
return m_reportMapCharacteristic;
|
return m_reportMapCharacteristic;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
void pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version);
|
void pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version);
|
||||||
//NimBLECharacteristic* hidInfo();
|
//NimBLECharacteristic* hidInfo();
|
||||||
void hidInfo(uint8_t country, uint8_t flags);
|
void hidInfo(uint8_t country, uint8_t flags);
|
||||||
NimBLECharacteristic* batteryLevel();
|
//NimBLECharacteristic* batteryLevel();
|
||||||
void setBatteryLevel(uint8_t level);
|
void setBatteryLevel(uint8_t level);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -616,6 +616,7 @@ bool NimBLERemoteCharacteristic::setNotify(uint16_t val, notify_callback notifyC
|
|||||||
|
|
||||||
NIMBLE_LOGD(LOG_TAG, "<< setNotify()");
|
NIMBLE_LOGD(LOG_TAG, "<< setNotify()");
|
||||||
|
|
||||||
|
response = true; // Always write with response as per Bluetooth core specification.
|
||||||
return desc->writeValue((uint8_t *)&val, 2, response);
|
return desc->writeValue((uint8_t *)&val, 2, response);
|
||||||
} // setNotify
|
} // setNotify
|
||||||
|
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ public:
|
|||||||
|
|
||||||
bool subscribe(bool notifications = true,
|
bool subscribe(bool notifications = true,
|
||||||
notify_callback notifyCallback = nullptr,
|
notify_callback notifyCallback = nullptr,
|
||||||
bool response = false);
|
bool response = true);
|
||||||
bool unsubscribe(bool response = false);
|
bool unsubscribe(bool response = true);
|
||||||
bool registerForNotify(notify_callback notifyCallback,
|
bool registerForNotify(notify_callback notifyCallback,
|
||||||
bool notifications = true,
|
bool notifications = true,
|
||||||
bool response = true)
|
bool response = true)
|
||||||
|
|||||||
@@ -58,8 +58,7 @@ public:
|
|||||||
int duration = 0,
|
int duration = 0,
|
||||||
int max_events = 0);
|
int max_events = 0);
|
||||||
bool stopAdvertising(uint8_t inst_id);
|
bool stopAdvertising(uint8_t inst_id);
|
||||||
#endif
|
#else
|
||||||
#if !CONFIG_BT_NIMBLE_EXT_ADV || defined(_DOXYGEN_)
|
|
||||||
NimBLEAdvertising* getAdvertising();
|
NimBLEAdvertising* getAdvertising();
|
||||||
bool startAdvertising();
|
bool startAdvertising();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -138,9 +138,7 @@ int ble_hci_trans_hs_acl_tx(struct os_mbuf *om)
|
|||||||
{
|
{
|
||||||
uint16_t len = 0;
|
uint16_t len = 0;
|
||||||
uint8_t data[MYNEWT_VAL(BLE_ACL_BUF_SIZE) + 3], rc = 0;
|
uint8_t data[MYNEWT_VAL(BLE_ACL_BUF_SIZE) + 3], rc = 0;
|
||||||
#ifndef CONFIG_FREERTOS_UNICORE
|
|
||||||
bool tx_using_nimble_core = 0;
|
bool tx_using_nimble_core = 0;
|
||||||
#endif
|
|
||||||
/* If this packet is zero length, just free it */
|
/* If this packet is zero length, just free it */
|
||||||
if (OS_MBUF_PKTLEN(om) == 0) {
|
if (OS_MBUF_PKTLEN(om) == 0) {
|
||||||
os_mbuf_free_chain(om);
|
os_mbuf_free_chain(om);
|
||||||
|
|||||||
2
main.cpp
2
main.cpp
@@ -194,7 +194,7 @@ void setup()
|
|||||||
|
|
||||||
bleScanner = new BleScanner::Scanner();
|
bleScanner = new BleScanner::Scanner();
|
||||||
bleScanner->initialize("NukiHub");
|
bleScanner->initialize("NukiHub");
|
||||||
bleScanner->setScanDuration(3);
|
bleScanner->setScanDuration(10);
|
||||||
|
|
||||||
Log->println(lockEnabled ? F("NUKI Lock enabled") : F("NUKI Lock disabled"));
|
Log->println(lockEnabled ? F("NUKI Lock enabled") : F("NUKI Lock disabled"));
|
||||||
if(lockEnabled)
|
if(lockEnabled)
|
||||||
|
|||||||
Reference in New Issue
Block a user