Skip to content

Fix GIT 497 CurieBLE: SensorTag example no longer works out of the box #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions libraries/CurieBLE/src/internal/BLEDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,9 @@ BLEDevice BLEDeviceManager::available()
{
uint64_t timestamp_delta = timestamp - _peer_adv_mill[i];
temp = &_peer_adv_buffer[i];
if ((timestamp_delta <= 2000) && (max_delta < timestamp_delta))
if ((timestamp_delta >= 800) && // Wait scan response coming || _peer_scan_rsp_data_len[i] >= 0
(timestamp_delta <= 2000) && // Check timeout
(max_delta < timestamp_delta))
{
// Eable the duplicate filter
if (_adv_duplicate_filter_enabled &&
Expand Down Expand Up @@ -1461,7 +1463,8 @@ bool BLEDeviceManager::setAdvertiseBuffer(const bt_addr_le_t* bt_addr,
_peer_adv_data_len[index] = data_len;
_peer_adv_rssi[index] = rssi;
// Update the timestamp
_peer_adv_mill[index] = timestamp;
if (timestamp - _peer_adv_mill[index] > 1000)
_peer_adv_mill[index] = timestamp;
_peer_adv_connectable[index] = connectable;
retval = true;
}
Expand Down Expand Up @@ -1503,7 +1506,9 @@ bool BLEDeviceManager::setScanRespBuffer(const bt_addr_le_t* bt_addr,
_peer_scan_rsp_data_len[index] = data_len;
//_peer_adv_rssi[index] = rssi;
// Update the timestamp
_peer_adv_mill[index] = timestamp;
if (timestamp - _peer_adv_mill[index] > 1000)
_peer_adv_mill[index] = timestamp;
//_peer_adv_mill[index] = timestamp;
retval = true;
}

Expand Down