summaryrefslogtreecommitdiff
path: root/src/components/protocol_handler/include/protocol_handler
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/protocol_handler/include/protocol_handler')
-rw-r--r--src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h2
-rw-r--r--src/components/protocol_handler/include/protocol_handler/multiframe_builder.h38
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h60
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_packet.h20
4 files changed, 62 insertions, 58 deletions
diff --git a/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h b/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
index 4633be6c6e..82bf563bc5 100644
--- a/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
+++ b/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
@@ -34,9 +34,9 @@
#include <map>
#include <vector>
-#include "utils/macro.h"
#include "protocol_handler/protocol_packet.h"
#include "transport_manager/common.h"
+#include "utils/macro.h"
namespace protocol_handler {
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 84ec3c9e30..3da63bd79f 100644
--- a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
+++ b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
@@ -33,13 +33,13 @@
#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_MULTIFRAME_BUILDER_H_
#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_MULTIFRAME_BUILDER_H_
-#include <map>
-#include <ostream> // std::basic_ostream
-#include <iterator> // std::ostream_iterator
#include <algorithm> // std::copy
+#include <iterator> // std::ostream_iterator
+#include <map>
+#include <ostream> // std::basic_ostream
-#include "utils/date_time.h"
#include "protocol_handler/protocol_packet.h"
+#include "utils/date_time.h"
/**
*\namespace protocol_handlerHandler
@@ -86,36 +86,36 @@ typedef std::map<ConnectionID, SessionToFrameMap> MultiFrameMap;
class MultiFrameBuilder {
public:
/**
- * @brief Constructor
- */
+ * @brief Constructor
+ */
MultiFrameBuilder();
/**
- *\brief Set timeout of waiting CONSECUTIVE frames
- */
+ *\brief Set timeout of waiting CONSECUTIVE frames
+ */
void set_waiting_timeout(const uint32_t consecutive_frame_wait_msecs);
/**
- * @brief Add connection for pending data
- * @return true on success
- */
+ * @brief Add connection for pending data
+ * @return true on success
+ */
bool AddConnection(const ConnectionID connection_id);
/**
- * @brief Clear all data related to connection_id
- * @return true on success
- */
+ * @brief Clear all data related to connection_id
+ * @return true on success
+ */
bool RemoveConnection(const ConnectionID connection_id);
/**
- *\brief Pop assembled and expired frames
- */
+ *\brief Pop assembled and expired frames
+ */
ProtocolFramePtrList PopMultiframes();
/**
- *\brief Handle Single or Consecutive frame
- * @return RESULT_OK on success, or RESULT_FAIL in case of any error
- */
+ *\brief Handle Single or Consecutive frame
+ * @return RESULT_OK on success, or RESULT_FAIL in case of any error
+ */
RESULT_CODE AddFrame(const ProtocolFramePtr packet);
private:
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 7c2b411dcb..15996bb4e2 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
@@ -33,33 +33,33 @@
#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_
#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_
+#include <stdint.h>
#include <map>
#include <memory>
#include <set>
-#include <stdint.h>
#include <utility> // std::make_pair
#include <vector>
-#include "utils/prioritized_queue.h"
#include "utils/message_queue.h"
+#include "utils/prioritized_queue.h"
#include "utils/threads/message_loop_thread.h"
-#include "utils/messagemeter.h"
#include "utils/custom_string.h"
+#include "utils/messagemeter.h"
#include "utils/semantic_version.h"
+#include "application_manager/policies/policy_handler_observer.h"
+#include "connection_handler/connection_handler.h"
+#include "protocol_handler/incoming_data_handler.h"
+#include "protocol_handler/multiframe_builder.h"
#include "protocol_handler/protocol_handler.h"
-#include "protocol_handler/protocol_packet.h"
#include "protocol_handler/protocol_handler_settings.h"
-#include "protocol_handler/session_observer.h"
#include "protocol_handler/protocol_observer.h"
-#include "protocol_handler/incoming_data_handler.h"
-#include "protocol_handler/multiframe_builder.h"
+#include "protocol_handler/protocol_packet.h"
+#include "protocol_handler/session_observer.h"
#include "transport_manager/common.h"
+#include "transport_manager/transport_adapter/transport_adapter.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"
#ifdef TELEMETRY_MONITOR
#include "protocol_handler/telemetry_observer.h"
@@ -67,8 +67,8 @@
#endif // TELEMETRY_MONITOR
#ifdef ENABLE_SECURITY
-#include "security_manager/security_manager.h"
#include "protocol_handler/handshake_handler.h"
+#include "security_manager/security_manager.h"
#endif // ENABLE_SECURITY
namespace connection_handler {
@@ -110,7 +110,8 @@ struct RawFordMessageFromMobile : public ProtocolFramePtr {
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return MessagePriority::FromServiceType(
- ServiceTypeFromByte(get()->service_type())).OrderingValue();
+ ServiceTypeFromByte(get()->service_type()))
+ .OrderingValue();
}
};
@@ -122,7 +123,8 @@ struct RawFordMessageToMobile : public ProtocolFramePtr {
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return MessagePriority::FromServiceType(
- ServiceTypeFromByte(get()->service_type())).OrderingValue();
+ ServiceTypeFromByte(get()->service_type()))
+ .OrderingValue();
}
// Signals whether connection to mobile must be closed after processing this
// message
@@ -131,9 +133,11 @@ struct RawFordMessageToMobile : public ProtocolFramePtr {
// Short type names for prioritized message queues
typedef threads::MessageLoopThread<
- utils::PrioritizedQueue<RawFordMessageFromMobile> > FromMobileQueue;
+ utils::PrioritizedQueue<RawFordMessageFromMobile> >
+ FromMobileQueue;
typedef threads::MessageLoopThread<
- utils::PrioritizedQueue<RawFordMessageToMobile> > ToMobileQueue;
+ utils::PrioritizedQueue<RawFordMessageToMobile> >
+ ToMobileQueue;
// Type to allow easy mapping between a device type and transport
// characteristics
@@ -176,10 +180,10 @@ class ProtocolHandlerImpl
public impl::FromMobileQueue::Handler,
public impl::ToMobileQueue::Handler
#ifdef TELEMETRY_MONITOR
- ,
+ ,
public telemetry_monitor::TelemetryObservable<PHTelemetryObserver>
#endif // TELEMETRY_MONITOR
- {
+{
public:
/**
* @brief Constructor
@@ -252,20 +256,20 @@ class ProtocolHandlerImpl
void SendHeartBeat(int32_t connection_id, uint8_t session_id);
/**
- * \brief Sends ending session to mobile application
- * \param connection_id Identifier of connection within which
- * session exists
- * \param session_id ID of session to be ended
- */
+ * \brief Sends ending session to mobile application
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session to be ended
+ */
void SendEndSession(int32_t connection_id, uint8_t session_id);
/**
- * \brief Sends ending session to mobile application
- * \param primary_connection_id Identifier of connection within which
- * service exists
- * \param connection_id Identifier of the actual transport for the service
- * \param session_id ID of session to be ended
- */
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
void SendEndService(int32_t primary_connection_id,
int32_t connection_id,
uint8_t session_id,
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 de4af84915..215c63c685 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
@@ -34,9 +34,9 @@
#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PACKET_H_
#include <list>
-#include "utils/macro.h"
#include "protocol/common.h"
#include "transport_manager/common.h"
+#include "utils/macro.h"
/**
*\namespace protocol_handlerHandler
@@ -275,8 +275,8 @@ class ProtocolPacket {
/*End of Deserialization*/
/**
- * \brief Getter for Connection Identifier
- */
+ * \brief Getter for Connection Identifier
+ */
ConnectionID connection_id() const;
/**
@@ -285,13 +285,13 @@ class ProtocolPacket {
void set_connection_id(ConnectionID connection_id);
/**
- * \brief Getter for data payload size
- */
+ * \brief Getter for data payload size
+ */
uint32_t payload_size() const;
/**
- * \brief Getter for full header information
- */
+ * \brief Getter for full header information
+ */
const ProtocolHeader& packet_header() const;
private:
@@ -311,9 +311,9 @@ class ProtocolPacket {
uint32_t payload_size_;
/**
- * \brief Connection Identifier
- * Obtained from connection_handler
- */
+ * \brief Connection Identifier
+ * Obtained from connection_handler
+ */
ConnectionID connection_id_;
DISALLOW_COPY_AND_ASSIGN(ProtocolPacket);