Skip to content

Commit 47563cb

Browse files
committed
Fix codestyle
1 parent e742546 commit 47563cb

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
.project
22
.cproject
33
.settings/
4-
/esp32-snippets/.vs
4+
5+
# IDEs
6+
.vs/
7+
.idea/
8+
9+
# CMake
10+
cmake-build-debug/

cpp_utils/BLEServer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ BLEService* BLEServer::getServiceByUUID(BLEUUID uuid) {
121121
* @return The amount of registered services
122122
*/
123123
int BLEServer::getServiceCount(bool includeDefaultServices) {
124-
if(includeDefaultServices){
124+
if (includeDefaultServices) {
125125
return m_serviceMap.getRegisteredServiceCount() + 2;
126126
}
127127
return m_serviceMap.getRegisteredServiceCount();

cpp_utils/BLEServiceMap.cpp

+10-16
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
* @return The characteristic.
1818
*/
1919
BLEService* BLEServiceMap::getByUUID(const char* uuid) {
20-
return getByUUID(BLEUUID(uuid));
20+
return getByUUID(BLEUUID(uuid));
2121
}
22-
22+
2323
/**
2424
* @brief Return the service by UUID.
2525
* @param [in] UUID The UUID to look up the service.
@@ -52,9 +52,8 @@ BLEService* BLEServiceMap::getByHandle(uint16_t handle) {
5252
* @param [in] characteristic The service to cache.
5353
* @return N/A.
5454
*/
55-
void BLEServiceMap::setByUUID(BLEUUID uuid,
56-
BLEService *service) {
57-
m_uuidMap.insert(std::pair<BLEService *, std::string>(service, uuid.toString()));
55+
void BLEServiceMap::setByUUID(BLEUUID uuid, BLEService* service) {
56+
m_uuidMap.insert(std::pair<BLEService*, std::string>(service, uuid.toString()));
5857
} // setByUUID
5958

6059

@@ -64,9 +63,8 @@ void BLEServiceMap::setByUUID(BLEUUID uuid,
6463
* @param [in] service The service to cache.
6564
* @return N/A.
6665
*/
67-
void BLEServiceMap::setByHandle(uint16_t handle,
68-
BLEService* service) {
69-
m_handleMap.insert(std::pair<uint16_t, BLEService *>(handle, service));
66+
void BLEServiceMap::setByHandle(uint16_t handle, BLEService* service) {
67+
m_handleMap.insert(std::pair<uint16_t, BLEService*>(handle, service));
7068
} // setByHandle
7169

7270

@@ -86,7 +84,7 @@ std::string BLEServiceMap::toString() {
8684
void BLEServiceMap::handleGATTServerEvent(
8785
esp_gatts_cb_event_t event,
8886
esp_gatt_if_t gatts_if,
89-
esp_ble_gatts_cb_param_t *param) {
87+
esp_ble_gatts_cb_param_t* param) {
9088
// Invoke the handler for every Service we have.
9189
for (auto &myPair : m_uuidMap) {
9290
myPair.first->handleGATTServerEvent(event, gatts_if, param);
@@ -99,9 +97,7 @@ void BLEServiceMap::handleGATTServerEvent(
9997
*/
10098
BLEService* BLEServiceMap::getFirst() {
10199
m_iterator = m_uuidMap.begin();
102-
if (m_iterator == m_uuidMap.end()) {
103-
return nullptr;
104-
}
100+
if (m_iterator == m_uuidMap.end()) return nullptr;
105101
BLEService* pRet = m_iterator->first;
106102
m_iterator++;
107103
return pRet;
@@ -112,9 +108,7 @@ BLEService* BLEServiceMap::getFirst() {
112108
* @return The next service in the map.
113109
*/
114110
BLEService* BLEServiceMap::getNext() {
115-
if (m_iterator == m_uuidMap.end()) {
116-
return nullptr;
117-
}
111+
if (m_iterator == m_uuidMap.end()) return nullptr;
118112
BLEService* pRet = m_iterator->first;
119113
m_iterator++;
120114
return pRet;
@@ -124,7 +118,7 @@ BLEService* BLEServiceMap::getNext() {
124118
* @brief Removes service from maps.
125119
* @return N/A.
126120
*/
127-
void BLEServiceMap::removeService(BLEService *service){
121+
void BLEServiceMap::removeService(BLEService* service) {
128122
m_handleMap.erase(service->getHandle());
129123
m_uuidMap.erase(service);
130124
} // removeService

0 commit comments

Comments
 (0)