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.
17 #ifndef MESSAGE_MANAGER_H_
18 #define MESSAGE_MANAGER_H_
20 #include "messages/message.h"
22 typedef void (*receive_message_cb)(message_t *message, void *user_data);
25 * @brief Initializes message manager module.
27 * @return 0 on success, other value on error.
29 int message_manager_init();
32 * @brief Send message using message manager conenction.
34 * @return 0 on success, other value on error.
36 * @note the @message_manager_init should be called beforehead.
38 int message_manager_send_message(message_t *message);
41 * @brief Set message recieved callback.
43 * @param[in] callback user callback.
44 * @param[in] user_data user data.
46 void message_manager_set_receive_message_cb(receive_message_cb callback, void *user_data);
49 * @brief Shutdowns message manager module.
51 * @return 0 on success, other value on error.
53 void message_manager_shutdown();
55 #endif /* MESSAGE_MANAGER_H_ */