diff options
Diffstat (limited to 'src/components/include/protocol')
-rw-r--r-- | src/components/include/protocol/common.h | 11 | ||||
-rw-r--r-- | src/components/include/protocol/message_priority.h | 5 | ||||
-rw-r--r-- | src/components/include/protocol/raw_message.h | 14 | ||||
-rw-r--r-- | src/components/include/protocol/rpc_type.h | 8 | ||||
-rw-r--r-- | src/components/include/protocol/service_type.h | 8 |
5 files changed, 26 insertions, 20 deletions
diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h index 91bc53652c..ce4c4adf6f 100644 --- a/src/components/include/protocol/common.h +++ b/src/components/include/protocol/common.h @@ -79,12 +79,14 @@ enum { *@brief Constant: number of protocol version (4). * This protocol is compatibility with version 3 * Support SSL with Encryption, Video and Audio services - * Support ControlFrame, End Service to/from mobile support, HeartBeat feature, + * Support ControlFrame, End Service to/from mobile support, HeartBeat + *feature, * SDL4.0 feature. */ PROTOCOL_VERSION_4 = 0x04, /** - *\brief Maximum value of packet version field (size 4-bit) specified AppLink Protocol v.7 + *\brief Maximum value of packet version field (size 4-bit) specified AppLink + *Protocol v.7 */ PROTOCOL_VERSION_MAX = 0x0F }; @@ -93,7 +95,7 @@ enum { *\brief Flag of protection packet * 1-bit field of AppLink protocol packet */ -const bool PROTECTION_ON = true; +const bool PROTECTION_ON = true; const bool PROTECTION_OFF = false; /** @@ -184,7 +186,8 @@ enum { */ FRAME_DATA_LAST_CONSECUTIVE = 0x00, /** - *\brief Maximum of consecutive frame numbers after which count has to roll over to 0x01 + *\brief Maximum of consecutive frame numbers after which count has to roll + *over to 0x01 */ FRAME_DATA_MAX_CONSECUTIVE = 0xFF, diff --git a/src/components/include/protocol/message_priority.h b/src/components/include/protocol/message_priority.h index baed0d89c4..c672af3a37 100644 --- a/src/components/include/protocol/message_priority.h +++ b/src/components/include/protocol/message_priority.h @@ -50,16 +50,17 @@ class MessagePriority { static MessagePriority FromServiceType(ServiceType service_type); // Trivial inline copy constructor - MessagePriority(const MessagePriority &that); + MessagePriority(const MessagePriority& that); // Ordering value which is used by queues to order messages // Higher value means higher prioirty size_t OrderingValue() const; + private: // Constructor is private to prevent creation // of random priorities in the code please use static constructor if you // need priority value - explicit MessagePriority(int32_t value): value_(value) {} + explicit MessagePriority(int32_t value) : value_(value) {} size_t value_; }; } // namespace protocol_handler diff --git a/src/components/include/protocol/raw_message.h b/src/components/include/protocol/raw_message.h index f9a035e174..99cb73ce67 100644 --- a/src/components/include/protocol/raw_message.h +++ b/src/components/include/protocol/raw_message.h @@ -54,8 +54,10 @@ class RawMessage { * \param dataSize Message size * \param payload_size Received data size */ - RawMessage(uint32_t connection_key, uint32_t protocol_version, - const uint8_t *const data_param, uint32_t data_size, + RawMessage(uint32_t connection_key, + uint32_t protocol_version, + const uint8_t* const data_param, + uint32_t data_size, uint8_t type = ServiceType::kRpc, uint32_t payload_size = 0); /** @@ -74,11 +76,11 @@ class RawMessage { /** * \brief Getter for message string data */ - uint8_t *data() const; + uint8_t* data() const; /** * \brief Getter for message size */ - size_t data_size() const; + size_t data_size() const; /** * \brief Getter for actual data size */ @@ -104,7 +106,7 @@ class RawMessage { private: uint32_t connection_key_; - uint8_t *data_; + uint8_t* data_; size_t data_size_; uint32_t protocol_version_; ServiceType service_type_; @@ -112,6 +114,6 @@ class RawMessage { bool waiting_; DISALLOW_COPY_AND_ASSIGN(RawMessage); }; -typedef utils::SharedPtr<RawMessage> RawMessagePtr; +typedef utils::SharedPtr<RawMessage> RawMessagePtr; } // namespace protocol_handler #endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_ diff --git a/src/components/include/protocol/rpc_type.h b/src/components/include/protocol/rpc_type.h index 5419bb5fce..db4a808cfd 100644 --- a/src/components/include/protocol/rpc_type.h +++ b/src/components/include/protocol/rpc_type.h @@ -40,8 +40,8 @@ namespace protocol_handler { // AppLink protocol 4.1.3 RpcType field enum RpcType { - kRpcTypeRequest = 0x0, - kRpcTypeResponse = 0x1, + kRpcTypeRequest = 0x0, + kRpcTypeResponse = 0x1, kRpcTypeNotification = 0x2, kRpcTypeReserved }; @@ -51,8 +51,8 @@ RpcType RpcTypeFromByte(uint8_t byte); // Check and convert RpcType to byte value ready to be transmitted uint8_t RpcTypeToByte(RpcType type); -const char *RpcTypeToString(RpcType type); +const char* RpcTypeToString(RpcType type); -std::ostream &operator<<(std::ostream &os, RpcType rpc_type); +std::ostream& operator<<(std::ostream& os, RpcType rpc_type); } // namespace protocol_handler #endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_RPC_TYPE_H_ diff --git a/src/components/include/protocol/service_type.h b/src/components/include/protocol/service_type.h index b5870e0af1..803b8106b8 100644 --- a/src/components/include/protocol/service_type.h +++ b/src/components/include/protocol/service_type.h @@ -66,11 +66,11 @@ const uint8_t SERVICE_TYPE_BULK = 0x0F; Navi for video streaming, bulk for PutFile. */ enum ServiceType { - kControl = SERVICE_TYPE_CONTROL, - kRpc = SERVICE_TYPE_RPC, - kAudio = SERVICE_TYPE_AUDIO, + kControl = SERVICE_TYPE_CONTROL, + kRpc = SERVICE_TYPE_RPC, + kAudio = SERVICE_TYPE_AUDIO, kMobileNav = SERVICE_TYPE_NAVI, - kBulk = SERVICE_TYPE_BULK, + kBulk = SERVICE_TYPE_BULK, kInvalidServiceType }; |