ubinos
msgq.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 Sung Ho Park
3  Contact: ubinos.org@gmail.com
4 
5  This file is part of the itf_ubinos component of the Ubinos.
6 
7  GNU General Public License Usage
8  This file may be used under the terms of the GNU
9  General Public License version 3.0 as published by the Free Software
10  Foundation and appearing in the file license_gpl3.txt included in the
11  packaging of this file. Please review the following information to
12  ensure the GNU General Public License version 3.0 requirements will be
13  met: http://www.gnu.org/copyleft/gpl.html.
14 
15  GNU Lesser General Public License Usage
16  Alternatively, this file may be used under the terms of the GNU Lesser
17  General Public License version 2.1 as published by the Free Software
18  Foundation and appearing in the file license_lgpl.txt included in the
19  packaging of this file. Please review the following information to
20  ensure the GNU Lesser General Public License version 2.1 requirements
21  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22 
23  Commercial Usage
24  Alternatively, licensees holding valid commercial licenses may
25  use this file in accordance with the commercial license agreement
26  provided with the software or, alternatively, in accordance with the
27  terms contained in a written agreement between you and rightful owner.
28  */
29 
30 #ifndef UBIK_MSGQ_H_
31 #define UBIK_MSGQ_H_
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37 
141 #include <ubinos_config.h>
142 #include <ubinos/type.h>
143 
144 #include "task.h"
145 
147 #define MSGQ_OPT__IGNOREOVERFLOW 0x80
148 
150 typedef struct __msgq_tip_t
151 {
152  unsigned int type :8;
153  unsigned int valid :1;
154  unsigned int reserved :7;
155  unsigned int reserved2 :16;
156 } _msgq_tip_t;
157 
160 
178 int msgq_create(msgq_pt * msgq_p, unsigned int msgsize, unsigned int maxcount);
179 
201 int msgq_create_ext(msgq_pt * msgq_p, unsigned int msgsize,
202  unsigned int maxcount, unsigned int option);
203 
217 int msgq_delete(msgq_pt * msgq_p);
218 
235 int msgq_receive(msgq_pt msgq, unsigned char * msg);
236 
257 int msgq_receive_timed(msgq_pt msgq, unsigned char * msg, unsigned int tick);
258 
279 int msgq_receive_timedms(msgq_pt msgq, unsigned char * msg,
280  unsigned int timems);
281 
297 int msgq_send(msgq_pt msgq, unsigned char * msg);
298 
310 int msgq_clear(msgq_pt msgq);
311 
327 int msgq_setsender(msgq_pt msgq, task_pt task);
328 
343 int msgq_getcount(msgq_pt msgq, unsigned int * count_p);
344 
345 #ifdef __cplusplus
346 }
347 #endif
348 
349 #endif /* UBIK_MSGQ_H_ */
task.h
ubik task API
msgq_setsender
int msgq_setsender(msgq_pt msgq, task_pt task)
msgq_pt
_msgq_tip_t * msgq_pt
Definition: msgq.h:159
msgq_clear
int msgq_clear(msgq_pt msgq)
__msgq_tip_t::reserved2
unsigned int reserved2
Definition: msgq.h:155
msgq_create
int msgq_create(msgq_pt *msgq_p, unsigned int msgsize, unsigned int maxcount)
msgq_delete
int msgq_delete(msgq_pt *msgq_p)
type.h
ubinos basic data type
msgq_create_ext
int msgq_create_ext(msgq_pt *msgq_p, unsigned int msgsize, unsigned int maxcount, unsigned int option)
__task_tip_t
Definition: task.h:361
_msgq_tip_t
struct __msgq_tip_t _msgq_tip_t
msgq_receive_timed
int msgq_receive_timed(msgq_pt msgq, unsigned char *msg, unsigned int tick)
__msgq_tip_t
Definition: msgq.h:150
msgq_send
int msgq_send(msgq_pt msgq, unsigned char *msg)
msgq_receive
int msgq_receive(msgq_pt msgq, unsigned char *msg)
msgq_getcount
int msgq_getcount(msgq_pt msgq, unsigned int *count_p)
__msgq_tip_t::reserved
unsigned int reserved
Definition: msgq.h:154
msgq_receive_timedms
int msgq_receive_timedms(msgq_pt msgq, unsigned char *msg, unsigned int timems)
__msgq_tip_t::type
unsigned int type
Definition: msgq.h:152
__msgq_tip_t::valid
unsigned int valid
Definition: msgq.h:153