Ported messages from gear racing controller
[apps/native/gear-racing-car.git] / inc / messages / message_manager.h
1 /*
2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3 *
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
7 *
8 * http://floralicense.org/license/
9 *
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.
15 */
16
17 #ifndef MESSAGE_MANAGER_H_
18 #define MESSAGE_MANAGER_H_
19
20 #include "messages/message.h"
21
22 typedef void (*receive_message_cb)(message_t *message, void *user_data);
23
24 /**
25  * @brief Initializes message manager module.
26  *
27  * @return 0 on success, other value on error.
28  */
29 int message_manager_init();
30
31 /**
32  * @brief Send message using message manager conenction.
33  *
34  * @return 0 on success, other value on error.
35  *
36  * @note the @message_manager_init should be called beforehead.
37  */
38 int message_manager_send_message(message_t *message);
39
40 /**
41  * @brief Set message recieved callback.
42  *
43  * @param[in] callback user callback.
44  * @param[in] user_data user data.
45  */
46 void message_manager_set_receive_message_cb(receive_message_cb callback, void *user_data);
47
48 /**
49  * @brief Shutdowns message manager module.
50  *
51  * @return 0 on success, other value on error.
52  */
53 void message_manager_shutdown();
54
55 #endif /* MESSAGE_MANAGER_H_ */