diff --git a/.gitignore b/.gitignore index 099e1f7c..15d2ae94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ .project .cproject .settings/ -/esp32-snippets/.vs + +# IDEs +.vs/ +.idea/ + +# CMake +cmake-build-debug/ diff --git a/cpp_utils/BLESecurity.cpp b/cpp_utils/BLESecurity.cpp index 114f630d..921f5424 100644 --- a/cpp_utils/BLESecurity.cpp +++ b/cpp_utils/BLESecurity.cpp @@ -5,7 +5,7 @@ * Author: chegewara */ -#include +#include "BLESecurity.h" #include "sdkconfig.h" #if defined(CONFIG_BT_ENABLED) diff --git a/cpp_utils/BLEServer.cpp b/cpp_utils/BLEServer.cpp index b40cd345..e5c675b8 100755 --- a/cpp_utils/BLEServer.cpp +++ b/cpp_utils/BLEServer.cpp @@ -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(); diff --git a/cpp_utils/BLEServiceMap.cpp b/cpp_utils/BLEServiceMap.cpp index aa371f47..c749be16 100755 --- a/cpp_utils/BLEServiceMap.cpp +++ b/cpp_utils/BLEServiceMap.cpp @@ -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. @@ -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(service, uuid.toString())); +void BLEServiceMap::setByUUID(BLEUUID uuid, BLEService* service) { + m_uuidMap.insert(std::pair(service, uuid.toString())); } // setByUUID @@ -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(handle, service)); +void BLEServiceMap::setByHandle(uint16_t handle, BLEService* service) { + m_handleMap.insert(std::pair(handle, service)); } // setByHandle @@ -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); @@ -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; @@ -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; @@ -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 diff --git a/cpp_utils/File.cpp b/cpp_utils/File.cpp index 3b245a85..3ac4672f 100644 --- a/cpp_utils/File.cpp +++ b/cpp_utils/File.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include "GeneralUtils.h" static const char* LOG_TAG = "File"; /** diff --git a/cpp_utils/GeneralUtils.cpp b/cpp_utils/GeneralUtils.cpp index 80c5cc6e..8d58d4eb 100644 --- a/cpp_utils/GeneralUtils.cpp +++ b/cpp_utils/GeneralUtils.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include "FreeRTOS.h" #include #include #include @@ -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) { diff --git a/cpp_utils/MFRC522.cpp b/cpp_utils/MFRC522.cpp index 4082d4ac..17ca1754 100644 --- a/cpp_utils/MFRC522.cpp +++ b/cpp_utils/MFRC522.cpp @@ -18,8 +18,8 @@ #include "MFRC522.h" #include "MFRC522Debug.h" -#include -#include +#include "FreeRTOS.h" +#include "GPIO.h" #include #include #include diff --git a/cpp_utils/SockServ.cpp b/cpp_utils/SockServ.cpp index 38ecc823..020ed096 100644 --- a/cpp_utils/SockServ.cpp +++ b/cpp_utils/SockServ.cpp @@ -7,15 +7,15 @@ #include #include -#include #include #include - #include + #include #include #include "sdkconfig.h" +#include "FreeRTOS.h" #include "SockServ.h" #include "Socket.h" diff --git a/cpp_utils/TFTP.cpp b/cpp_utils/TFTP.cpp index d554bd45..b1591a9f 100644 --- a/cpp_utils/TFTP.cpp +++ b/cpp_utils/TFTP.cpp @@ -9,13 +9,13 @@ #include "TFTP.h" #include -#include -#include +#include "FreeRTOS.h" +#include "GeneralUtils.h" #include #include #include #include -#include +#include "Socket.h" #include "sdkconfig.h"