mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Report legacy advertising with new API.
parent
0ef7a40475
commit
56185582aa
|
@ -1550,6 +1550,26 @@ void GenericGap::on_advertising_report(const pal::GapAdvertisingReportEvent &e)
|
||||||
peer_address_type_t peer_address_type =
|
peer_address_type_t peer_address_type =
|
||||||
static_cast<peer_address_type_t::type>(advertising.address_type.value());
|
static_cast<peer_address_type_t::type>(advertising.address_type.value());
|
||||||
|
|
||||||
|
// report in new event handler
|
||||||
|
if (_eventHandler) {
|
||||||
|
_eventHandler->onAdvertisingReport(
|
||||||
|
AdvertisingReportEvent(
|
||||||
|
advertising_event_t(/*advertising.type*/ 0), // TODO
|
||||||
|
peer_address_type,
|
||||||
|
advertising.address,
|
||||||
|
/* primary */ phy_t::LE_1M,
|
||||||
|
/* secondary */ phy_t::NONE,
|
||||||
|
/* SID - NO ADI FIELD IN THE PDU */ 0xFF,
|
||||||
|
/* tx power information not available */ 127,
|
||||||
|
advertising.rssi,
|
||||||
|
/* NO PERIODIC ADVERTISING */ periodic_interval_t(0),
|
||||||
|
peer_address_type_t::ANONYMOUS,
|
||||||
|
ble::address_t (),
|
||||||
|
mbed::Span<const uint8_t>(advertising.data.data(), advertising.data.size())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
BLE_DEPRECATED_API_USE_BEGIN()
|
BLE_DEPRECATED_API_USE_BEGIN()
|
||||||
processAdvertisementReport(
|
processAdvertisementReport(
|
||||||
advertising.address.data(),
|
advertising.address.data(),
|
||||||
|
|
Loading…
Reference in New Issue