From f0006a04aa8764884c99a0d21d0060eca221d37a Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann <19662702+JohannesKauffmann@users.noreply.github.com> Date: Sun, 31 Jul 2022 22:27:40 +0000 Subject: [PATCH 1/6] MessageRouter: Remove trailing semicolon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [35/90] Building CXX object src/CMakeFiles/EIPScanner.dir/MessageRouter.cpp.obj /EIPScanner/src/MessageRouter.cpp:27:7: warning: extra ‘;’ [-Wpedantic] 27 | {}; | ^ --- src/MessageRouter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MessageRouter.cpp b/src/MessageRouter.cpp index 16f2232..4bd859b 100644 --- a/src/MessageRouter.cpp +++ b/src/MessageRouter.cpp @@ -24,7 +24,7 @@ namespace eipScanner { MessageRouter::MessageRouter(bool use_8_bit_path_segments) : _use_8_bit_path_segments(use_8_bit_path_segments) - {}; + {} MessageRouter::~MessageRouter() = default; From 32035b973cbbdb6fe6a74051e10b9b8468c3af4f Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann <19662702+JohannesKauffmann@users.noreply.github.com> Date: Sun, 31 Jul 2022 22:30:25 +0000 Subject: [PATCH 2/6] Fixed unused parameters/variables warnings Remove the void cast and unname them instead, per C++ Core Guidelines: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f9-unused-parameters-should-be-unnamed For the assert, use the maybe_unused attribute. --- src/ConnectionManager.cpp | 8 ++------ src/fileObject/FileObjectEmptyState.cpp | 7 ++----- src/fileObject/FileObjectLoadedState.cpp | 2 +- src/fileObject/FileObjectNonExistentState.cpp | 7 ++----- src/fileObject/FileObjectState.cpp | 7 ++----- src/fileObject/FileObjectUploadInProgressState.cpp | 4 +--- 6 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/ConnectionManager.cpp b/src/ConnectionManager.cpp index a4c76a2..b3d00d1 100644 --- a/src/ConnectionManager.cpp +++ b/src/ConnectionManager.cpp @@ -196,8 +196,7 @@ namespace eipScanner { << ". But the connection is removed from ConnectionManager anyway"; } - auto rc = _connectionMap.erase(ptr->_t2oNetworkConnectionId); - (void) rc; + [[maybe_unused]] auto rc = _connectionMap.erase(ptr->_t2oNetworkConnectionId); assert(rc); } else { Logger(LogLevel::WARNING) << "Attempt to close an already closed connection"; @@ -207,8 +206,6 @@ namespace eipScanner { void ConnectionManager::handleConnections(std::chrono::milliseconds timeout) { std::vector sockets; std::transform(_socketMap.begin(), _socketMap.end(), std::back_inserter(sockets), [](auto entry) { - auto fd = entry.second->getSocketFd(); - (void) fd; return entry.second; }); @@ -231,8 +228,7 @@ namespace eipScanner { if (socket == _socketMap.end()) { auto newSocket = std::make_shared(endPoint); _socketMap[endPoint] = newSocket; - newSocket->setBeginReceiveHandler([](sockets::BaseSocket& sock) { - (void) sock; + newSocket->setBeginReceiveHandler([](sockets::BaseSocket&) { Logger(LogLevel::DEBUG) << "Received something"; }); diff --git a/src/fileObject/FileObjectEmptyState.cpp b/src/fileObject/FileObjectEmptyState.cpp index a234485..ac19b06 100644 --- a/src/fileObject/FileObjectEmptyState.cpp +++ b/src/fileObject/FileObjectEmptyState.cpp @@ -12,14 +12,11 @@ namespace fileObject { : FileObjectState(FileObjectStateCodes::FILE_EMPTY, owner, objectId, messageRouter) { } - void FileObjectEmptyState::initiateUpload(SessionInfoIf::SPtr si, EndUploadHandler handle) { - (void) si; - (void) handle; + void FileObjectEmptyState::initiateUpload(SessionInfoIf::SPtr, EndUploadHandler) { logWithStateName(LogLevel::WARNING, "File cannot be uploaded"); } - bool FileObjectEmptyState::transfer(SessionInfoIf::SPtr si) { - (void) si; + bool FileObjectEmptyState::transfer(SessionInfoIf::SPtr) { logWithStateName(LogLevel::WARNING, "Nothing to transfer"); return false; } diff --git a/src/fileObject/FileObjectLoadedState.cpp b/src/fileObject/FileObjectLoadedState.cpp index f078943..dbd2a53 100644 --- a/src/fileObject/FileObjectLoadedState.cpp +++ b/src/fileObject/FileObjectLoadedState.cpp @@ -39,7 +39,7 @@ namespace fileObject { } } - bool FileObjectLoadedState::transfer(SessionInfoIf::SPtr si) { + bool FileObjectLoadedState::transfer(SessionInfoIf::SPtr) { return false; } } diff --git a/src/fileObject/FileObjectNonExistentState.cpp b/src/fileObject/FileObjectNonExistentState.cpp index 6215269..06b732e 100644 --- a/src/fileObject/FileObjectNonExistentState.cpp +++ b/src/fileObject/FileObjectNonExistentState.cpp @@ -13,15 +13,12 @@ namespace fileObject { : FileObjectState(FileObjectStateCodes::NONEXISTENT, owner, objectId, messageRouter) { } - void FileObjectNonExistentState::initiateUpload(SessionInfoIf::SPtr si, EndUploadHandler handle) { - (void) si; - (void) handle; + void FileObjectNonExistentState::initiateUpload(SessionInfoIf::SPtr, EndUploadHandler) { logWithStateName(LogLevel::WARNING, "File cannot be uploaded"); } - bool FileObjectNonExistentState::transfer(SessionInfoIf::SPtr si) { - (void) si; + bool FileObjectNonExistentState::transfer(SessionInfoIf::SPtr) { logWithStateName(LogLevel::WARNING, "Nothing to transfer"); return false; diff --git a/src/fileObject/FileObjectState.cpp b/src/fileObject/FileObjectState.cpp index 84d4bc2..96bc733 100644 --- a/src/fileObject/FileObjectState.cpp +++ b/src/fileObject/FileObjectState.cpp @@ -89,14 +89,11 @@ namespace fileObject { } } - void FileObjectState::initiateUpload(SessionInfoIf::SPtr si, EndUploadHandler handle) { - (void) si; - (void) handle; + void FileObjectState::initiateUpload(SessionInfoIf::SPtr, EndUploadHandler) { logWithStateName(LogLevel::ERROR, "Not implemented call"); } - bool FileObjectState::transfer(SessionInfoIf::SPtr si) { - (void) si; + bool FileObjectState::transfer(SessionInfoIf::SPtr) { logWithStateName(LogLevel::ERROR, "Not implemented call"); return false; } diff --git a/src/fileObject/FileObjectUploadInProgressState.cpp b/src/fileObject/FileObjectUploadInProgressState.cpp index 0054a26..0b6d941 100644 --- a/src/fileObject/FileObjectUploadInProgressState.cpp +++ b/src/fileObject/FileObjectUploadInProgressState.cpp @@ -24,9 +24,7 @@ namespace fileObject { } void - FileObjectUploadInProgressState::initiateUpload(SessionInfoIf::SPtr si, EndUploadHandler handle) { - (void) si; - (void) handle; + FileObjectUploadInProgressState::initiateUpload(SessionInfoIf::SPtr, EndUploadHandler) { logWithStateName(LogLevel::INFO, "Initiate upload of file again"); //TODO: Implement } From f3aecbbe499b5c3fb0b4385f79dffbeee1ca9685 Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann <19662702+JohannesKauffmann@users.noreply.github.com> Date: Sun, 31 Jul 2022 22:34:31 +0000 Subject: [PATCH 3/6] Prevent copy of sockaddr_in when calling getAddr() Visual Studio generated a note about this (lnt-accidental-copy). UDPBoundSocket.cpp's usage of getAddr() has been left untouched, as to not change behaviour there (it writes to the value returned by getAddr()). --- src/sockets/TCPSocket.cpp | 2 +- src/sockets/UDPSocket.cpp | 2 +- src/utils/Buffer.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sockets/TCPSocket.cpp b/src/sockets/TCPSocket.cpp index 3869a2d..b166707 100644 --- a/src/sockets/TCPSocket.cpp +++ b/src/sockets/TCPSocket.cpp @@ -53,7 +53,7 @@ namespace eipScanner { Logger(LogLevel::DEBUG) << "Connecting to " << _remoteEndPoint.toString(); try { - auto addr = _remoteEndPoint.getAddr(); + const auto& addr = _remoteEndPoint.getAddr(); auto res = connect(_sockedFd, (struct sockaddr *) &addr, sizeof(addr)); if (res < 0) { if (BaseSocket::getLastError() == EIPSCANNER_SOCKET_ERROR(EINPROGRESS)) { diff --git a/src/sockets/UDPSocket.cpp b/src/sockets/UDPSocket.cpp index eab6ea4..9344c58 100644 --- a/src/sockets/UDPSocket.cpp +++ b/src/sockets/UDPSocket.cpp @@ -46,7 +46,7 @@ namespace sockets { void UDPSocket::Send(const std::vector &data) const { Logger(LogLevel::TRACE) << "Send " << data.size() << " bytes from UDP socket #" << _sockedFd << "."; - auto addr = _remoteEndPoint.getAddr(); + const auto& addr = _remoteEndPoint.getAddr(); int count = sendto(_sockedFd, (char*)data.data(), data.size(), 0, (struct sockaddr *)&addr, sizeof(addr)); if (count < data.size()) { diff --git a/src/utils/Buffer.cpp b/src/utils/Buffer.cpp index 0e3ed2a..2ac11f5 100644 --- a/src/utils/Buffer.cpp +++ b/src/utils/Buffer.cpp @@ -179,7 +179,7 @@ Buffer &Buffer::operator<<(float val) { Buffer &Buffer::operator<<(sockets::EndPoint v) { std::vector zeros(8); - sockaddr_in addr = v.getAddr(); + const auto& addr = v.getAddr(); return *this << htons(static_cast(addr.sin_family)) << addr.sin_port << uint32_t(addr.sin_addr.s_addr) From 23eec082942762fefa0eddfc848324fb7348b0cb Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann <19662702+JohannesKauffmann@users.noreply.github.com> Date: Sun, 31 Jul 2022 22:39:02 +0000 Subject: [PATCH 4/6] Fix some Wsign-compare warnings To avoid creating a new warning in DiscoveryManager.cpp, use static_cast. The IdentityObject takes a CipUint anyway. On Windows, setsocktopt() with SO_RCVTIMEO takes a uint32_t, but std::chrono::duration::count() returnes a "signed integer type of at least 45 bits" [1], so it also produces a warning. [1]. https://en.cppreference.com/w/cpp/chrono/duration --- src/DiscoveryManager.cpp | 4 ++-- src/cip/EPath.cpp | 2 +- src/sockets/BaseSocket.cpp | 2 +- src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DiscoveryManager.cpp b/src/DiscoveryManager.cpp index f8a118a..3ca397e 100644 --- a/src/DiscoveryManager.cpp +++ b/src/DiscoveryManager.cpp @@ -48,7 +48,7 @@ namespace eipScanner { CommonPacket commonPacket; commonPacket.expand(std::vector(data.begin()+EncapsPacket::HEADER_SIZE, data.end())); - for (int i=0; i < commonPacket.getItems().size(); ++i) { + for (size_t i = 0; i < commonPacket.getItems().size(); ++i) { Buffer buffer(commonPacket.getItems()[i].getData()); CipUint ignore; sockets::EndPoint socketAddr("", 0); @@ -65,7 +65,7 @@ namespace eipScanner { >> revision >> status >> serialNumber >> productName; - IdentityObject identityObject(i); + IdentityObject identityObject(static_cast(i)); identityObject.setVendorId(vendorId); identityObject.setDeviceType(deviceType); identityObject.setProductCode(productCode); diff --git a/src/cip/EPath.cpp b/src/cip/EPath.cpp index 447ef30..52f6667 100644 --- a/src/cip/EPath.cpp +++ b/src/cip/EPath.cpp @@ -132,7 +132,7 @@ namespace cip { _attributeId = 0; _size = 0; - for (int i = 0; i < data.size() && !buffer.empty(); ++i) { + for (size_t i = 0; i < data.size() && !buffer.empty(); ++i) { EPathSegmentTypes segmentType; CipUsint ignore = 0; CipUsint byte; diff --git a/src/sockets/BaseSocket.cpp b/src/sockets/BaseSocket.cpp index efb71db..ae525a8 100644 --- a/src/sockets/BaseSocket.cpp +++ b/src/sockets/BaseSocket.cpp @@ -79,7 +79,7 @@ namespace sockets { _recvTimeout = recvTimeout; #if defined(_WIN32) || defined(WIN32) || defined(_WIN64) - uint32_t ms = recvTimeout.count(); + auto ms = uint32_t(recvTimeout.count()); setsockopt(_sockedFd, SOL_SOCKET, SO_RCVTIMEO, (const char*)&ms, sizeof ms); #else timeval tv = makePortableInterval(recvTimeout); diff --git a/src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp b/src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp index db26946..7d5aa17 100644 --- a/src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp +++ b/src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp @@ -102,7 +102,7 @@ namespace cip { _attributeId = 0; _size = 0; - for (int i = 0; i < data.size() && !buffer.empty(); ++i) { + for (size_t i = 0; i < data.size() && !buffer.empty(); ++i) { EPathSegmentTypes segmentType; CipUsint ignore = 0; CipUsint byte; From 7d14b811ae9f997f4b33652a78e7f0548143361b Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann <19662702+JohannesKauffmann@users.noreply.github.com> Date: Mon, 1 Aug 2022 21:20:08 +0000 Subject: [PATCH 5/6] Group headers, add newlines, formatting Headers are now grouped using a newline, ranging from standard library, to external (GTest) headers, and finally our own headers. Commented out and duplicate #includes removed. Removed "private" immediately followed by "public". Also added a newline to the last line of every file. --- src/BaseObject.cpp | 2 +- src/ConnectionManager.cpp | 1 + src/ConnectionManager.h | 1 + src/DiscoveryManager.cpp | 1 + src/FileObject.cpp | 4 +++- src/IOConnection.h | 1 + src/MessageRouter.cpp | 1 + src/MessageRouter.h | 1 + src/ParameterObject.h | 2 ++ src/SessionInfo.cpp | 2 +- src/SessionInfoIf.h | 2 ++ src/cip/CipRevision.cpp | 3 ++- src/cip/CipRevision.h | 1 + src/cip/CipString.cpp | 3 ++- src/cip/CipString.h | 1 + src/cip/EPath.cpp | 2 ++ src/cip/EPath.h | 5 +++-- src/cip/GeneralStatusCodes.h | 1 + src/cip/MessageRouterRequest.cpp | 2 +- src/cip/MessageRouterRequest.h | 1 - src/cip/MessageRouterResponse.cpp | 2 ++ src/cip/Types.h | 1 + src/cip/connectionManager/ConnectionParameters.h | 1 + src/cip/connectionManager/ForwardCloseRequest.cpp | 1 + src/cip/connectionManager/ForwardCloseRequest.h | 2 ++ src/cip/connectionManager/ForwardOpenRequest.cpp | 6 +++--- src/cip/connectionManager/ForwardOpenRequest.h | 2 ++ src/cip/connectionManager/ForwardOpenResponse.cpp | 2 +- src/cip/connectionManager/ForwardOpenResponse.h | 1 + src/cip/connectionManager/LargeForwardOpenRequest.cpp | 6 +++--- src/cip/connectionManager/LargeForwardOpenRequest.h | 2 ++ .../NetworkConnectionParametersBuilder.cpp | 6 +++--- .../NetworkConnectionParametersBuilder.h | 1 + src/cip/connectionManager/NetworkConnectionParams.h | 1 + src/eip/CommonPacket.cpp | 4 +++- src/eip/CommonPacketItem.h | 3 +-- src/eip/CommonPacketItemFactory.cpp | 2 +- src/eip/CommonPacketItemFactory.h | 2 ++ src/eip/EncapsPacket.cpp | 3 ++- src/eip/EncapsPacket.h | 4 ---- src/eip/EncapsPacketFactory.cpp | 2 +- src/eip/EncapsPacketFactory.h | 2 -- src/fileObject/FileObjectEmptyState.cpp | 1 + src/fileObject/FileObjectLoadedState.cpp | 2 +- src/fileObject/FileObjectNonExistentState.h | 1 + src/fileObject/FileObjectState.cpp | 1 + src/fileObject/FileObjectState.h | 1 + src/fileObject/FileObjectUploadInProgressState.h | 1 + src/sockets/BaseSocket.cpp | 1 - src/sockets/BaseSocket.h | 1 - src/sockets/EndPoint.cpp | 8 ++++---- src/sockets/EndPoint.h | 1 + src/sockets/TCPSocket.h | 3 ++- src/sockets/UDPBoundSocket.cpp | 3 --- src/sockets/UDPBoundSocket.h | 4 ++-- src/sockets/UDPSocket.h | 4 ++-- src/utils/Buffer.h | 2 ++ src/utils/Logger.cpp | 3 ++- src/vendor/ra/powerFlex525/DPIFaultCode.cpp | 2 +- src/vendor/ra/powerFlex525/DPIFaultManager.h | 1 + src/vendor/ra/powerFlex525/DPIFaultObject.h | 1 + src/vendor/ra/powerFlex525/DPIFaultParameter.cpp | 4 +--- src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp | 1 + src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp | 1 + src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.h | 1 + test/Mocks.h | 1 + test/TestDiscoveryManager.cpp | 2 +- test/TestIdentityObject.cpp | 1 + test/TestMessageRouter.cpp | 3 ++- test/TestParameterObject.cpp | 3 ++- test/cip/TestCipRevision.cpp | 3 ++- test/cip/TestCipString.cpp | 3 ++- test/cip/TestEPath.cpp | 3 ++- test/cip/TestMessageRouterResponse.cpp | 1 + test/eip/TestCommonPacket.cpp | 3 ++- test/eip/TestCommonPacketItem.cpp | 1 + test/eip/TestCommonPacketItemFactory.cpp | 3 ++- test/eip/TestEncapsPacket.cpp | 3 ++- test/eip/TestEncapsPacketFactory.cpp | 4 +++- test/fileObject/Mocks.h | 2 ++ test/fileObject/TestFileObjectLoadedState.cpp | 3 ++- test/fileObject/TestFileObjectUploadInProgressState.cpp | 1 + test/sockets/TestEndPoint.cpp | 3 ++- test/test.cpp | 3 ++- test/utils/TestBuffer.cpp | 3 ++- test/vendor/ra/powerFlex525/TestDPIFaultManager.cpp | 3 ++- test/vendor/ra/powerFlex525/TestDPIFaultObject.cpp | 3 ++- test/vendor/ra/powerFlex525/TestDPIFaultParameter.cpp | 3 ++- 88 files changed, 131 insertions(+), 68 deletions(-) diff --git a/src/BaseObject.cpp b/src/BaseObject.cpp index 1fa3e48..9567fcc 100644 --- a/src/BaseObject.cpp +++ b/src/BaseObject.cpp @@ -18,4 +18,4 @@ namespace eipScanner { cip::CipUint BaseObject::getInstanceId() const { return _instanceId; } -} \ No newline at end of file +} diff --git a/src/ConnectionManager.cpp b/src/ConnectionManager.cpp index b3d00d1..19b277b 100644 --- a/src/ConnectionManager.cpp +++ b/src/ConnectionManager.cpp @@ -1,6 +1,7 @@ // // Created by Aleksey Timin on 11/18/19. // + #include #include #include diff --git a/src/ConnectionManager.h b/src/ConnectionManager.h index a317067..9deed18 100644 --- a/src/ConnectionManager.h +++ b/src/ConnectionManager.h @@ -6,6 +6,7 @@ #define EIPSCANNER_CONNECTIONMANAGER_H #include + #include "MessageRouter.h" #include "IOConnection.h" #include "cip/connectionManager/ConnectionParameters.h" diff --git a/src/DiscoveryManager.cpp b/src/DiscoveryManager.cpp index 3ca397e..0442d57 100644 --- a/src/DiscoveryManager.cpp +++ b/src/DiscoveryManager.cpp @@ -1,6 +1,7 @@ // // Created by Aleksey Timin on 12/17/19. // + #include #include "eip/EncapsPacketFactory.h" diff --git a/src/FileObject.cpp b/src/FileObject.cpp index 5a451a3..b9c5e49 100644 --- a/src/FileObject.cpp +++ b/src/FileObject.cpp @@ -1,7 +1,9 @@ // // Created by Aleksey Timin on 11/21/19. // + #include + #include "FileObject.h" #include "fileObject/FileObjectState.h" #include "utils/Buffer.h" @@ -37,4 +39,4 @@ namespace eipScanner { bool FileObject::handleTransfers(SessionInfoIf::SPtr si) { return _state->transfer(si); } -} \ No newline at end of file +} diff --git a/src/IOConnection.h b/src/IOConnection.h index 9058d89..444c7b7 100644 --- a/src/IOConnection.h +++ b/src/IOConnection.h @@ -7,6 +7,7 @@ #include #include + #include #include "cip/Types.h" #include "sockets/UDPSocket.h" diff --git a/src/MessageRouter.cpp b/src/MessageRouter.cpp index 4bd859b..4c84bd7 100644 --- a/src/MessageRouter.cpp +++ b/src/MessageRouter.cpp @@ -3,6 +3,7 @@ // #include + #include "eip/EncapsPacketFactory.h" #include "utils/Buffer.h" #include "MessageRouter.h" diff --git a/src/MessageRouter.h b/src/MessageRouter.h index c4a0bda..31719b1 100644 --- a/src/MessageRouter.h +++ b/src/MessageRouter.h @@ -6,6 +6,7 @@ #define EIPSCANNER_MESSAGEROUTER_H #include + #include "cip/EPath.h" #include "cip/Services.h" #include "cip/MessageRouterResponse.h" diff --git a/src/ParameterObject.h b/src/ParameterObject.h index c338f24..1e17c50 100644 --- a/src/ParameterObject.h +++ b/src/ParameterObject.h @@ -7,6 +7,7 @@ #include #include + #include "MessageRouter.h" #include "utils/Buffer.h" #include "BaseObject.h" @@ -382,4 +383,5 @@ class ParameterObject : public BaseObject { }; } + #endif // EIPSCANNER_PARAMETEROBJECT_H diff --git a/src/SessionInfo.cpp b/src/SessionInfo.cpp index cbfb179..a2c9187 100644 --- a/src/SessionInfo.cpp +++ b/src/SessionInfo.cpp @@ -76,4 +76,4 @@ namespace eipScanner { return _socket.getRemoteEndPoint(); } -} \ No newline at end of file +} diff --git a/src/SessionInfoIf.h b/src/SessionInfoIf.h index 974a7e5..58e41c6 100644 --- a/src/SessionInfoIf.h +++ b/src/SessionInfoIf.h @@ -6,6 +6,7 @@ #define EIPSCANNER_SESSIONINFOIF_H #include + #include "eip/EncapsPacket.h" #include "sockets/EndPoint.h" @@ -39,4 +40,5 @@ namespace eipScanner { virtual sockets::EndPoint getRemoteEndPoint() const = 0; }; } + #endif //EIPSCANNER_SESSIONINFOIF_H diff --git a/src/cip/CipRevision.cpp b/src/cip/CipRevision.cpp index 466940a..c87cedf 100644 --- a/src/cip/CipRevision.cpp +++ b/src/cip/CipRevision.cpp @@ -3,6 +3,7 @@ // #include "CipRevision.h" + namespace eipScanner { namespace cip { @@ -33,4 +34,4 @@ namespace cip { return _minorRevision; } } -} \ No newline at end of file +} diff --git a/src/cip/CipRevision.h b/src/cip/CipRevision.h index da1f1d3..9771056 100644 --- a/src/cip/CipRevision.h +++ b/src/cip/CipRevision.h @@ -6,6 +6,7 @@ #define EIPSCANNER_CIP_CIPREVISION_H #include + #include "Types.h" namespace eipScanner { diff --git a/src/cip/CipString.cpp b/src/cip/CipString.cpp index f734716..e807d15 100644 --- a/src/cip/CipString.cpp +++ b/src/cip/CipString.cpp @@ -3,9 +3,10 @@ // #include "CipString.h" + namespace eipScanner { namespace cip { } -} \ No newline at end of file +} diff --git a/src/cip/CipString.h b/src/cip/CipString.h index 1cdc713..54fb6ea 100644 --- a/src/cip/CipString.h +++ b/src/cip/CipString.h @@ -9,6 +9,7 @@ #include #include #include + #include "Types.h" namespace eipScanner { diff --git a/src/cip/EPath.cpp b/src/cip/EPath.cpp index 52f6667..8faacdf 100644 --- a/src/cip/EPath.cpp +++ b/src/cip/EPath.cpp @@ -1,7 +1,9 @@ // // Created by Aleksey Timin on 11/16/19. // + #include + #include "utils/Buffer.h" #include "EPath.h" diff --git a/src/cip/EPath.h b/src/cip/EPath.h index d2270b6..58a3022 100644 --- a/src/cip/EPath.h +++ b/src/cip/EPath.h @@ -5,9 +5,9 @@ #ifndef EIPSCANNER_CIP_EPATH_H #define EIPSCANNER_CIP_EPATH_H -#include -#include #include +#include +#include #include "Types.h" @@ -38,4 +38,5 @@ namespace cip { }; } } + #endif // EIPSCANNER_CIP_EPATH_H diff --git a/src/cip/GeneralStatusCodes.h b/src/cip/GeneralStatusCodes.h index 810f6e3..87bc8b4 100644 --- a/src/cip/GeneralStatusCodes.h +++ b/src/cip/GeneralStatusCodes.h @@ -168,4 +168,5 @@ namespace cip { } } + #endif //EIPSCANNER_CIP_GENERALSTATUSCODES_H diff --git a/src/cip/MessageRouterRequest.cpp b/src/cip/MessageRouterRequest.cpp index 43e5ab7..8fec768 100644 --- a/src/cip/MessageRouterRequest.cpp +++ b/src/cip/MessageRouterRequest.cpp @@ -30,4 +30,4 @@ namespace cip { return buffer.data(); } } -} \ No newline at end of file +} diff --git a/src/cip/MessageRouterRequest.h b/src/cip/MessageRouterRequest.h index 09777b7..79ddd59 100644 --- a/src/cip/MessageRouterRequest.h +++ b/src/cip/MessageRouterRequest.h @@ -29,5 +29,4 @@ namespace cip { } } - #endif // EIPSCANNER_CIP_MESSAGEROUTERREQUEST_H diff --git a/src/cip/MessageRouterResponse.cpp b/src/cip/MessageRouterResponse.cpp index 5b56cc8..718ac03 100644 --- a/src/cip/MessageRouterResponse.cpp +++ b/src/cip/MessageRouterResponse.cpp @@ -1,7 +1,9 @@ // // Created by Aleksey Timin on 11/16/19. // + #include + #include "MessageRouterResponse.h" #include "utils/Buffer.h" #include "utils/Logger.h" diff --git a/src/cip/Types.h b/src/cip/Types.h index 68b77ed..e7593a6 100644 --- a/src/cip/Types.h +++ b/src/cip/Types.h @@ -67,4 +67,5 @@ namespace cip { }; } } + #endif //EIPSCANNER_CIP_TYPES_H diff --git a/src/cip/connectionManager/ConnectionParameters.h b/src/cip/connectionManager/ConnectionParameters.h index c1ba86d..3649c79 100644 --- a/src/cip/connectionManager/ConnectionParameters.h +++ b/src/cip/connectionManager/ConnectionParameters.h @@ -33,4 +33,5 @@ namespace connectionManager { } } } + #endif //EIPSCANNER_CIP_CONNECTIONPARAMETERS_H diff --git a/src/cip/connectionManager/ForwardCloseRequest.cpp b/src/cip/connectionManager/ForwardCloseRequest.cpp index 4134f80..3926ce8 100644 --- a/src/cip/connectionManager/ForwardCloseRequest.cpp +++ b/src/cip/connectionManager/ForwardCloseRequest.cpp @@ -1,6 +1,7 @@ // // Created by Aleksey Timin on 11/19/19. // + #include "ForwardCloseRequest.h" #include "utils/Buffer.h" diff --git a/src/cip/connectionManager/ForwardCloseRequest.h b/src/cip/connectionManager/ForwardCloseRequest.h index bbbd872..8136e72 100644 --- a/src/cip/connectionManager/ForwardCloseRequest.h +++ b/src/cip/connectionManager/ForwardCloseRequest.h @@ -6,6 +6,7 @@ #define EIPSCANNER_CIP_CONNECTIONMANAGER_FORWARDCLOSEREQUEST_H #include + #include "ConnectionParameters.h" namespace eipScanner { @@ -31,4 +32,5 @@ namespace connectionManager { } } } + #endif // EIPSCANNER_CIP_CONNECTIONMANAGER_FORWARDOPENREQUEST_H diff --git a/src/cip/connectionManager/ForwardOpenRequest.cpp b/src/cip/connectionManager/ForwardOpenRequest.cpp index a48d9cc..871cc69 100644 --- a/src/cip/connectionManager/ForwardOpenRequest.cpp +++ b/src/cip/connectionManager/ForwardOpenRequest.cpp @@ -2,10 +2,10 @@ // Created by Aleksey Timin on 11/18/19. // -#include "ForwardOpenRequest.h" - +#include #include -#include + +#include "ForwardOpenRequest.h" #include "utils/Buffer.h" namespace eipScanner { diff --git a/src/cip/connectionManager/ForwardOpenRequest.h b/src/cip/connectionManager/ForwardOpenRequest.h index e999a0d..b1346b5 100644 --- a/src/cip/connectionManager/ForwardOpenRequest.h +++ b/src/cip/connectionManager/ForwardOpenRequest.h @@ -6,6 +6,7 @@ #define EIPSCANNER_CIP_CONNECTIONMANAGER_FORWARDOPENREQUEST_H #include + #include "ConnectionParameters.h" namespace eipScanner { @@ -23,4 +24,5 @@ namespace connectionManager { } } } + #endif // EIPSCANNER_CIP_CONNECTIONMANAGER_FORWARDOPENREQUEST_H diff --git a/src/cip/connectionManager/ForwardOpenResponse.cpp b/src/cip/connectionManager/ForwardOpenResponse.cpp index 622c1d1..e301a13 100644 --- a/src/cip/connectionManager/ForwardOpenResponse.cpp +++ b/src/cip/connectionManager/ForwardOpenResponse.cpp @@ -80,4 +80,4 @@ namespace connectionManager { } } } -} \ No newline at end of file +} diff --git a/src/cip/connectionManager/ForwardOpenResponse.h b/src/cip/connectionManager/ForwardOpenResponse.h index d70d334..1276cc8 100644 --- a/src/cip/connectionManager/ForwardOpenResponse.h +++ b/src/cip/connectionManager/ForwardOpenResponse.h @@ -6,6 +6,7 @@ #define EIPSCANNER_CIP_CONNECTIONMANAGER_FORWARDOPENRESPONSE_H #include + #include "cip/Types.h" namespace eipScanner { diff --git a/src/cip/connectionManager/LargeForwardOpenRequest.cpp b/src/cip/connectionManager/LargeForwardOpenRequest.cpp index 45da36a..8c1b169 100644 --- a/src/cip/connectionManager/LargeForwardOpenRequest.cpp +++ b/src/cip/connectionManager/LargeForwardOpenRequest.cpp @@ -2,10 +2,10 @@ // Created by Vincent Prince on 05/22/20. // -#include "LargeForwardOpenRequest.h" - +#include #include -#include + +#include "LargeForwardOpenRequest.h" #include "utils/Buffer.h" namespace eipScanner { diff --git a/src/cip/connectionManager/LargeForwardOpenRequest.h b/src/cip/connectionManager/LargeForwardOpenRequest.h index c1f0a87..4e6de77 100644 --- a/src/cip/connectionManager/LargeForwardOpenRequest.h +++ b/src/cip/connectionManager/LargeForwardOpenRequest.h @@ -6,6 +6,7 @@ #define EIPSCANNER_CIP_CONNECTIONMANAGER_LARGEFORWARDOPENREQUEST_H #include + #include "ConnectionParameters.h" namespace eipScanner { @@ -23,4 +24,5 @@ namespace connectionManager { } } } + #endif // EIPSCANNER_CIP_CONNECTIONMANAGER_LARGEFORWARDOPENREQUEST_H diff --git a/src/cip/connectionManager/NetworkConnectionParametersBuilder.cpp b/src/cip/connectionManager/NetworkConnectionParametersBuilder.cpp index 219a191..2e52ce7 100644 --- a/src/cip/connectionManager/NetworkConnectionParametersBuilder.cpp +++ b/src/cip/connectionManager/NetworkConnectionParametersBuilder.cpp @@ -2,10 +2,10 @@ // Created by Vincent Prince on 05/22/20. // -#include "NetworkConnectionParametersBuilder.h" - +#include #include -#include + +#include "NetworkConnectionParametersBuilder.h" #include "utils/Buffer.h" namespace eipScanner { diff --git a/src/cip/connectionManager/NetworkConnectionParametersBuilder.h b/src/cip/connectionManager/NetworkConnectionParametersBuilder.h index ba091fa..9244474 100644 --- a/src/cip/connectionManager/NetworkConnectionParametersBuilder.h +++ b/src/cip/connectionManager/NetworkConnectionParametersBuilder.h @@ -61,4 +61,5 @@ namespace connectionManager { } } } + #endif //EIPSCANNER_CIP_CONNECTIONMANAGER_NETWORKCONNECTIONPARAMETERSBUILDER_H diff --git a/src/cip/connectionManager/NetworkConnectionParams.h b/src/cip/connectionManager/NetworkConnectionParams.h index e6cb8b9..7a6ea73 100644 --- a/src/cip/connectionManager/NetworkConnectionParams.h +++ b/src/cip/connectionManager/NetworkConnectionParams.h @@ -46,4 +46,5 @@ namespace connectionManager { } } } + #endif //EIPSCANNER_CIP_CONNECTIONMANAGER_NETWORKCONNECTIONPARAMS_H diff --git a/src/eip/CommonPacket.cpp b/src/eip/CommonPacket.cpp index c51a176..1d104c1 100644 --- a/src/eip/CommonPacket.cpp +++ b/src/eip/CommonPacket.cpp @@ -1,7 +1,9 @@ // // Created by Aleksey Timin on 11/16/19. // + #include + #include "CommonPacket.h" #include "utils/Buffer.h" #include "cip/Types.h" @@ -58,4 +60,4 @@ namespace eip { return _items; } } -} \ No newline at end of file +} diff --git a/src/eip/CommonPacketItem.h b/src/eip/CommonPacketItem.h index 000bba6..a7fb854 100644 --- a/src/eip/CommonPacketItem.h +++ b/src/eip/CommonPacketItem.h @@ -5,8 +5,8 @@ #ifndef EIPSCANNER_EIP_COMMONPACKETITEM_H #define EIPSCANNER_EIP_COMMONPACKETITEM_H -#include #include +#include #include "cip/Types.h" @@ -50,5 +50,4 @@ namespace eip { } } - #endif // EIPSCANNER_EIP_COMMONPACKETITEM_H diff --git a/src/eip/CommonPacketItemFactory.cpp b/src/eip/CommonPacketItemFactory.cpp index 40f0d8a..7a21a16 100644 --- a/src/eip/CommonPacketItemFactory.cpp +++ b/src/eip/CommonPacketItemFactory.cpp @@ -28,4 +28,4 @@ namespace eip { return CommonPacketItem(CommonPacketItemIds::SEQUENCED_ADDRESS_ITEM, buffer.data()); } } -} \ No newline at end of file +} diff --git a/src/eip/CommonPacketItemFactory.h b/src/eip/CommonPacketItemFactory.h index 98a5b63..ccd5203 100644 --- a/src/eip/CommonPacketItemFactory.h +++ b/src/eip/CommonPacketItemFactory.h @@ -6,6 +6,7 @@ #define EIPSCANNER_EIP_COMMONPACKETITEMFACTORY_H #include + #include "CommonPacketItem.h" #include "cip/Types.h" @@ -20,4 +21,5 @@ namespace eip { }; } } + #endif // EIPSCANNER_EIP_COMMONPACKETITEMFACTORY_H diff --git a/src/eip/EncapsPacket.cpp b/src/eip/EncapsPacket.cpp index 64d2ed3..8ca4f90 100644 --- a/src/eip/EncapsPacket.cpp +++ b/src/eip/EncapsPacket.cpp @@ -2,8 +2,9 @@ // Created by flipback on 11/16/19. // -#include #include +#include + #include "EncapsPacket.h" #include "utils/Buffer.h" diff --git a/src/eip/EncapsPacket.h b/src/eip/EncapsPacket.h index 1d39ba1..50a9d79 100644 --- a/src/eip/EncapsPacket.h +++ b/src/eip/EncapsPacket.h @@ -10,7 +10,6 @@ #include #include "cip/Types.h" -#include namespace eipScanner { namespace eip { @@ -61,8 +60,6 @@ namespace eip { const std::vector &getData() const; void setData(const std::vector &data); - - private: public: bool operator==(const EncapsPacket &rhs) const; @@ -80,5 +77,4 @@ namespace eip { } } - #endif // EIPSCANNER_EIP_ENCAPSPACKET_H diff --git a/src/eip/EncapsPacketFactory.cpp b/src/eip/EncapsPacketFactory.cpp index 56d7027..4884a63 100644 --- a/src/eip/EncapsPacketFactory.cpp +++ b/src/eip/EncapsPacketFactory.cpp @@ -54,4 +54,4 @@ namespace eip { return packet; } } -} \ No newline at end of file +} diff --git a/src/eip/EncapsPacketFactory.h b/src/eip/EncapsPacketFactory.h index 163077e..6526aff 100644 --- a/src/eip/EncapsPacketFactory.h +++ b/src/eip/EncapsPacketFactory.h @@ -21,6 +21,4 @@ namespace eip { } } - - #endif // EIPSCANNER_ENCAPSPACKETFACTORY_H diff --git a/src/fileObject/FileObjectEmptyState.cpp b/src/fileObject/FileObjectEmptyState.cpp index ac19b06..8badf4d 100644 --- a/src/fileObject/FileObjectEmptyState.cpp +++ b/src/fileObject/FileObjectEmptyState.cpp @@ -3,6 +3,7 @@ // #include "FileObjectEmptyState.h" + namespace eipScanner { namespace fileObject { using utils::LogLevel; diff --git a/src/fileObject/FileObjectLoadedState.cpp b/src/fileObject/FileObjectLoadedState.cpp index dbd2a53..fbe644f 100644 --- a/src/fileObject/FileObjectLoadedState.cpp +++ b/src/fileObject/FileObjectLoadedState.cpp @@ -43,4 +43,4 @@ namespace fileObject { return false; } } -} \ No newline at end of file +} diff --git a/src/fileObject/FileObjectNonExistentState.h b/src/fileObject/FileObjectNonExistentState.h index 6d63b09..6427c1b 100644 --- a/src/fileObject/FileObjectNonExistentState.h +++ b/src/fileObject/FileObjectNonExistentState.h @@ -20,4 +20,5 @@ namespace fileObject { } } + #endif // EIPSCANNER_FILEOBJECTNONEXISTENTSTATE_H diff --git a/src/fileObject/FileObjectState.cpp b/src/fileObject/FileObjectState.cpp index 96bc733..fe3a8da 100644 --- a/src/fileObject/FileObjectState.cpp +++ b/src/fileObject/FileObjectState.cpp @@ -3,6 +3,7 @@ // #include + #include "FileObjectState.h" #include "utils/Buffer.h" #include "FileObjectNonExistentState.h" diff --git a/src/fileObject/FileObjectState.h b/src/fileObject/FileObjectState.h index c762705..dd17ff2 100644 --- a/src/fileObject/FileObjectState.h +++ b/src/fileObject/FileObjectState.h @@ -6,6 +6,7 @@ #define EIPSCANNER_FILEOBJECT_FILEOBJECTSTATE_H #include + #include "SessionInfo.h" #include "MessageRouter.h" #include "FileObject.h" diff --git a/src/fileObject/FileObjectUploadInProgressState.h b/src/fileObject/FileObjectUploadInProgressState.h index 8a8b25f..5361b58 100644 --- a/src/fileObject/FileObjectUploadInProgressState.h +++ b/src/fileObject/FileObjectUploadInProgressState.h @@ -31,4 +31,5 @@ namespace fileObject { } } + #endif // EIPSCANNER_FILEOBJECT_FILEOBJECTUPLOADINPROGRESSSTATE_H diff --git a/src/sockets/BaseSocket.cpp b/src/sockets/BaseSocket.cpp index ae525a8..4e26f18 100644 --- a/src/sockets/BaseSocket.cpp +++ b/src/sockets/BaseSocket.cpp @@ -85,7 +85,6 @@ namespace sockets { timeval tv = makePortableInterval(recvTimeout); setsockopt(_sockedFd, SOL_SOCKET, SO_RCVTIMEO, (const char*)&tv, sizeof tv); #endif - } timeval BaseSocket::makePortableInterval(const std::chrono::milliseconds &recvTimeout) { diff --git a/src/sockets/BaseSocket.h b/src/sockets/BaseSocket.h index 1019fab..ef2d4c1 100644 --- a/src/sockets/BaseSocket.h +++ b/src/sockets/BaseSocket.h @@ -59,5 +59,4 @@ namespace sockets { } } - #endif // EIPSCANNER_SOCKETS_BASESOCKET_H diff --git a/src/sockets/EndPoint.cpp b/src/sockets/EndPoint.cpp index b6de7ad..efe23a3 100644 --- a/src/sockets/EndPoint.cpp +++ b/src/sockets/EndPoint.cpp @@ -2,10 +2,6 @@ // Created by Aleksey Timin on 12/10/19. // -#include "EndPoint.h" -#include "BaseSocket.h" -#include "Platform.h" - #if defined(__unix__) || defined(__APPLE__) #include #elif defined(_WIN32) || defined(WIN32) || defined(_WIN64) @@ -16,6 +12,10 @@ #include #include +#include "EndPoint.h" +#include "BaseSocket.h" +#include "Platform.h" + namespace eipScanner { namespace sockets { diff --git a/src/sockets/EndPoint.h b/src/sockets/EndPoint.h index 1bffa44..dc0f58b 100644 --- a/src/sockets/EndPoint.h +++ b/src/sockets/EndPoint.h @@ -10,6 +10,7 @@ #elif defined(_WIN32) || defined(WIN32) || defined(_WIN64) #include #endif + #include #define EIP_DEFAULT_EXPLICIT_PORT (uint16_t)(44818) diff --git a/src/sockets/TCPSocket.h b/src/sockets/TCPSocket.h index f5c2882..fed4bfc 100644 --- a/src/sockets/TCPSocket.h +++ b/src/sockets/TCPSocket.h @@ -5,8 +5,9 @@ #ifndef EIPSCANNER_SOCKETS_TCPSOCKET_H #define EIPSCANNER_SOCKETS_TCPSOCKET_H -#include #include +#include + #include "BaseSocket.h" namespace eipScanner { diff --git a/src/sockets/UDPBoundSocket.cpp b/src/sockets/UDPBoundSocket.cpp index 8b03fc9..901e14c 100644 --- a/src/sockets/UDPBoundSocket.cpp +++ b/src/sockets/UDPBoundSocket.cpp @@ -3,9 +3,6 @@ // #include -//#include -//#include - #include "UDPBoundSocket.h" #include "Platform.h" diff --git a/src/sockets/UDPBoundSocket.h b/src/sockets/UDPBoundSocket.h index 3d9c3f9..256af36 100644 --- a/src/sockets/UDPBoundSocket.h +++ b/src/sockets/UDPBoundSocket.h @@ -5,10 +5,10 @@ #ifndef EIPSCANNER_SOCKETS_UDPSBOUNDOCKET_H #define EIPSCANNER_SOCKETS_UDPSBOUNDOCKET_H -#include #include #include -//#include +#include + #include "UDPSocket.h" namespace eipScanner { diff --git a/src/sockets/UDPSocket.h b/src/sockets/UDPSocket.h index 285cc0a..588b984 100644 --- a/src/sockets/UDPSocket.h +++ b/src/sockets/UDPSocket.h @@ -5,9 +5,10 @@ #ifndef EIPSCANNER_SOCKETS_UDPSOCKET_H #define EIPSCANNER_SOCKETS_UDPSOCKET_H -#include #include #include +#include + #include "BaseSocket.h" namespace eipScanner { @@ -31,4 +32,3 @@ namespace sockets { } #endif // EIPSCANNER_SOCKETS_UDPSOCKET_H - diff --git a/src/utils/Buffer.h b/src/utils/Buffer.h index 32c1409..4a61391 100644 --- a/src/utils/Buffer.h +++ b/src/utils/Buffer.h @@ -8,6 +8,7 @@ #include #include #include + #include "cip/CipString.h" #include "cip/CipRevision.h" #include "sockets/EndPoint.h" @@ -119,4 +120,5 @@ namespace utils { }; } } + #endif // EIPSCANNER_BUFFER_H diff --git a/src/utils/Logger.cpp b/src/utils/Logger.cpp index 495bc84..3cf94b4 100644 --- a/src/utils/Logger.cpp +++ b/src/utils/Logger.cpp @@ -1,6 +1,7 @@ // // Created by Aleksey Timin on 11/16/19. // + #include #include @@ -41,4 +42,4 @@ namespace utils { std::cout << LOGLEVEL_NAMES.at(logLevel) << msg << std::endl; } } -} \ No newline at end of file +} diff --git a/src/vendor/ra/powerFlex525/DPIFaultCode.cpp b/src/vendor/ra/powerFlex525/DPIFaultCode.cpp index bba3dbb..a3f677f 100644 --- a/src/vendor/ra/powerFlex525/DPIFaultCode.cpp +++ b/src/vendor/ra/powerFlex525/DPIFaultCode.cpp @@ -54,4 +54,4 @@ namespace powerFlex525 { } } } -} \ No newline at end of file +} diff --git a/src/vendor/ra/powerFlex525/DPIFaultManager.h b/src/vendor/ra/powerFlex525/DPIFaultManager.h index d56af02..70de278 100644 --- a/src/vendor/ra/powerFlex525/DPIFaultManager.h +++ b/src/vendor/ra/powerFlex525/DPIFaultManager.h @@ -7,6 +7,7 @@ #include #include + #include "DPIFaultObject.h" #include "SessionInfoIf.h" #include "DPIFaultParameter.h" diff --git a/src/vendor/ra/powerFlex525/DPIFaultObject.h b/src/vendor/ra/powerFlex525/DPIFaultObject.h index 5c11679..e092212 100644 --- a/src/vendor/ra/powerFlex525/DPIFaultObject.h +++ b/src/vendor/ra/powerFlex525/DPIFaultObject.h @@ -70,4 +70,5 @@ namespace powerFlex525 { } } } + #endif // EIPSCANNER_VENDOR_DIPFAULTOBJECT_H diff --git a/src/vendor/ra/powerFlex525/DPIFaultParameter.cpp b/src/vendor/ra/powerFlex525/DPIFaultParameter.cpp index db43afb..2031aad 100644 --- a/src/vendor/ra/powerFlex525/DPIFaultParameter.cpp +++ b/src/vendor/ra/powerFlex525/DPIFaultParameter.cpp @@ -2,11 +2,9 @@ // Created by James Roth on 12/19/19. // -#include "DPIFaultParameter.h" - #include - +#include "DPIFaultParameter.h" #include "utils/Buffer.h" namespace eipScanner { diff --git a/src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp b/src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp index 7d5aa17..04f0a2b 100644 --- a/src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp +++ b/src/vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp @@ -1,4 +1,5 @@ #include + #include "utils/Buffer.h" #include "Yaskawa_EPath.h" diff --git a/src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp b/src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp index f966901..7891d38 100644 --- a/src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp +++ b/src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp @@ -1,5 +1,6 @@ #include + #include "eip/EncapsPacketFactory.h" #include "utils/Buffer.h" #include "Yaskawa_MessageRouter.h" diff --git a/src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.h b/src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.h index 40faa66..34037d0 100644 --- a/src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.h +++ b/src/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.h @@ -2,6 +2,7 @@ #define EIPSCANNER_YASKAWA_MESSAGEROUTER_H #include + #include "Yaskawa_EPath.h" #include "cip/Services.h" #include "cip/MessageRouterResponse.h" diff --git a/test/Mocks.h b/test/Mocks.h index bec4d4a..768b9a7 100644 --- a/test/Mocks.h +++ b/test/Mocks.h @@ -6,6 +6,7 @@ #define EIPSCANNER_MOCKS_H #include + #include "MessageRouter.h" class TMockMessageRouter : public eipScanner::MessageRouter { diff --git a/test/TestDiscoveryManager.cpp b/test/TestDiscoveryManager.cpp index 0a02785..ac3c007 100644 --- a/test/TestDiscoveryManager.cpp +++ b/test/TestDiscoveryManager.cpp @@ -76,4 +76,4 @@ TEST_F(TestDiscoveryManager, ShouldSendBroadcastMessageAndGetResponses) { EXPECT_EQ("PowerFlex 525 1P 110V .50HP", devices[3].identityObject.getProductName()); EXPECT_EQ(1, devices[1].identityObject.getVendorId()); EXPECT_EQ("192.168.1.15:44818", devices[0].socketAddress.toString()); -} \ No newline at end of file +} diff --git a/test/TestIdentityObject.cpp b/test/TestIdentityObject.cpp index c5bba93..8a363b9 100644 --- a/test/TestIdentityObject.cpp +++ b/test/TestIdentityObject.cpp @@ -3,6 +3,7 @@ // #include + #include "Mocks.h" #include "IdentityObject.h" diff --git a/test/TestMessageRouter.cpp b/test/TestMessageRouter.cpp index c9306c3..3b8c018 100644 --- a/test/TestMessageRouter.cpp +++ b/test/TestMessageRouter.cpp @@ -3,6 +3,7 @@ // #include + #include "Mocks.h" #include "MessageRouter.h" #include "eip/CommonPacket.h" @@ -58,4 +59,4 @@ TEST(TestMessageRouter, ShouldFormAndParseCommonPackets) { EXPECT_EQ(cip::GeneralStatusCodes::SUCCESS, response.getGeneralStatusCode()); EXPECT_EQ(1, response.getAdditionalPacketItems().size()); EXPECT_EQ(additionalPacketItem, response.getAdditionalPacketItems().at(0)); -} \ No newline at end of file +} diff --git a/test/TestParameterObject.cpp b/test/TestParameterObject.cpp index 0f16b4b..b01b0f3 100644 --- a/test/TestParameterObject.cpp +++ b/test/TestParameterObject.cpp @@ -3,6 +3,7 @@ // #include + #include "Mocks.h" #include "ParameterObject.h" @@ -179,4 +180,4 @@ TEST_F(TestParameterObject, ShouldReadFlagReadOnlyFromDescriptor) { ParameterObject parameterObject(OBJECT_ID, false, _nullSession, _messageRouter); EXPECT_TRUE(parameterObject.isReadOnly()); -} \ No newline at end of file +} diff --git a/test/cip/TestCipRevision.cpp b/test/cip/TestCipRevision.cpp index ae8f600..45ac4a1 100644 --- a/test/cip/TestCipRevision.cpp +++ b/test/cip/TestCipRevision.cpp @@ -3,6 +3,7 @@ // #include + #include "cip/CipRevision.h" using eipScanner::cip::CipRevision; @@ -19,4 +20,4 @@ TEST(TestCipRevision, ShouldConvertToString) { EXPECT_EQ(1, revision.getMajorRevision()); EXPECT_EQ(2, revision.getMinorRevision()); EXPECT_EQ("1.2", revision.toString()); -} \ No newline at end of file +} diff --git a/test/cip/TestCipString.cpp b/test/cip/TestCipString.cpp index f23240b..30e136e 100644 --- a/test/cip/TestCipString.cpp +++ b/test/cip/TestCipString.cpp @@ -4,6 +4,7 @@ // #include + #include "cip/CipString.h" #include "utils/Buffer.h" @@ -25,4 +26,4 @@ TEST(TestCipString, ShuoldDecodeAndEncodeByBuffer) { EXPECT_EQ(dstString.toStdString(), srcString.toStdString()); -} \ No newline at end of file +} diff --git a/test/cip/TestEPath.cpp b/test/cip/TestEPath.cpp index e499372..066036e 100644 --- a/test/cip/TestEPath.cpp +++ b/test/cip/TestEPath.cpp @@ -3,6 +3,7 @@ // #include + #include "cip/EPath.h" using eipScanner::cip::EPath; @@ -59,4 +60,4 @@ TEST(TestEPath, ShouldThrowExceptionIfThePathNotComplited) { EPath path; EXPECT_THROW(path.expandPaddedPath(data), std::runtime_error); -} \ No newline at end of file +} diff --git a/test/cip/TestMessageRouterResponse.cpp b/test/cip/TestMessageRouterResponse.cpp index 828f30a..4981764 100644 --- a/test/cip/TestMessageRouterResponse.cpp +++ b/test/cip/TestMessageRouterResponse.cpp @@ -3,6 +3,7 @@ // #include + #include "cip/MessageRouterResponse.h" using eipScanner::cip::MessageRouterResponse; diff --git a/test/eip/TestCommonPacket.cpp b/test/eip/TestCommonPacket.cpp index 7f90e50..e810828 100644 --- a/test/eip/TestCommonPacket.cpp +++ b/test/eip/TestCommonPacket.cpp @@ -3,6 +3,7 @@ // #include + #include "eip/CommonPacketItem.h" #include "eip/CommonPacketItemFactory.h" #include "eip/CommonPacket.h" @@ -39,4 +40,4 @@ TEST(CommonPacket, ShouldThrowErrorIfDataIsInvalid) { CommonPacket cp; EXPECT_THROW(cp.expand(invalidData), std::runtime_error); -} \ No newline at end of file +} diff --git a/test/eip/TestCommonPacketItem.cpp b/test/eip/TestCommonPacketItem.cpp index b43fc1e..7f6e51e 100644 --- a/test/eip/TestCommonPacketItem.cpp +++ b/test/eip/TestCommonPacketItem.cpp @@ -3,6 +3,7 @@ // #include + #include "eip/CommonPacketItem.h" #include "eip/CommonPacketItemFactory.h" diff --git a/test/eip/TestCommonPacketItemFactory.cpp b/test/eip/TestCommonPacketItemFactory.cpp index 56e657f..98721a7 100644 --- a/test/eip/TestCommonPacketItemFactory.cpp +++ b/test/eip/TestCommonPacketItemFactory.cpp @@ -3,6 +3,7 @@ // #include + #include "eip/CommonPacketItemFactory.h" using eipScanner::eip::CommonPacketItemFactory; @@ -24,4 +25,4 @@ TEST(CommonPacketItemFactory, ShouldCreateNullAddressItem) { EXPECT_EQ(item.getTypeId(), CommonPacketItemIds::NULL_ADDR); EXPECT_EQ(item.getLength(), 0); -} \ No newline at end of file +} diff --git a/test/eip/TestEncapsPacket.cpp b/test/eip/TestEncapsPacket.cpp index 922e292..d205594 100644 --- a/test/eip/TestEncapsPacket.cpp +++ b/test/eip/TestEncapsPacket.cpp @@ -3,6 +3,7 @@ // #include + #include "eip/EncapsPacket.h" using eipScanner::eip::EncapsPacket; @@ -40,4 +41,4 @@ TEST(TestEncapsPacket, ShouldThrowErrorIfThePackageHasWrongLenghtOfData) { EncapsPacket packet; EXPECT_THROW(packet.expand(data), std::runtime_error); -} \ No newline at end of file +} diff --git a/test/eip/TestEncapsPacketFactory.cpp b/test/eip/TestEncapsPacketFactory.cpp index ea26b03..38a09ae 100644 --- a/test/eip/TestEncapsPacketFactory.cpp +++ b/test/eip/TestEncapsPacketFactory.cpp @@ -1,7 +1,9 @@ // // Created by Aleksey Timin on 11/16/19. // + #include + #include "eip/EncapsPacketFactory.h" #include "eip/EncapsPacket.h" @@ -41,4 +43,4 @@ TEST(TestEncapsPacketFactory, ShouldCreateListIdentityPacket) { EncapsPacket packet = EncapsPacketFactory().createListIdentityPacket(); EXPECT_EQ(expectedPacket, packet.pack()); -} \ No newline at end of file +} diff --git a/test/fileObject/Mocks.h b/test/fileObject/Mocks.h index c775a75..e0f1325 100644 --- a/test/fileObject/Mocks.h +++ b/test/fileObject/Mocks.h @@ -6,6 +6,7 @@ #define EIPSCANNER_TEST_FILEOBJECT_MOCKS_H #include "../Mocks.h" + #include "MessageRouter.h" #include "FileObject.h" #include "fileObject/FileObjectState.h" @@ -36,4 +37,5 @@ namespace fileObject { } } + #endif //EIPSCANNER_TEST_FILEOBJECT_MOCKS_H diff --git a/test/fileObject/TestFileObjectLoadedState.cpp b/test/fileObject/TestFileObjectLoadedState.cpp index 2e0a409..c52b8b2 100644 --- a/test/fileObject/TestFileObjectLoadedState.cpp +++ b/test/fileObject/TestFileObjectLoadedState.cpp @@ -1,6 +1,7 @@ // // Created by Aleksey Timin on 11/24/19. // + #include #include @@ -72,4 +73,4 @@ TEST_F(TestFileObjectLoadedState, ShouldCallHandlerIfItFailedToInitiateUpload) { }); EXPECT_EQ(cip::GeneralStatusCodes::INVALID_PARAMETER, receivedStatus); -} \ No newline at end of file +} diff --git a/test/fileObject/TestFileObjectUploadInProgressState.cpp b/test/fileObject/TestFileObjectUploadInProgressState.cpp index 8da1df3..8406671 100644 --- a/test/fileObject/TestFileObjectUploadInProgressState.cpp +++ b/test/fileObject/TestFileObjectUploadInProgressState.cpp @@ -1,6 +1,7 @@ // // Created by Aleksey Timin on 11/24/19. // + #include #include diff --git a/test/sockets/TestEndPoint.cpp b/test/sockets/TestEndPoint.cpp index 2a7e96c..9c7c55a 100644 --- a/test/sockets/TestEndPoint.cpp +++ b/test/sockets/TestEndPoint.cpp @@ -3,6 +3,7 @@ // #include + #include "sockets/EndPoint.h" using eipScanner::sockets::EndPoint; @@ -37,4 +38,4 @@ TEST(TestEndPoint, ShouldConvertAddrToIpAndHost) { TEST(TestEndPoint, ShouldNotThrowExceptionIfCanNotParseIP) { EndPoint endPoint("XXXX", 0); EXPECT_EQ(0, endPoint.getAddr().sin_addr.s_addr); -} \ No newline at end of file +} diff --git a/test/test.cpp b/test/test.cpp index 00b3b13..5614a4c 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -3,6 +3,7 @@ // #include + #include "utils/Logger.h" int main(int argc, char **argv) { @@ -10,4 +11,4 @@ int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/test/utils/TestBuffer.cpp b/test/utils/TestBuffer.cpp index 2adb401..dcd239b 100644 --- a/test/utils/TestBuffer.cpp +++ b/test/utils/TestBuffer.cpp @@ -1,5 +1,6 @@ #include + #include "utils/Buffer.h" using namespace eipScanner; @@ -291,4 +292,4 @@ TEST(TestBuffer, ShouldEncodeDouble) { buffer << expectedValue; EXPECT_EQ(10.5, expectedValue); -} \ No newline at end of file +} diff --git a/test/vendor/ra/powerFlex525/TestDPIFaultManager.cpp b/test/vendor/ra/powerFlex525/TestDPIFaultManager.cpp index e940468..0e36c90 100644 --- a/test/vendor/ra/powerFlex525/TestDPIFaultManager.cpp +++ b/test/vendor/ra/powerFlex525/TestDPIFaultManager.cpp @@ -3,6 +3,7 @@ // #include + #include "Mocks.h" #include "vendor/ra/powerFlex525/DPIFaultManager.h" @@ -201,4 +202,4 @@ TEST_F(TestDPIFaultManager, ShouldGenerateEventForEachNewFaultAndNotCleanFaults) manager.handleFaultParameters(_nullSession, _messageRouter); EXPECT_EQ(2, faultParameters.size()); -} \ No newline at end of file +} diff --git a/test/vendor/ra/powerFlex525/TestDPIFaultObject.cpp b/test/vendor/ra/powerFlex525/TestDPIFaultObject.cpp index 77a12c2..9c86cf0 100644 --- a/test/vendor/ra/powerFlex525/TestDPIFaultObject.cpp +++ b/test/vendor/ra/powerFlex525/TestDPIFaultObject.cpp @@ -4,6 +4,7 @@ #include + #include "Mocks.h" #include "vendor/ra/powerFlex525/DPIFaultObject.h" @@ -65,4 +66,4 @@ TEST_F(TestDPIFaultObject, ShouldThrowExecptionIfFailedToGetData) { )).WillOnce(::testing::Return(response)); EXPECT_THROW(DPIFaultObject(OBJECT_ID, _nullSession, _messageRouter), std::runtime_error); -} \ No newline at end of file +} diff --git a/test/vendor/ra/powerFlex525/TestDPIFaultParameter.cpp b/test/vendor/ra/powerFlex525/TestDPIFaultParameter.cpp index 7f275c1..6029918 100644 --- a/test/vendor/ra/powerFlex525/TestDPIFaultParameter.cpp +++ b/test/vendor/ra/powerFlex525/TestDPIFaultParameter.cpp @@ -4,6 +4,7 @@ #include + #include "Mocks.h" #include "vendor/ra/powerFlex525/DPIFaultObject.h" #include "vendor/ra/powerFlex525/DPIFaultParameter.h" @@ -78,4 +79,4 @@ TEST_F(TestDPIParameterObject, ShouldThrowExecptionIfFailedToGetData) { )).WillOnce(::testing::Return(response)); EXPECT_THROW(DPIFaultParameter(_nullSession, _messageRouter, 1, false), std::runtime_error); -} \ No newline at end of file +} From a484342f43ba10954fecaf4ca0ae4cfdf40c2f27 Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann <19662702+JohannesKauffmann@users.noreply.github.com> Date: Mon, 1 Aug 2022 22:24:46 +0000 Subject: [PATCH 6/6] Removed erroneous spaces where applicable Also fixed a spelling mistake. --- src/ConnectionManager.h | 2 +- src/DiscoveryManager.cpp | 2 +- src/FileObject.h | 2 +- src/IOConnection.cpp | 2 +- src/IOConnection.h | 6 +++--- src/MessageRouter.cpp | 2 +- src/SessionInfo.cpp | 2 +- src/cip/EPath.cpp | 2 +- src/cip/GeneralStatusCodes.h | 2 +- src/cip/connectionManager/ForwardOpenRequest.h | 2 +- src/cip/connectionManager/LargeForwardOpenRequest.h | 2 +- src/eip/EncapsPacket.cpp | 2 +- src/sockets/BaseSocket.cpp | 6 +++--- src/sockets/EndPoint.h | 2 +- src/utils/Buffer.cpp | 4 ++-- src/utils/Buffer.h | 2 +- src/vendor/ra/powerFlex525/DPIFaultManager.h | 4 ++-- 17 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ConnectionManager.h b/src/ConnectionManager.h index 9deed18..4e2f468 100644 --- a/src/ConnectionManager.h +++ b/src/ConnectionManager.h @@ -79,7 +79,7 @@ namespace eipScanner { std::map _connectionMap; std::map> _socketMap; - sockets::UDPBoundSocket::SPtr findOrCreateSocket(const sockets::EndPoint& endPoint); + sockets::UDPBoundSocket::SPtr findOrCreateSocket(const sockets::EndPoint& endPoint); cip::CipUint _incarnationId; }; } diff --git a/src/DiscoveryManager.cpp b/src/DiscoveryManager.cpp index 0442d57..400fc21 100644 --- a/src/DiscoveryManager.cpp +++ b/src/DiscoveryManager.cpp @@ -88,7 +88,7 @@ namespace eipScanner { } sockets::BaseSocket::SPtr DiscoveryManager::makeSocket() const { - auto socket = std::make_shared(_broadCastAddress); + auto socket = std::make_shared(_broadCastAddress); socket->setRecvTimeout(_receiveTimout); int broadcast = 1; diff --git a/src/FileObject.h b/src/FileObject.h index c48a4c0..92f4b3b 100644 --- a/src/FileObject.h +++ b/src/FileObject.h @@ -69,7 +69,7 @@ namespace eipScanner { * @brief Gets the current state of the file * @return */ - std::unique_ptr& getState(); + std::unique_ptr& getState(); /** * @brief Initiates uploading the file from the EIP adapter diff --git a/src/IOConnection.cpp b/src/IOConnection.cpp index 5571496..38bfb90 100644 --- a/src/IOConnection.cpp +++ b/src/IOConnection.cpp @@ -126,7 +126,7 @@ namespace eipScanner { _o2tTimer = 0; _sendDataHandle(_outputData); - if (_o2tFixedSize && _outputData.size() != _o2tDataSize) { + if (_o2tFixedSize && _outputData.size() != _o2tDataSize) { Logger(LogLevel::WARNING) << "Connection O2T_ID=" << _o2tNetworkConnectionId << " has fixed size " << _o2tDataSize << " bytes but " << _outputData.size() << " bytes are to send. Don't send this data."; diff --git a/src/IOConnection.h b/src/IOConnection.h index 444c7b7..e82cb7a 100644 --- a/src/IOConnection.h +++ b/src/IOConnection.h @@ -92,9 +92,9 @@ namespace eipScanner { cip::CipUdint _serialNumber; cip::CipUsint _transportTypeTrigger; - cip::CipBool _o2tRealTimeFormat; - cip::CipBool _t2oRealTimeFormat; - cip::CipUint _sequenceValueCount; + cip::CipBool _o2tRealTimeFormat; + cip::CipBool _t2oRealTimeFormat; + cip::CipUint _sequenceValueCount; std::vector _connectionPath; cip::CipUint _originatorVendorId; cip::CipUdint _originatorSerialNumber; diff --git a/src/MessageRouter.cpp b/src/MessageRouter.cpp index 4c84bd7..aee6097 100644 --- a/src/MessageRouter.cpp +++ b/src/MessageRouter.cpp @@ -23,7 +23,7 @@ namespace eipScanner { using eip::EncapsPacket; using eip::EncapsPacketFactory; - MessageRouter::MessageRouter(bool use_8_bit_path_segments) + MessageRouter::MessageRouter(bool use_8_bit_path_segments) : _use_8_bit_path_segments(use_8_bit_path_segments) {} diff --git a/src/SessionInfo.cpp b/src/SessionInfo.cpp index a2c9187..fe411f7 100644 --- a/src/SessionInfo.cpp +++ b/src/SessionInfo.cpp @@ -1,5 +1,5 @@ // -// Created by Aleksey Timin on 11/16/19. +// Created by Aleksey Timin on 11/16/19. // diff --git a/src/cip/EPath.cpp b/src/cip/EPath.cpp index 8faacdf..d90fa9c 100644 --- a/src/cip/EPath.cpp +++ b/src/cip/EPath.cpp @@ -11,7 +11,7 @@ namespace eipScanner { namespace cip { using utils::Buffer; - enum class EPathSegmentTypes : CipUsint { + enum class EPathSegmentTypes : CipUsint { CLASS_8_BITS = 0x20, CLASS_16_BITS = 0x21, INSTANCE_8_BITS = 0x24, diff --git a/src/cip/GeneralStatusCodes.h b/src/cip/GeneralStatusCodes.h index 87bc8b4..f60db9e 100644 --- a/src/cip/GeneralStatusCodes.h +++ b/src/cip/GeneralStatusCodes.h @@ -17,7 +17,7 @@ namespace cip { //! A connection related service failed along the connection path. CONNECTION_FAILURE = 0x01, - //! Resources needed for the object to perform the requested service + //! Resources needed for the object to perform the requested service //! were unavailable. RESOURCE_UNAVAILABLE = 0x02, diff --git a/src/cip/connectionManager/ForwardOpenRequest.h b/src/cip/connectionManager/ForwardOpenRequest.h index b1346b5..20b20fd 100644 --- a/src/cip/connectionManager/ForwardOpenRequest.h +++ b/src/cip/connectionManager/ForwardOpenRequest.h @@ -14,7 +14,7 @@ namespace cip { namespace connectionManager { class ForwardOpenRequest { public: - ForwardOpenRequest(ConnectionParameters params); + ForwardOpenRequest(ConnectionParameters params); ~ForwardOpenRequest(); std::vector pack() const; diff --git a/src/cip/connectionManager/LargeForwardOpenRequest.h b/src/cip/connectionManager/LargeForwardOpenRequest.h index 4e6de77..45a8da0 100644 --- a/src/cip/connectionManager/LargeForwardOpenRequest.h +++ b/src/cip/connectionManager/LargeForwardOpenRequest.h @@ -14,7 +14,7 @@ namespace cip { namespace connectionManager { class LargeForwardOpenRequest { public: - LargeForwardOpenRequest(ConnectionParameters params); + LargeForwardOpenRequest(ConnectionParameters params); ~LargeForwardOpenRequest(); std::vector pack() const; diff --git a/src/eip/EncapsPacket.cpp b/src/eip/EncapsPacket.cpp index 8ca4f90..18c83b8 100644 --- a/src/eip/EncapsPacket.cpp +++ b/src/eip/EncapsPacket.cpp @@ -39,7 +39,7 @@ namespace eip { auto dataSize = data.size() - HEADER_SIZE; if (dataSize != _length) { - throw std::runtime_error("EncapsPacket data must be " + std::to_string(_length) + throw std::runtime_error("EncapsPacket data must be " + std::to_string(_length) + " but we have only " + std::to_string(dataSize) + " bytes"); } diff --git a/src/sockets/BaseSocket.cpp b/src/sockets/BaseSocket.cpp index 4e26f18..db9520b 100644 --- a/src/sockets/BaseSocket.cpp +++ b/src/sockets/BaseSocket.cpp @@ -92,13 +92,13 @@ namespace sockets { #ifdef __APPLE__ .tv_sec = static_cast<__darwin_suseconds_t>(recvTimeout.count()/1000), - .tv_usec = static_cast<__darwin_suseconds_t>((recvTimeout.count()%1000)*1000) + .tv_usec = static_cast<__darwin_suseconds_t>((recvTimeout.count()%1000)*1000) #elif __unix__ .tv_sec = static_cast<__time_t>(recvTimeout.count()/1000), - .tv_usec = static_cast<__time_t>((recvTimeout.count()%1000)*1000) + .tv_usec = static_cast<__time_t>((recvTimeout.count()%1000)*1000) #elif defined(_WIN32) || defined(WIN32) || defined(_WIN64) .tv_sec = static_cast(recvTimeout.count()/1000), - .tv_usec = static_cast((recvTimeout.count()%1000)*1000) + .tv_usec = static_cast((recvTimeout.count()%1000)*1000) #endif }; diff --git a/src/sockets/EndPoint.h b/src/sockets/EndPoint.h index dc0f58b..fcc4b9a 100644 --- a/src/sockets/EndPoint.h +++ b/src/sockets/EndPoint.h @@ -21,7 +21,7 @@ namespace sockets { class EndPoint { public: - EndPoint(std::string host, int port); + EndPoint(std::string host, int port); EndPoint(struct sockaddr_in& addr); const std::string &getHost() const; diff --git a/src/utils/Buffer.cpp b/src/utils/Buffer.cpp index 2ac11f5..c2d7df3 100644 --- a/src/utils/Buffer.cpp +++ b/src/utils/Buffer.cpp @@ -125,7 +125,7 @@ Buffer &Buffer::operator<<(float val) { return *this << reinterpret_cast(val); } - Buffer &Buffer::operator>>(float &val) { + Buffer &Buffer::operator>>(float &val) { return *this >> reinterpret_cast(val); } @@ -194,7 +194,7 @@ Buffer &Buffer::operator<<(float val) { >> (uint32_t&)addr.sin_addr.s_addr >> zeros; - addr.sin_family = htons(addr.sin_family); + addr.sin_family = htons(addr.sin_family); val = sockets::EndPoint(addr); return *this; } diff --git a/src/utils/Buffer.h b/src/utils/Buffer.h index 4a61391..ef2e1dd 100644 --- a/src/utils/Buffer.h +++ b/src/utils/Buffer.h @@ -113,7 +113,7 @@ namespace utils { size_t size() const { return _buffer.size(); } size_t pos() const { return _position; } bool isValid() const { return _position <= _buffer.size(); } - bool empty() const { return _position >= _buffer.size(); } + bool empty() const { return _position >= _buffer.size(); } private: std::vector _buffer; size_t _position; diff --git a/src/vendor/ra/powerFlex525/DPIFaultManager.h b/src/vendor/ra/powerFlex525/DPIFaultManager.h index 70de278..7d64ba3 100644 --- a/src/vendor/ra/powerFlex525/DPIFaultManager.h +++ b/src/vendor/ra/powerFlex525/DPIFaultManager.h @@ -32,7 +32,7 @@ namespace powerFlex525 { * * @brief Implements a manager to retrieve new faults and clean its queue * - * It use PrarameterObejcts instead of FaultObject because it doesn't contain the needed information + * It use ParameterObjects instead of FaultObject because it doesn't contain the needed information * */ class DPIFaultManager { @@ -45,7 +45,7 @@ namespace powerFlex525 { * @brief Default constructor (clearFaults = true, resetDevice = false, getFaultDetails = false) */ DPIFaultManager(); - + /** * @brief Constructor * @param clearFaults if true the manager clears the queue after it has retrieved a new fault