2 * Copyright (c) 2017 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 __CAR_APP_MESSAGE_H__
18 #define __CAR_APP_MESSAGE_H__
20 typedef enum __message_cmd_e {
21 MESSAGE_CMD_HELLO, /* to use keep alive, if needed */
22 MESSAGE_CMD_CALIBRATION,
24 MESSAGE_CMD_BYE, /* to notify explicitly closing connection */
27 struct __message_type_s {
28 unsigned long long int seq_num;
32 unsigned long long int time; /* to be used to order messages */
34 typedef struct __message_type_s message_s;
36 int message_new(message_cmd_e cmd, int servo, int speed, message_s *new_msg);
37 void message_reset_seq_num(void);
39 int message_queue_new(void);
40 void message_queue_clear(void);
42 void message_push_to_inqueue(message_s *msg);
43 message_s *message_pop_from_inqueue(void);
45 void message_push_to_outqueue(message_s *msg);
46 message_s *message_pop_from_outqueue(void);
48 #endif /* __CAR_APP_MESSAGE_H__ */