2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.1 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "messages/message.h"
23 * @brief Ack message data
25 typedef struct message_ack {
26 message_t base; /** Base class */
27 int64_t ack_serial; /** The serial of message which reception is confirmed */
31 * @brief Initializes message_ack_t object.
33 * @param[in] message ack message.
35 void message_ack_init(message_ack_t *message);
38 * @brief initializes message_ack_t message form other message.
39 * The serial number returned by @message_ack_get_ack_serial will
40 * be set to @request's serial.
42 * @param[in] message ack message.
43 * @param[in] request the message which reception will be confirmed by
46 void message_ack_init_from_request(message_ack_t *message, message_t *request);
49 * @brief Gets serial number of confirmed message.
51 * @return the serial number.
53 int64_t message_ack_get_ack_serial(message_ack_t *message);
56 * @brief Destroys message_ack_t object.
58 * @param[in] message ack message.
60 void message_ack_destroy(message_ack_t *message);
63 * @brief Deserializes message_ack_t from reader's buffer.
65 * @param[in] message ack message.
66 * @param[in] reader reader object.
68 * @return 0 on success, other value on failure.
70 int message_ack_deserialize(message_ack_t *message, reader_t *reader);
73 * @brief Serializes message_ack_t into writer's buffer.
75 * @param[in] message message object.
76 * @param[in] writer writer object.
78 * @return 0 on success, other value on failure.
80 int message_ack_serialize(message_ack_t *message, writer_t *writer);
82 #endif /* end of include guard: MESSAGE_ACK_H */