diff options
author | Frank Ronneburg <fronneburg@xevo.com> | 2018-03-28 00:49:07 +0900 |
---|---|---|
committer | fronneburg <fronneburg@xevo.com> | 2018-03-27 16:39:24 -0700 |
commit | 78825ba8035661d0e1a60da3bddb750cbc7dfa56 (patch) | |
tree | 368892b162300ab0198c32035a5500f273202929 /src/components/protocol_handler/include | |
parent | f2c2844eed982badaf27ddcb8a7fb96d5ad2d60b (diff) | |
download | sdl_core-78825ba8035661d0e1a60da3bddb750cbc7dfa56.tar.gz |
Merge pull request #221 in NAR/sdl-core from task/secondary_session_startup to feature/Ford-WiFi
Secondary Transport Protocol and Connection level changes
* commit '25bf959753bad04f3929745f8c9195fd4ded8a19':
send EndService/EndSession properly
handle tcp updates on the fly
handle session ended correctly vis-a-vis multiple transports
manage primary and secondary connections in Start Service code flow
fix: protocol version of Register Secondary Transport ACK/NACK
implement RegisterSecondaryTransport ACK and NAK
delay initial TransportEventUpdate until after StartSessionAck
first protocol steps towards establishing a secondary transport
Conflicts:
src/components/connection_handler/include/connection_handler/connection_handler_impl.h
src/components/connection_handler/src/connection_handler_impl.cc
src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
src/components/protocol_handler/src/protocol_handler_impl.cc
src/components/transport_manager/src/transport_manager_impl.cc
Diffstat (limited to 'src/components/protocol_handler/include')
-rw-r--r-- | src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h | 50 | ||||
-rw-r--r-- | src/components/protocol_handler/include/protocol_handler/protocol_packet.h | 5 |
2 files changed, 50 insertions, 5 deletions
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 0efb81cdd7..beed2bf90b 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 @@ -55,6 +55,7 @@ #include "transport_manager/common.h" #include "transport_manager/transport_manager.h" #include "transport_manager/transport_manager_listener_empty.h" +#include "transport_manager/transport_adapter/transport_adapter.h" #include "connection_handler/connection_handler.h" #include "application_manager/policies/policy_handler_observer.h" @@ -226,14 +227,17 @@ class ProtocolHandlerImpl /** * \brief Sends ending session to mobile application * \param connection_id Identifier of connection within which - * session exists + * session exists (only needed for SendEndService) + * \param connection_id Identifier of the actual transport connection ID + * for the sevice * \param session_id ID of session to be ended */ void SendEndSession(int32_t connection_id, uint8_t session_id); - void SendEndService(int32_t connection_id, - uint8_t session_id, - uint8_t service_type); + void SendEndService(int32_t primary_connection_id, + int32_t connection_id, + uint8_t session_id, + uint8_t service_type); // TODO(Ezamakhov): move Ack/Nack as interface for StartSessionHandler /** @@ -423,7 +427,8 @@ class ProtocolHandlerImpl #endif private: - void SendEndServicePrivate(int32_t connection_id, + void SendEndServicePrivate(int32_t primary_connection_id, + int32_t connection_id, uint8_t session_id, uint8_t service_type); @@ -434,6 +439,27 @@ class ProtocolHandlerImpl uint8_t session_id, uint32_t message_id); + /* + * Prepare and send TransportUpdateEvent message + */ + void SendTransportUpdateEvent(ConnectionID connection_id, + uint8_t session_id); + + /* + * Prepare and send RegisterSecondaryTransportAck message + */ + RESULT_CODE SendRegisterSecondaryTransportAck(ConnectionID connection_id, + ConnectionID primary_transport_connection_id, + uint8_t session_id); + + /* + * Prepare and send RegisterSecondaryTransportNAck message + */ + RESULT_CODE SendRegisterSecondaryTransportNAck(ConnectionID connection_id, + ConnectionID primary_transport_connection_id, + uint8_t session_id, + char *reason = NULL); + /** * @brief Notifies about receiving message from TM. * @@ -481,6 +507,14 @@ class ProtocolHandlerImpl void OnPTUFinished(const bool ptu_result) OVERRIDE; /** + * @brief Notifies that configuration of a transport has been updated. + * + * @param configs pairs of key and value that represent configuration. + */ + void OnTransportConfigUpdated( + const transport_manager::transport_adapter::TransportConfig& configs) OVERRIDE; + + /** * @brief Notifies subscribers about message * received from mobile device. * @param message Message with already parsed header. @@ -581,6 +615,8 @@ class ProtocolHandlerImpl RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet); + RESULT_CODE HandleControlMessageRegisterSecondaryTransport(const ProtocolFramePtr packet); + RESULT_CODE HandleControlMessageHeartBeat(const ProtocolPacket& packet); void PopValideAndExpirateMultiframes(); @@ -699,6 +735,10 @@ class ProtocolHandlerImpl sync_primitives::Lock start_session_frame_map_lock_; StartSessionFrameMap start_session_frame_map_; + bool tcp_enabled_; + std::string tcp_port_; + std::string tcp_ip_address_; + #ifdef TELEMETRY_MONITOR PHTelemetryObserver* metric_observer_; #endif // TELEMETRY_MONITOR 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 1c427533e6..e5b1e3360d 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h @@ -326,6 +326,11 @@ class ProtocolPacket { ConnectionID connection_id() const; /** + * \brief Setter of Connection Identifier + */ + void set_connection_id(ConnectionID connection_id); + + /** * \brief Getter for data payload size */ uint32_t payload_size() const; |