diff options
author | Krzysztof Wieclaw <k.wieclaw@samsung.com> | 2018-10-09 14:32:11 +0200 |
---|---|---|
committer | Krzysztof Wieclaw <k.wieclaw@samsung.com> | 2018-10-23 13:36:31 +0200 |
commit | a26e3b199ba0b8aef41c353e810d0191f1c0cb3b (patch) | |
tree | 5cfdbd0741e87e067b0e9b5bf2ee6e815d1ff5a7 /inc/messages | |
parent | eebc52020e469868ecd0a3360ae4fe81aa8e9c0c (diff) | |
download | gear-racing-car-a26e3b199ba0b8aef41c353e810d0191f1c0cb3b.tar.gz gear-racing-car-a26e3b199ba0b8aef41c353e810d0191f1c0cb3b.tar.bz2 gear-racing-car-a26e3b199ba0b8aef41c353e810d0191f1c0cb3b.zip |
Ported user name message
Change-Id: I5dd7462bcb6ca9f6dab2fd6b314903520f7c23d3
Signed-off-by: Krzysztof Wieclaw <k.wieclaw@samsung.com>
Diffstat (limited to 'inc/messages')
-rw-r--r-- | inc/messages/message.h | 3 | ||||
-rw-r--r-- | inc/messages/message_config_user_name.h | 81 |
2 files changed, 83 insertions, 1 deletions
diff --git a/inc/messages/message.h b/inc/messages/message.h index d4a2d96..2cf653e 100644 --- a/inc/messages/message.h +++ b/inc/messages/message.h @@ -31,7 +31,8 @@ typedef enum message_type { MESSAGE_KEEP_ALIVE, /** Keep alive request */ MESSAGE_ACK, /** Message delivery confirmation */ MESSAGE_COMMAND, /** Message with command data */ - MESSAGE_BYE /** Connection end request */ + MESSAGE_BYE, /** Connection end request */ + MESSAGE_CONFIG_USER_NAME /** User name to be set */ } message_type_e; #define IP_ADDRESS_LEN 15 diff --git a/inc/messages/message_config_user_name.h b/inc/messages/message_config_user_name.h new file mode 100644 index 0000000..d8ddd93 --- /dev/null +++ b/inc/messages/message_config_user_name.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MESSAGE_CONFIG_USER_NAME_H +#define MESSAGE_CONFIG_USER_NAME_H + +#include "messages/message.h" + +/** + * @brief Config user name message data + */ +typedef struct message_config_user_name { + message_t base; /** Base class */ + char *user_name; /** User name */ +} message_config_user_name_t; + +/** + * @brief Initializes message_config_user_name_t object. + * + * @param[in] message config user name message. + */ +void message_config_user_name_init(message_config_user_name_t *message); + +/** + * @brief Get name from mesage. + * + * @param[in] message config user name message. + * + * @return Const pointer to name. + */ +const char *message_config_user_name_get_name(message_config_user_name_t *message); + +/** + * @brief Set name for message. + * + * @param[in] message config user name message. + * @param[in] name name to be set. + */ +void message_config_user_name_set_name(message_config_user_name_t *message, const char *name); + +/** + * @brief Destroys message_config_user_name_t object. + * + * @param[in] message message. + */ +void message_config_user_name_destroy(message_config_user_name_t *message); + +/** + * @brief Deserializes message_config_user_name_t from reader's buffer. + * + * @param[in] message config user name message. + * @param[in] reader reader object. + * + * @return 0 on success, other value on failure. + */ +int message_config_user_name_deserialize(message_config_user_name_t *message, reader_t *reader); + +/** + * @brief Serializes message_config_user_name_t into writer's buffer. + * + * @param[in] message config user name message. + * @param[in] writer writer object. + * + * @return 0 on success, other value on failure. + */ +int message_config_user_name_serialize(message_config_user_name_t *message, writer_t *writer); + +#endif /* end of include guard: MESSAGE_CONFIG_USER_NAME_H */ |