summaryrefslogtreecommitdiff
path: root/inc/messages
diff options
context:
space:
mode:
Diffstat (limited to 'inc/messages')
-rw-r--r--inc/messages/message.h3
-rw-r--r--inc/messages/message_config_user_name.h81
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 */