Skip to content

Commit 632851e

Browse files
committed
BLE - Small reordering to reduce diff.
1 parent 9e5e23a commit 632851e

File tree

8 files changed

+49
-53
lines changed

8 files changed

+49
-53
lines changed

features/FEATURE_BLE/ble/gap/ConnectionParameters.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,21 @@ class ConnectionParameters {
212212
return *this;
213213
}
214214

215+
/**
216+
* Set if the whitelist should be used to find the peer.
217+
*
218+
* @param filterPolicy The initiator filter to apply.
219+
*
220+
* @return A reference to this.
221+
*/
222+
ConnectionParameters &setFilter(initiator_filter_policy_t filterPolicy)
223+
{
224+
#if BLE_FEATURE_WHITELIST
225+
_filterPolicy = filterPolicy;
226+
#endif // BLE_FEATURE_WHITELIST
227+
return *this;
228+
}
229+
215230
/**
216231
* Enable or disable PHYs.
217232
*
@@ -273,6 +288,20 @@ class ConnectionParameters {
273288
return _ownAddressType;
274289
}
275290

291+
/**
292+
* Return the initiator policy.
293+
*
294+
* @return The initiator policy.
295+
*/
296+
initiator_filter_policy_t getFilter() const
297+
{
298+
#if BLE_FEATURE_WHITELIST
299+
return _filterPolicy;
300+
#else
301+
return initiator_filter_policy_t::NO_FILTER;
302+
#endif // BLE_FEATURE_WHITELIST
303+
}
304+
276305
/**
277306
* Return the number of PHY enabled.
278307
* @return The number of PHY enabled.
@@ -288,35 +317,6 @@ class ConnectionParameters {
288317
);
289318
}
290319

291-
/**
292-
* Set if the whitelist should be used to find the peer.
293-
*
294-
* @param filterPolicy The initiator filter to apply.
295-
*
296-
* @return A reference to this.
297-
*/
298-
ConnectionParameters &setFilter(initiator_filter_policy_t filterPolicy)
299-
{
300-
#if BLE_FEATURE_WHITELIST
301-
_filterPolicy = filterPolicy;
302-
#endif // BLE_FEATURE_WHITELIST
303-
return *this;
304-
}
305-
306-
/**
307-
* Return the initiator policy.
308-
*
309-
* @return The initiator policy.
310-
*/
311-
initiator_filter_policy_t getFilter() const
312-
{
313-
#if BLE_FEATURE_WHITELIST
314-
return _filterPolicy;
315-
#else
316-
return initiator_filter_policy_t::NO_FILTER;
317-
#endif // BLE_FEATURE_WHITELIST
318-
}
319-
320320
#if !defined(DOXYGEN_ONLY)
321321

322322
phy_set_t getPhySet() const

features/FEATURE_BLE/ble/pal/PalSecurityManager.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,7 @@ class SecurityManagerEventHandler :
545545
advertising_peer_address_type_t peer_identity_address_type,
546546
const address_t &peer_identity_address
547547
) {
548-
impl()->on_keys_distributed_bdaddr_(
549-
connection,
550-
peer_identity_address_type,
551-
peer_identity_address
552-
);
548+
impl()->on_keys_distributed_bdaddr_(connection, peer_identity_address_type, peer_identity_address);
553549
}
554550

