8000 Fix codestyle in recent changes by toxuin · Pull Request #702 · nkolban/esp32-snippets · GitHub
[go: up one dir, main page]

Skip to content

Fix codestyle in recent changes #702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
.project
.cproject
.settings/
/esp32-snippets/.vs

# IDEs
.vs/
.idea/

# CMake
cmake-build-debug/
2 changes: 1 addition & 1 deletion cpp_utils/BLESecurity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: chegewara
*/

#include <BLESecurity.h>
#include "BLESecurity.h"
#include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED)

Expand Down
2 changes: 1 addition & 1 deletion cpp_utils/BLEServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ BLEService* BLEServer::getServiceByUUID(BLEUUID uuid) {
* @return The amount of registered services
*/
int BLEServer::getServiceCount(bool includeDefaultServices) {
if(includeDefaultServices){
if (includeDefaultServices) {
return m_serviceMap.getRegisteredServiceCount() + 2;
}
return m_serviceMap.getRegisteredServiceCount();
Expand Down
26 changes: 10 additions & 16 deletions cpp_utils/BLEServiceMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* @return The characteristic.
*/
BLEService* BLEServiceMap::getByUUID(const char* uuid) {
return getByUUID(BLEUUID(uuid));
return getByUUID(BLEUUID(uuid));
}

/**
* @brief Return the service by UUID.
* @param [in] UUID The UUID to look up the service.
Expand Down Expand Up @@ -52,9 +52,8 @@ BLEService* BLEServiceMap::getByHandle(uint16_t handle) {
* @param [in] characteristic The service to cache.
* @return N/A.
*/
void BLEServiceMap::setByUUID(BLEUUID uuid,
BLEService *service) {
m_uuidMap.insert(std::pair<BLEService *, std::string>(service, uuid.toString()));
void BLEServiceMap::setByUUID(BLEUUID uuid, BLEService* service) {
m_uuidMap.insert(std::pair<BLEService*, std::string>(service, uuid.toString()));
} // setByUUID


Expand All @@ -64,9 +63,8 @@ void BLEServiceMap::setByUUID(BLEUUID uuid,
* @param [in] service The service to cache.
* @return N/A.
*/
void BLEServiceMap::setByHandle(uint16_t handle,
BLEService* service) {
m_handleMap.insert(std::pair<uint16_t, BLEService *>(handle, service));
void BLEServiceMap::setByHandle(uint16_t handle, BLEService* service) {
m_handleMap.insert(std::pair<uint16_t, BLEService*>(handle, service));
} // setByHandle


Expand All @@ -86,7 +84,7 @@ std::string BLEServiceMap::toString() {
void BLEServiceMap::handleGATTServerEvent(
esp_gatts_cb_event_t event,
esp_gatt_if_t gatts_if,
esp_ble_gatts_cb_param_t *param) {
esp_ble_gatts_cb_param_t* param) {
// Invoke the handler for every Service we have.
for (auto &myPair : m_uuidMap) {
myPair.first->handleGATTServerEvent(event, gatts_if, param);
Expand All @@ -99,9 +97,7 @@ void BLEServiceMap::handleGATTServerEvent(
*/
BLEService* BLEServiceMap::getFirst() {
m_iterator = m_uuidMap.begin();
if (m_iterator == m_uuidMap.end()) {
return nullptr;
}
if (m_iterator == m_uuidMap.end()) return nullptr;
BLEService* pRet = m_iterator->first;
m_iterator++;
return pRet;
Expand All @@ -112,9 +108,7 @@ BLEService* BLEServiceMap::getFirst() {
* @return The next service in the map.
*/
BLEService* BLEServiceMap::getNext() {
if (m_iterator == m_uuidMap.end()) {
return nullptr;
}
if (m_iterator == m_uuidMap.end()) return nullptr;
BLEService* pRet = m_iterator->first;
m_iterator++;
return pRet;
Expand All @@ -124,7 +118,7 @@ BLEService* BLEServiceMap::getNext() {
* @brief Removes service from maps.
* @return N/A.
*/
void BLEServiceMap::removeService(BLEService *service){
void BLEServiceMap::removeService(BLEService* service) {
m_handleMap.erase(service->getHandle());
m_uuidMap.erase(service);
} // removeService
Expand Down
2 changes: 1 addition & 1 deletion cpp_utils/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <GeneralUtils.h>
#include "GeneralUtils.h"

static const char* LOG_TAG = "File";
/**
Expand Down
4 changes: 2 additions & 2 deletions cpp_utils/GeneralUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <string>
#include <sstream>
#include <iomanip>
#include <FreeRTOS.h>
#include "FreeRTOS.h"
#include <esp_err.h>
#include <nvs.h>
#include <esp_wifi.h>
Expand Down Expand Up @@ -440,7 +440,7 @@ const char* GeneralUtils::errorToString(esp_err_t errCode) {
* @brief Convert a wifi_err_reason_t code to a string.
* @param [in] errCode The errCode to be converted.
* @return A string representation of the error code.
*
*
* @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.
*/
const char* GeneralUtils::wifiErrorToString(uint8_t errCode) {
Expand Down
4 changes: 2 additions & 2 deletions cpp_utils/MFRC522.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#include "MFRC522.h"
#include "MFRC522Debug.h"
#include <FreeRTOS.h>
#include <GPIO.h>
#include "FreeRTOS.h"
#include "GPIO.h"
#include <string.h>
#include <sstream>
#include <iomanip>
Expand Down
4 changes: 2 additions & 2 deletions cpp_utils/SockServ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

#include <errno.h>
#include <esp_log.h>
#include <FreeRTOS.h>
#include <freertos/FreeRTOS.h>
#include <freertos/queue.h>

#include <stdint.h>

#include <string.h>
#include <string>

#include "sdkconfig.h"
#include "FreeRTOS.h"
#include "SockServ.h"
#include "Socket.h"

Expand Down
6 changes: 3 additions & 3 deletions cpp_utils/TFTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

#include "TFTP.h"
#include <esp_log.h>
#include <FreeRTOS.h>
#include <GeneralUtils.h>
#include "FreeRTOS.h"
#include "GeneralUtils.h"
#include <string>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <Socket.h>
#include "Socket.h"

#include "sdkconfig.h"

Expand Down
0