Skip to content
Merged
Show file tree
Hide file tree
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
78 changes: 67 additions & 11 deletions connectivity/FEATURE_BLE/include/ble/gap/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,22 @@ struct AdvertisingReportEvent {
const address_t &directAddress,
const mbed::Span<const uint8_t> &advertisingData
) :
peerAddress(peerAddress),
type(type),
peerAddressType(peerAddressType),
peerAddress(peerAddress),
primaryPhy(primaryPhy),
secondaryPhy(secondaryPhy),
SID(SID),
txPower(txPower),
rssi(rssi),
periodicInterval(periodicInterval),
rssi(rssi),
directAddressType(directAddressType),
directAddress(directAddress),
advertisingData(advertisingData)
{
}

#endif

/** Get event type. */
const advertising_event_t &getType() const
{
Expand Down Expand Up @@ -163,18 +162,44 @@ struct AdvertisingReportEvent {
return advertisingData;
}

/** Set peer address. */
void setPeerAddress(
const address_t &newPeerAddress
)
{
peerAddress = newPeerAddress;
}


/** Set peer address type. */
void setPeerAddressType(
const peer_address_type_t &newPeerAddressType
)
{
peerAddressType = newPeerAddressType;
}

/** Set new advertising payload. */
void setAdvertisingData(
const mbed::Span<const uint8_t> &newAdvertisingData
)
{
advertisingData = newAdvertisingData;
}

private:
address_t peerAddress;
advertising_event_t type;
peer_address_type_t peerAddressType;
address_t const &peerAddress;
phy_t primaryPhy;
phy_t secondaryPhy;
advertising_sid_t SID;
advertising_power_t txPower;
rssi_t rssi;
uint16_t periodicInterval;
rssi_t rssi;
peer_address_type_t directAddressType;
const address_t &directAddress;
address_t directAddress;
ble_error_t status;
mbed::Span<const uint8_t> advertisingData;
};

Expand Down Expand Up @@ -215,12 +240,12 @@ struct ConnectionCompleteEvent {
) :
status(status),
connectionHandle(connectionHandle),
peerAddress(peerAddress),
ownRole(ownRole),
peerAddressType(peerAddressType),
peerAddress(peerAddress),
localResolvablePrivateAddress(localResolvablePrivateAddress),
peerResolvablePrivateAddress(peerResolvablePrivateAddress),
connectionInterval(connectionInterval),
peerResolvablePrivateAddress(peerResolvablePrivateAddress),
connectionLatency(connectionLatency),
supervisionTimeout(supervisionTimeout),
masterClockAccuracy(masterClockAccuracy)
Expand Down Expand Up @@ -295,15 +320,46 @@ struct ConnectionCompleteEvent {
return masterClockAccuracy;
}


/** Set connection complete event status. */
void setStatus(ble_error_t new_status)
{
status = new_status;
}

/** Set peer address type. */
void setPeerAddressType(const peer_address_type_t& address_type)
{
peerAddressType = address_type;
}

/** Set peer address. */
void setPeerAddress(const address_t &address)
{
peerAddress = address;
}

/** Set get local resolvable random address if privacy is used. */
void setLocalResolvablePrivateAddress(const address_t &address)
{
localResolvablePrivateAddress = address;
}

/** Set peer resolvable private address if privacy is used. */
void setPeerResolvablePrivateAddress(const address_t &address)
{
peerResolvablePrivateAddress = address;
}

private:
ble_error_t status;
connection_handle_t connectionHandle;
address_t peerAddress;
connection_role_t ownRole;
peer_address_type_t peerAddressType;
const address_t &peerAddress;
const address_t &localResolvablePrivateAddress;
const address_t &peerResolvablePrivateAddress;
address_t localResolvablePrivateAddress;
conn_interval_t connectionInterval;
address_t peerResolvablePrivateAddress;
slave_latency_t connectionLatency;
supervision_timeout_t supervisionTimeout;
uint16_t masterClockAccuracy;
Expand Down
5 changes: 5 additions & 0 deletions connectivity/FEATURE_BLE/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
"help": "How many advertising sets the API can handle (this limits how much the stack can handle). Must be non-zero",
"value": 15,
"macro_name": "BLE_GAP_MAX_ADVERTISING_SETS"
},
"ble-gap-max-advertising-reports-pending-address-resolution": {
"help": "How many advertising reports can be pending while awaiting private address resolution. This is only used if host privacy is enabled and controller privacy is disabled. Must be non-zero",
"value": 16,
"macro_name": "BLE_GAP_MAX_ADVERTISING_REPORTS_PENDING_ADDRESS_RESOLUTION"
}
}
}
Loading