8000 Merge pull request #702 from toxuin/code-cleanup · usmandroid/esp32-snippets@7222d19 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7222d19

Browse files
authored
Merge pull request nkolban#702 from toxuin/code-cleanup
Fix codestyle in recent changes
2 parents e742546 + 125ceb3 commit 7222d19

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
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/BLESecurity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Author: chegewara
66
*/
77

8-
#include <BLESecurity.h>
8+
#include "BLESecurity.h"
99
#include "sdkconfig.h"
1010
#if defined(CONFIG_BT_ENABLED)
1111

cpp_utils/BLEServer.cpp

Lines changed: 1 addition & 1 deletion
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

Lines changed: 10 additions & 16 deletions
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

cpp_utils/File.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <string>
1212
#include <stdlib.h>
1313
#include <stdio.h>
14-
#include <GeneralUtils.h>
14+
#include "GeneralUtils.h"
1515

1616
static const char* LOG_TAG = "File";
1717
/**

cpp_utils/GeneralUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <string>
1414
#include <sstream>
1515
#include <iomanip>
16-
#include <FreeRTOS.h>
16+
#include < F438 span class="pl-pds x x-first x-last">"FreeRTOS.h"
1717
#include <esp_err.h>
1818
#include <nvs.h>
1919
#include <esp_wifi.h>
@@ -440,7 +440,7 @@ const char* GeneralUtils::errorToString(esp_err_t errCode) {
440440
* @brief Convert a wifi_err_reason_t code to a string.
441441
* @param [in] errCode The errCode to be converted.
442442
* @return A string representation of the error code.
443-
*
443+
*
444444
* @note: wifi_err_reason_t values as of April 2018 are: (1-24, 200-204) and are defined in ~/esp-idf/components/esp32/include/esp_wifi_types.h.
445445
*/
446446
const char* GeneralUtils::wifiErrorToString(uint8_t errCode) {

cpp_utils/MFRC522.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#include "MFRC522.h"
2020
#include "MFRC522Debug.h"
21-
#include <FreeRTOS.h>
22-
#include <GPIO.h>
21+
#include "FreeRTOS.h"
22+
#include "GPIO.h"
2323
#include <string.h>
2424
#include <sstream>
2525
#include <iomanip>

cpp_utils/SockServ.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
#include <errno.h>
99
#include <esp_log.h>
10-
#include <FreeRTOS.h>
1110
#include <freertos/FreeRTOS.h>
1211
#include <freertos/queue.h>
13-
1412
#include <stdint.h>
13+
1514
#include <string.h>
1615
#include <string>
1716

1817
#include "sdkconfig.h"
18+
#include "FreeRTOS.h"
1919
#include "SockServ.h"
2020
#include "Socket.h"
2121

cpp_utils/TFTP.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
#include "TFTP.h"
1111
#include <esp_log.h>
12-
#include <FreeRTOS.h>
13-
#include <GeneralUtils.h>
12+
#include "FreeRTOS.h"
13+
#include "GeneralUtils.h"
1414
#include <string>
1515
#include <stdio.h>
1616
#include <errno.h>
1717
#include <string.h>
18-
#include <Socket.h>
18+
#include "Socket.h"
1919

2020
#include "sdkconfig.h"
2121

0 commit comments

Comments
 (0)
0