Skip to content

Commit 991c723

Browse files
pan-Cruz Monrreal II
authored andcommitted
BLE: Fix address type allowed to create a periodic sync.
1 parent 49717e4 commit 991c723

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

features/FEATURE_BLE/source/generic/GenericGap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2921,7 +2921,7 @@ ble_error_t GenericGap::createSync(
29212921
return BLE_ERROR_NOT_IMPLEMENTED;
29222922
}
29232923

2924-
if (peerAddressType != peer_address_type_t::PUBLIC ||
2924+
if (peerAddressType != peer_address_type_t::PUBLIC &&
29252925
peerAddressType != peer_address_type_t::RANDOM
29262926
) {
29272927
return BLE_ERROR_INVALID_PARAM;

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <stdio.h>
1718
#include "CordioPalGap.h"
1819
#include "hci_api.h"
1920
#include "dm_api.h"
@@ -484,12 +485,14 @@ void Gap::gap_handler(const wsfMsgHdr_t *msg)
484485
break;
485486

486487
case DM_PER_ADV_REPORT_IND: {
488+
printf("DM_PER_ADV_REPORT_IND\r\n");
487489
if (!handler) {
488490
break;
489491
}
490492

491493
const hciLePerAdvReportEvt_t *evt = (const hciLePerAdvReportEvt_t *) msg;
492494

495+
printf("preparing for generic gap\r\n");
493496
handler->on_periodic_advertising_report(
494497
evt->syncHandle,
495498
evt->txPower,
@@ -779,7 +782,7 @@ ble_error_t Gap::set_extended_advertising_parameters(
779782

780783
DmAdvConfig(
781784
advertising_handle,
782-
adv_type,
785+
adv_type,
783786
peer_address_type.value(),
784787
const_cast<uint8_t *>(peer_address.data())
785788
);
@@ -838,7 +841,7 @@ ble_error_t Gap::set_periodic_advertising_data(
838841
{
839842
DmPerAdvSetData(
840843
advertising_handle,
841-
fragment_description.value(),
844+
HCI_ADV_DATA_OP_COMP_FRAG,
842845
advertising_data_size,
843846
const_cast<uint8_t *>(advertising_data)
844847
);
@@ -981,12 +984,11 @@ ble_error_t Gap::extended_scan_enable(
981984
if (enable) {
982985
uint32_t duration_ms = duration * 10;
983986

984-
DmScanModeExt();
985987
DmScanStart(
986988
scanning_phys.value(),
987989
DM_DISC_MODE_NONE,
988990
extended_scan_type,
989-
filter_duplicates.value(), // TODO: cordio API incomplete ???
991+
filter_duplicates.value(),
990992
duration_ms > 0xFFFF ? 0xFFFF : duration_ms,
991993
period
992994
);

0 commit comments

Comments
 (0)