Nordi BLE: Fix formatting

pull/7210/head
Vincent Coubard 2018-06-22 09:35:34 +01:00
parent 5237c3ec40
commit b68e18cdb4
2 changed files with 13 additions and 15 deletions

View File

@ -1389,7 +1389,6 @@ ble_error_t nRF5xGap::get_role(ble::connection_handle_t connection, Role_t& role
if (c.is_allocated && c.connection == connection) {
role = c.is_peripheral ? PERIPHERAL : CENTRAL;
return BLE_ERROR_NONE;
}
}

View File

@ -244,7 +244,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
{
uint32_t err;
ble_gap_adv_params_t adv_para = {0};
/* Make sure we support the advertising type */
if (params.getAdvertisingType() == GapAdvertisingParams::ADV_CONNECTABLE_DIRECTED) {
/* ToDo: This requires a propery security implementation, etc. */
@ -296,7 +296,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
return error;
}
}
if (_privacy_enabled) {
if (_peripheral_privacy_configuration.resolution_strategy != PeripheralPrivacyConfiguration_t::DO_NOT_RESOLVE) {
ArrayView<resolving_list_entry_t> entries = get_sm().get_resolving_list();
@ -336,7 +336,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
}
#endif
/* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */
/* Start Advertising */
@ -345,7 +345,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
adv_para.fp = advertisingPolicyMode;
adv_para.interval = params.getIntervalInADVUnits(); // advertising interval (in units of 0.625 ms)
adv_para.timeout = params.getTimeout();
#if (NRF_SD_BLE_API_VERSION >= 5)
err = sd_ble_gap_adv_start(&adv_para, NRF_CONNECTION_TAG);
#else
@ -365,9 +365,9 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
#if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110)
ble_error_t nRF5xGap::startRadioScan(const GapScanningParams &scanningParams)
{
ble_gap_scan_params_t scanParams;
#if (NRF_SD_BLE_API_VERSION <= 2)
/* Allocate the stack's whitelist statically */
ble_gap_whitelist_t whitelist;
@ -386,17 +386,17 @@ ble_error_t nRF5xGap::startRadioScan(const GapScanningParams &scanningParams)
return error;
}
}
// FIXME: fill the irk list once addresses are resolved by the softdevice.
scanParams.selective = scanningPolicyMode; /**< If 1, ignore unknown devices (non whitelisted). */
scanParams.p_whitelist = &whitelist; /**< Pointer to whitelist, NULL if none is given. */
#else
/* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */
scanParams.use_whitelist = scanningPolicyMode;
scanParams.adv_dir_report = 0;
#endif
scanParams.active = scanningParams.getActiveScanning(); /**< If 1, perform active scanning (scan requests). */
scanParams.interval = scanningParams.getInterval(); /**< Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
@ -545,7 +545,7 @@ ble_error_t nRF5xGap::connect(
}
ble_gap_scan_params_t scanParams ={0};
#if (NRF_SD_BLE_API_VERSION <= 2)
/* Allocate the stack's whitelist statically */
ble_gap_whitelist_t whitelist;
@ -564,7 +564,7 @@ ble_error_t nRF5xGap::connect(
return error;
}
}
scanParams.selective = scanningPolicyMode; /**< If 1, ignore unknown devices (non whitelisted). */
scanParams.p_whitelist = &whitelist; /**< Pointer to whitelist, NULL if none is given. */
if (_privacy_enabled) {
@ -597,7 +597,7 @@ ble_error_t nRF5xGap::connect(
}
#else
/* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */
scanParams.use_whitelist = (whitelistAddressesSize) ? 1 : 0;
if (_privacy_enabled) {
@ -797,7 +797,7 @@ ble_error_t nRF5xGap::setAddress(LegacyAddressType_t type, const Address_t addre
if (_privacy_enabled) {
return BLE_ERROR_INVALID_STATE;
}
ble_gap_addr_t dev_addr;
memcpy(dev_addr.addr, address, ADDR_LEN);
if (type == LegacyAddressType::PUBLIC) {
@ -1472,7 +1472,6 @@ ble_error_t nRF5xGap::get_role(ble::connection_handle_t connection, Role_t& role
if (c.is_allocated && c.connection == connection) {
role = c.is_peripheral ? PERIPHERAL : CENTRAL;
return BLE_ERROR_NONE;
}
}