555551
/**
@@ -562,7 +558,7 @@ class SecurityManagerEventHandler :
562558
connection_handle_t connection,
563559
const csrk_t &csrk
564560
) {
565-
impl()->on_keys_distributed_csrk(connection, csrk);
561+
impl()->on_keys_distributed_csrk_(connection, csrk);
566562
}
567563

568564
/**

features/FEATURE_BLE/source/generic/GenericGap.tpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,13 +1184,6 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
11841184
return BLE_ERROR_NONE;
11851185
}
11861186

1187-
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
1188-
typename GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::LegacyGap::AdvertisingPolicyMode_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::getAdvertisingPolicyMode_(void) const
1189-
{
1190-
useVersionOneAPI();
1191-
return (AdvertisingPolicyMode_t) _advertising_filter_policy.value();
1192-
}
1193-
11941187
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
11951188
ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::setScanningPolicyMode_(ScanningPolicyMode_t mode)
11961189
{
@@ -1204,13 +1197,6 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
12041197
return BLE_ERROR_NONE;
12051198
}
12061199

1207-
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
1208-
typename GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::LegacyGap::ScanningPolicyMode_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::getScanningPolicyMode_(void) const
1209-
{
1210-
useVersionOneAPI();
1211-
return (ScanningPolicyMode_t) _scanning_filter_policy.value();
1212-
}
1213-
12141200
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
12151201
ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::setInitiatorPolicyMode_(InitiatorPolicyMode_t mode)
12161202
{
@@ -1224,6 +1210,20 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
12241210
return BLE_ERROR_NONE;
12251211
}
12261212

1213+
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
1214+
typename GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::LegacyGap::AdvertisingPolicyMode_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::getAdvertisingPolicyMode_(void) const
1215+
{
1216+
useVersionOneAPI();
1217+
return (AdvertisingPolicyMode_t) _advertising_filter_policy.value();
1218+
}
1219+
1220+
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
1221+
typename GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::LegacyGap::ScanningPolicyMode_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::getScanningPolicyMode_(void) const
1222+
{
1223+
useVersionOneAPI();
1224+
return (ScanningPolicyMode_t) _scanning_filter_policy.value();
1225+
}
1226+
12271227
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
12281228
typename GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::LegacyGap::InitiatorPolicyMode_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::getInitiatorPolicyMode_(void) const
12291229
{

features/FEATURE_BLE/source/services/DFUService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ const uint8_t DFUServicePacketCharacteristicUUID[] = {
4141

4242
DFUService::ResetPrepare_t DFUService::handoverCallback = NULL;
4343

44-
#endif /* #ifdef TARGET_NRF51822 */
44+
#endif /* #ifdef TARGET_NRF51822 */

features/FEATURE_BLE/source/services/UARTService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ const uint8_t UARTServiceTXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID] = {
3838
const uint8_t UARTServiceRXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID] = {
3939
0x6E, 0x40, (uint8_t)(UARTServiceRXCharacteristicShortUUID >> 8), (uint8_t)(UARTServiceRXCharacteristicShortUUID & 0xFF), 0xB5, 0xA3, 0xF3, 0x93,
4040
0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E,
41-
};
41+
};

features/FEATURE_BLE/source/services/URIBeaconConfigService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ const uint8_t UUID_TX_POWER_MODE_CHAR[UUID::LENGTH_OF_LONG_UUID] = UUID_URI_B
3232
const uint8_t UUID_BEACON_PERIOD_CHAR[UUID::LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x88);
3333
const uint8_t UUID_RESET_CHAR[UUID::LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x89);
3434

35-
const uint8_t BEACON_UUID[sizeof(UUID::ShortUUIDBytes_t)] = {0xD8, 0xFE};
35+
const uint8_t BEACON_UUID[sizeof(UUID::ShortUUIDBytes_t)] = {0xD8, 0xFE};

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ class GattServer : public ::ble::interface::GattServer<GattServer>,
183183
_signing_event_handler = signing_event_handler;
184184
}
185185

186+
186187
private:
187188
static uint16_t compute_attributes_count(GattService& service);
188189

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ class CordioSecurityManager : public ::ble::pal::SecurityManager<CordioSecurityM
372372
PrivacyControlBlock* _pending_privacy_control_blocks;
373373
bool _processing_privacy_control_block;
374374
irk_t _irk;
375-
376375
csrk_t _csrk;
377376
csrk_t* _peer_csrks[DM_CONN_MAX];
378377
};

0 commit comments

Comments
 (0)