diff options
author | JackLivio <jack@livio.io> | 2018-08-29 14:08:41 -0400 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2018-08-29 14:08:41 -0400 |
commit | cee3ba5cec980dcee4cc37af71bd09dc306d3867 (patch) | |
tree | 3f22a7132d77dde142019231bf10ab2e3be1f5dd /src/components/protocol_handler/include/protocol_handler | |
parent | 90db9ca480eabeaf85ec77626b1bf10fa491270d (diff) | |
parent | 09e4e684708ad5ab2544c72745516e9fe481ba0b (diff) | |
download | sdl_core-cee3ba5cec980dcee4cc37af71bd09dc306d3867.tar.gz |
Merge remote-tracking branch 'origin/develop' into feature/boost_filesystem_implementation
# Conflicts:
# src/3rd_party/CMakeLists.txt
# src/components/utils/CMakeLists.txt
Diffstat (limited to 'src/components/protocol_handler/include/protocol_handler')
4 files changed, 8 insertions, 94 deletions
diff --git a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h index 8b7f28d50e..cb52c9d375 100644 --- a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h +++ b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h @@ -40,6 +40,8 @@ #include "protocol_handler/session_observer.h" #include "security_manager/security_manager_listener.h" +#include "utils/semantic_version.h" + namespace protocol_handler { class ProtocolHandlerImpl; @@ -50,22 +52,9 @@ class ProtocolHandlerImpl; */ class HandshakeHandler : public security_manager::SecurityManagerListener { public: - DEPRECATED HandshakeHandler(ProtocolHandlerImpl& protocol_handler, - SessionObserver& session_observer, - uint32_t connection_key, - ConnectionID connection_id, - uint8_t session_id, - uint8_t protocol_version, - uint32_t hash_id, - ServiceType service_type, - const std::vector<int>& force_protected_service, - const bool is_new_service, - ProtocolPacket::ProtocolVersion& full_version, - std::shared_ptr<BsonObject> payload); - HandshakeHandler(ProtocolHandlerImpl& protocol_handler, SessionObserver& session_observer, - ProtocolPacket::ProtocolVersion& full_version, + utils::SemanticVersion& full_version, const SessionContext& context, const uint8_t protocol_version, std::shared_ptr<BsonObject> payload); @@ -124,7 +113,7 @@ class HandshakeHandler : public security_manager::SecurityManagerListener { ProtocolHandlerImpl& protocol_handler_; SessionObserver& session_observer_; SessionContext context_; - ProtocolPacket::ProtocolVersion full_version_; + utils::SemanticVersion full_version_; const uint8_t protocol_version_; std::shared_ptr<BsonObject> payload_; }; diff --git a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h index bac37b508c..84ec3c9e30 100644 --- a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h +++ b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h @@ -60,7 +60,7 @@ typedef uint32_t MessageID; struct ProtocolFrameData { ProtocolFramePtr frame; - TimevalStruct append_time; + date_time::TimeDuration append_time; }; /** *\brief Map of frames with last frame data for messages received in multiple diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index 58877ac611..3e7d64e9d2 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -45,6 +45,7 @@ #include "utils/messagemeter.h" #include "utils/custom_string.h" +#include "utils/semantic_version.h" #include "protocol_handler/protocol_handler.h" #include "protocol_handler/protocol_packet.h" @@ -313,7 +314,7 @@ class ProtocolHandlerImpl uint32_t hash_code, uint8_t service_type, bool protection, - ProtocolPacket::ProtocolVersion& full_version); + utils::SemanticVersion& full_version); /** * \brief Sends acknowledgement of starting session to mobile application @@ -337,7 +338,7 @@ class ProtocolHandlerImpl uint32_t hash_code, uint8_t service_type, bool protection, - ProtocolPacket::ProtocolVersion& full_version, + utils::SemanticVersion& full_version, BsonObject& params); const ProtocolHandlerSettings& get_settings() const OVERRIDE { @@ -417,27 +418,6 @@ class ProtocolHandlerImpl SessionObserver& get_session_observer() OVERRIDE; /** - * \brief Called by connection handler to notify the result of - * OnSessionStartedCallback(). - * \param connection_id Identifier of connection within which session exists - * \param session_id session ID passed to OnSessionStartedCallback() - * \param generated_session_id Generated session ID, will be 0 if session is - * not started - * \param hash_id Generated Hash ID - * \param protection whether the service will be protected - * \param rejected_params list of parameters' name that are rejected. - * Only valid when generated_session_id is 0. Note, even if - * generated_session_id is 0, the list may be empty. - */ - DEPRECATED void NotifySessionStartedResult( - int32_t connection_id, - uint8_t session_id, - uint8_t generated_session_id, - uint32_t hash_id, - bool protection, - std::vector<std::string>& rejected_params) OVERRIDE; - - /** * @brief Called by connection handler to notify the result of * OnSessionStartedCallback(). * @param context reference to structure with started session data @@ -648,9 +628,6 @@ class ProtocolHandlerImpl RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet); - DEPRECATED RESULT_CODE - HandleControlMessageStartSession(const ProtocolPacket& packet); - RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet); RESULT_CODE HandleControlMessageRegisterSecondaryTransport( diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h index ff084beff8..de4af84915 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h @@ -64,58 +64,6 @@ class ProtocolPacket { }; /** - * \class ProtocolVersion - * \brief Used for storing the full protocol version of a service - * (major.minor.patch). - */ - class ProtocolVersion { - public: - ProtocolVersion(); - ProtocolVersion(uint8_t majorVersion, - uint8_t minorVersion, - uint8_t patchVersion); - ProtocolVersion(ProtocolVersion& other); - ProtocolVersion(std::string versionString); - uint8_t majorVersion; - uint8_t minorVersion; - uint8_t patchVersion; - static inline int16_t cmp(const ProtocolVersion& version1, - const ProtocolVersion& version2) { - int16_t diff = - static_cast<int16_t>(version1.majorVersion - version2.majorVersion); - if (diff == 0) { - diff = - static_cast<int16_t>(version1.minorVersion - version2.minorVersion); - if (diff == 0) { - diff = static_cast<int16_t>(version1.patchVersion - - version2.patchVersion); - } - } - return diff; - } - inline bool operator==(const ProtocolVersion& other) { - return ProtocolVersion::cmp(*this, other) == 0; - } - inline bool operator<(const ProtocolVersion& other) { - return ProtocolVersion::cmp(*this, other) < 0; - } - bool operator>(const ProtocolVersion& other) { - return ProtocolVersion::cmp(*this, other) > 0; - } - inline bool operator<=(const ProtocolVersion& other) { - return ProtocolVersion::cmp(*this, other) <= 0; - } - bool operator>=(const ProtocolVersion& other) { - return ProtocolVersion::cmp(*this, other) >= 0; - } - static inline ProtocolVersion* min(ProtocolVersion& version1, - ProtocolVersion& version2) { - return (version1 < version2) ? &version1 : &version2; - } - std::string to_string(); - }; - - /** * \class ProtocolHeader * \brief Used for storing protocol header of a message. */ |