mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Allow null value for periodic interval in advertising report event.
parent
df443c20ca
commit
df95a1f8bd
|
|
@ -63,7 +63,7 @@ struct AdvertisingReportEvent {
|
|||
advertising_sid_t SID,
|
||||
advertising_power_t txPower,
|
||||
rssi_t rssi,
|
||||
periodic_interval_t periodicInterval,
|
||||
uint16_t periodicInterval,
|
||||
const peer_address_type_t &directAddressType,
|
||||
const address_t &directAddress,
|
||||
const mbed::Span<const uint8_t> &advertisingData
|
||||
|
|
@ -133,10 +133,15 @@ struct AdvertisingReportEvent {
|
|||
return rssi;
|
||||
}
|
||||
|
||||
/** Indicate if periodic interval is valid */
|
||||
bool isPeriodicIntervalPresent() const {
|
||||
return periodicInterval != 0;
|
||||
}
|
||||
|
||||
/** Get interval. */
|
||||
periodic_interval_t getPeriodicInterval() const
|
||||
{
|
||||
return periodicInterval;
|
||||
return periodic_interval_t(periodicInterval);
|
||||
}
|
||||
|
||||
/** Get target address type in directed advertising. */
|
||||
|
|
@ -166,7 +171,7 @@ private:
|
|||
advertising_sid_t SID;
|
||||
advertising_power_t txPower;
|
||||
rssi_t rssi;
|
||||
periodic_interval_t periodicInterval;
|
||||
uint16_t periodicInterval;
|
||||
peer_address_type_t directAddressType;
|
||||
const address_t &directAddress;
|
||||
mbed::Span<const uint8_t> advertisingData;
|
||||
|
|
|
|||
|
|
@ -1589,7 +1589,7 @@ void GenericGap::on_advertising_report(const pal::GapAdvertisingReportEvent &e)
|
|||
/* SID - NO ADI FIELD IN THE PDU */ 0xFF,
|
||||
/* tx power information not available */ 127,
|
||||
advertising.rssi,
|
||||
/* NO PERIODIC ADVERTISING */ periodic_interval_t(0),
|
||||
/* NO PERIODIC ADVERTISING */ 0,
|
||||
peer_address_type_t::ANONYMOUS,
|
||||
ble::address_t (),
|
||||
mbed::Span<const uint8_t>(advertising.data.data(), advertising.data.size())
|
||||
|
|
@ -2642,7 +2642,7 @@ void GenericGap::on_extended_advertising_report(
|
|||
advertising_sid,
|
||||
tx_power,
|
||||
rssi,
|
||||
periodic_interval_t(periodic_advertising_interval),
|
||||
periodic_advertising_interval,
|
||||
(PeerAddressType_t::type) direct_address_type.value(),
|
||||
(BLEProtocol::AddressBytes_t &) direct_address,
|
||||
mbed::make_Span(data, data_length)
|
||||
|
|
|
|||
Loading…
Reference in New Issue