Skip to content

Commit 8bdd6bc

Browse files
braces always on newline
1 parent f6a8610 commit 8bdd6bc

File tree

16 files changed

+216
-108
lines changed

16 files changed

+216
-108
lines changed

connectivity/FEATURE_BLE/include/ble/common/ble/BLETypes.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ class PasskeyAscii {
311311
* Returns true if every byte is equal to zero
312312
*/
313313
template <class byte_array_class>
314-
bool is_all_zeros(byte_array_class &byte_array) {
314+
bool is_all_zeros(byte_array_class &byte_array)
315+
{
315316
for (size_t i = 0; i < byte_array.size(); i++) {
316317
if (byte_array[i] != 0) {
317318
return false;
@@ -324,7 +325,8 @@ bool is_all_zeros(byte_array_class &byte_array) {
324325
* Zero out all bytes
325326
*/
326327
template <class byte_array_class>
327-
void set_all_zeros(byte_array_class &byte_array) {
328+
void set_all_zeros(byte_array_class &byte_array)
329+
{
328330
memset(&byte_array[0], 0x00, byte_array.size());
329331
}
330332

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ enum initialization_state_t {
4949

5050
static initialization_state_t initialization_state = WAITING_FOR_INITIALIZATION;
5151

52-
static void process_ble_events(BLE::OnEventsToProcessCallbackContext* context) {
52+
static void process_ble_events(BLE::OnEventsToProcessCallbackContext* context)
53+
{
5354
BLE &ble = BLE::Instance();
5455
event_queue.call(callback(&ble, &BLE::processEvents));
5556
}
5657

57-
static void on_initialization_complete(BLE::InitializationCompleteCallbackContext *params) {
58+
static void on_initialization_complete(BLE::InitializationCompleteCallbackContext *params)
59+
{
5860
if (params->error == BLE_ERROR_NONE) {
5961
initialization_state = INITIALIZATION_SUCCESS;
6062
} else {
@@ -64,7 +66,8 @@ static void on_initialization_complete(BLE::InitializationCompleteCallbackContex
6466
event_queue.break_dispatch();
6567
}
6668

67-
static void test_stack_initialization() {
69+
static void test_stack_initialization()
70+
{
6871
BLE &ble = BLE::Instance();
6972
ble.onEventsToProcess(process_ble_events);
7073
ble.init(on_initialization_complete);
@@ -102,14 +105,16 @@ Case cases[] = {
102105
Case("Test cordio stack reset sequence", test_stack_initialization),
103106
};
104107

105-
utest::v1::status_t greentea_test_setup(const size_t number_of_cases) {
108+
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
109+
{
106110
GREENTEA_SETUP(15, "default_auto");
107111
return verbose_test_setup_handler(number_of_cases);
108112
}
109113

110114
Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler);
111115

112-
int main() {
116+
int main()
117+
{
113118
return !Harness::run(specification);
114119
}
115120

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/doc/PortingGuide.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ At runtime, you can get stack parameters from the controller:
233233
**Example:**
234234

235235
```
236-
void HCIDriver::handle_reset_sequence(uint8_t *pMsg) {
236+
void HCIDriver::handle_reset_sequence(uint8_t *pMsg)
237+
{
237238
// only accept command complete event:
238239
if (*pMsg != HCI_CMD_CMPL_EVT) {
239240
return;
@@ -440,7 +441,8 @@ ble::CordioHCIDriver& ble_cordio_get_hci_driver();
440441
**Example:**
441442

442443
```
443-
ble::CordioHCIDriver& ble_cordio_get_hci_driver() {
444+
ble::CordioHCIDriver& ble_cordio_get_hci_driver()
445+
{
444446
static ble::vendor::target_name::TransportDriver transport_driver(
445447
/* transport parameters */
446448
);

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/driver/CordioHCIDriver.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ uint16_t CordioHCIDriver::write(uint8_t type, uint16_t len, uint8_t *pData)
286286
void CordioHCIDriver::on_host_stack_inactivity()
287287
{
288288
}
289-
void CordioHCIDriver::handle_test_end(bool success, uint16_t packets) {
289+
void CordioHCIDriver::handle_test_end(bool success, uint16_t packets)
290+
{
290291
if (_test_end_handler) {
291292
_test_end_handler(success, packets);
292293
_test_end_handler = nullptr;
@@ -364,7 +365,8 @@ ble_error_t CordioHCIDriver::rf_test_end()
364365
return BLE_ERROR_NO_MEM;
365366
}
366367

367-
ble_error_t CordioHCIDriver::set_tx_power(int8_t level_db) {
368+
ble_error_t CordioHCIDriver::set_tx_power(int8_t level_db)
369+
{
368370
return BLE_ERROR_NOT_IMPLEMENTED;
369371
}
370372

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/source/PalAttClientImpl.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ PalAttClient::~PalAttClient() {}
3535
/**
3636
* @see ble::PalAttClient::exchange_mtu_request
3737
*/
38-
ble_error_t PalAttClient::exchange_mtu_request(connection_handle_t connection) {
38+
ble_error_t PalAttClient::exchange_mtu_request(connection_handle_t connection)
39+
{
3940
AttcMtuReq(connection, pAttCfg->mtu);
4041
return BLE_ERROR_NONE;
4142
}
@@ -272,19 +273,22 @@ ble_error_t PalAttClient::execute_write_request(
272273
/**
273274
* @see ble::PalAttClient::initialize
274275
*/
275-
ble_error_t PalAttClient::initialize() {
276+
ble_error_t PalAttClient::initialize()
277+
{
276278
return BLE_ERROR_NONE;
277279
}
278280

279281
/**
280282
* @see ble::PalAttClient::terminate
281283
*/
282-
ble_error_t PalAttClient::terminate() {
284+
ble_error_t PalAttClient::terminate()
285+
{
283286
return BLE_ERROR_NONE;
284287
}
285288

286289
// singleton of the ARM Cordio client
287-
PalAttClient &PalAttClient::get_client() {
290+
PalAttClient &PalAttClient::get_client()
291+
{
288292
static PalAttClient _client;
289293
return _client;
290294
}
@@ -302,22 +306,25 @@ void PalAttClient::when_transaction_timeout(
302306
}
303307

304308
// convert an array of byte to an uint16_t
305-
uint16_t PalAttClient::to_uint16_t(const uint8_t *array) {
309+
uint16_t PalAttClient::to_uint16_t(const uint8_t *array)
310+
{
306311
uint16_t result;
307312
memcpy(&result, array, sizeof(result));
308313
return result;
309314
}
310315

311316
template<typename T>
312-
bool PalAttClient::event_handler(const attEvt_t *event) {
317+
bool PalAttClient::event_handler(const attEvt_t *event)
318+
{
313319
if (T::can_convert(event)) {
314320
generated_handler(event, T::convert);
315321
return true;
316322
}
317323
return false;
318324
}
319325

320-
bool PalAttClient::timeout_event_handler(const attEvt_t *event) {
326+
bool PalAttClient::timeout_event_handler(const attEvt_t *event)
327+
{
321328
if (event->hdr.status != ATT_ERR_TIMEOUT) {
322329
return false;
323330
}
@@ -362,7 +369,8 @@ void PalAttClient::on_transaction_timeout(
362369
}
363370
}
364371

365-
void PalAttClient::att_client_handler(const attEvt_t *event) {
372+
void PalAttClient::att_client_handler(const attEvt_t *event)
373+
{
366374
#if BLE_FEATURE_GATT_CLIENT
367375
if (event->hdr.status == ATT_SUCCESS && event->hdr.event == ATT_MTU_UPDATE_IND) {
368376
ble::BLEInstanceBase &ble = ble::BLEInstanceBase::deviceInstance();

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/source/PalGattClientImpl.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ PalGattClient::PalGattClient(PalAttClient& client) : _event_handler(nullptr), _c
3434
}
3535

3636

37-
ble_error_t PalGattClient::exchange_mtu(connection_handle_t connection) {
37+
ble_error_t PalGattClient::exchange_mtu(connection_handle_t connection)
38+
{
3839
return _client.exchange_mtu_request(connection);
3940
}
4041

@@ -221,12 +222,14 @@ ble_error_t PalGattClient::execute_write_queue(
221222
}
222223

223224

224-
ble_error_t PalGattClient::initialize() {
225+
ble_error_t PalGattClient::initialize()
226+
{
225227
return _client.initialize();
226228
}
227229

228230

229-
ble_error_t PalGattClient::terminate() {
231+
ble_error_t PalGattClient::terminate()
232+
{
230233
return _client.initialize();
231234
}
232235

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/source/PalGenericAccessServiceImpl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ namespace ble {
2222

2323
#if 0 // Disabled until reworked and reintroduced to GattServer API
2424

25-
virtual ble_error_t PalGenericAccessService::get_device_name_length(uint8_t& length) {
25+
virtual ble_error_t PalGenericAccessService::get_device_name_length(uint8_t& length)
26+
{
2627
#if BLE_FEATURE_GATT_SERVER
2728
const uint8_t* name = nullptr;
2829
uint16_t actual_length = 0;
@@ -112,7 +113,8 @@ ble_error_t PalGenericAccessService::set_peripheral_preferred_connection_paramet
112113

113114

114115
#if BLE_FEATURE_GATT_SERVER
115-
ble::GattServer& PalGenericAccessService::gatt_server() {
116+
ble::GattServer& PalGenericAccessService::gatt_server()
117+
{
116118
return ble::GattServer::getInstance();
117119
}
118120

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/source/PalSecurityManagerImpl.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ ble_error_t PalSecurityManager::send_keypress_notification(
550550

551551

552552

553-
ble_error_t PalSecurityManager::generate_secure_connections_oob() {
553+
ble_error_t PalSecurityManager::generate_secure_connections_oob()
554+
{
554555
uint8_t oobLocalRandom[SMP_RAND_LEN];
555556
SecRand(oobLocalRandom, SMP_RAND_LEN);
556557
DmSecCalcOobReq(oobLocalRandom, _public_key_x);
@@ -586,7 +587,8 @@ PalSecurityManager& PalSecurityManager::get_security_manager()
586587
}
587588

588589

589-
bool PalSecurityManager::sm_handler(const wsfMsgHdr_t* msg) {
590+
bool PalSecurityManager::sm_handler(const wsfMsgHdr_t* msg)
591+
{
590592
PalSecurityManager& self = get_security_manager();
591593
PalSecurityManagerEventHandler* handler = self.get_event_handler();
592594

@@ -957,7 +959,8 @@ void PalSecurityManager::queue_remove_device_from_resolving_list(
957959
}
958960

959961

960-
void PalSecurityManager::queue_clear_resolving_list() {
962+
void PalSecurityManager::queue_clear_resolving_list()
963+
{
961964
// Remove any pending control blocks, there's no point executing them as we're about to queue the list
962965
clear_privacy_control_blocks();
963966

@@ -973,7 +976,8 @@ void PalSecurityManager::queue_clear_resolving_list() {
973976
}
974977

975978

976-
void PalSecurityManager::clear_privacy_control_blocks() {
979+
void PalSecurityManager::clear_privacy_control_blocks()
980+
{
977981
while(_pending_privacy_control_blocks != nullptr)
978982
{
979983
PrivacyControlBlock* next = _pending_privacy_control_blocks->next();
@@ -1026,7 +1030,8 @@ void PalSecurityManager::process_privacy_control_blocks(bool cb_completed)
10261030
}
10271031

10281032

1029-
void PalSecurityManager::cleanup_peer_csrks() {
1033+
void PalSecurityManager::cleanup_peer_csrks()
1034+
{
10301035
for (size_t i = 0; i < DM_CONN_MAX; ++i) {
10311036
if (_peer_csrks[i]) {
10321037
delete _peer_csrks[i];
@@ -1040,7 +1045,8 @@ void PalSecurityManager::set_event_handler(PalSecurityManagerEventHandler *event
10401045
_pal_event_handler = event_handler;
10411046
}
10421047

1043-
PalSecurityManagerEventHandler* PalSecurityManager::get_event_handler() {
1048+
PalSecurityManagerEventHandler* PalSecurityManager::get_event_handler()
1049+
{
10441050
return _pal_event_handler;
10451051
}
10461052

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/source/PalSigningMonitorImpl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
namespace ble {
2424

25-
void PalSigningMonitor::set_signing_event_handler(SecurityManager *handler) {
25+
void PalSigningMonitor::set_signing_event_handler(SecurityManager *handler)
26+
{
2627
#if BLE_FEATURE_GATT_CLIENT
2728
BLEInstanceBase::deviceInstance().getGattClient().set_signing_event_handler(handler);
2829
#endif // BLE_FEATURE_GATT_CLIENT

connectivity/FEATURE_BLE/libraries/ble-api-implementation/source/GapImpl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2730,7 +2730,8 @@ void Gap::prepare_legacy_advertising_set()
27302730
_existing_sets.set(LEGACY_ADVERTISING_HANDLE);
27312731
}
27322732

2733-
void Gap::setEventHandler(Gap::EventHandler *handler) {
2733+
void Gap::setEventHandler(Gap::EventHandler *handler)
2734+
{
27342735
_event_handler = handler;
27352736
}
27362737

0 commit comments

Comments
 (0)